Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an embedded system running Angstrom just fine. This platform has multiple uses, one of which is to act as a home router, so it has wireless and wired network interfaces, which work correctly. I'm trying to configure DHCPD so that each interfaces hands out IP addresses from the same range, for instance 192.168.1.2 - 192.168.1.100, and I can't figure this out. Everything works fine if the interfaces handle different subnets, but when both interfaces are on the same subnet, things don't work. I've seen conflicting answers out there about whether this is even possible - but all home routers do this exact scenario, so there must be a way. I don't have my config files right now - will post them later. So I'm looking for advice if this is even possible. Tnanks!

Update: here's the script that worked - thanks Bill

# route all packets between all interfaces
iptables -t nat -A POSTROUTING -s 172.16.0.0/16 -d 172.16.0.0/16 -j ACCEPT
iptables -t nat -A POSTROUTING -s 172.16.0.0/16 -j MASQUERADE

# set the MAC address 

ifconfig eth0 0 0.0.0.0
ifconfig eth0 down
ip link set eth0 address 00:80:44:0F:06:C7

# setup the bridge

brctl addbr br0
brctl stp br0 off
brctl addif br0 eth0

# hostapd sets up the wireless before it is added to bridge
  hostapd -B /etc/hostapd/hostapd.conf
  brctl addif br0 wlan0
  ifconfig wlan0 up
  ifconfig wlan0 0 0.0.0.0

  ifconfig eth0 up
  ifconfig br0 172.16.10.247 netmask 255.255.0.0 up
  route add default gw 172.16.1.1 br0
share|improve this question
    
BillThor was right on the money - I've added the script that worked for me –  Jeff Jan 24 '12 at 15:49
add comment

1 Answer

up vote 1 down vote accepted

If you look at the hardware for a home router you will find that all the ports exist on the same interface. On my OpenWRT system the WLAN interface is identified by using a different VLAN for it.

Handing out addresses from the same pool between Wifi and the ports is done by bridging the interfaces. Addresses are then handed out to devices connected to the bridge. Without the bridge there are two separate devices which require different ranges.

As your device appears to have separate interfaces for each port create a bridge containing all the ports connected to the same network. Provide DHCP services to the bridge rather than the interfaces.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.