Multi subnet in ubuntu with dnsmasq

Posted by Fox Mulder on Ask Ubuntu See other posts from Ask Ubuntu or by Fox Mulder
Published on 2012-04-02T22:41:09Z Indexed on 2012/04/02 23:42 UTC
Read the original article Hit count: 246

Filed under:
|

I have a multi lan port box that install ubuntu server 11.10.

I am setup network in /etc/network/interfaces file as follow:


auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
     address 192.168.128.254
     netmask 255.255.255.0
     network 192.168.128.0
     broadcast 192.168.128.255
     gateway 192.168.128.1
     dns-nameservers xxxxxx

auto eth1
iface eth1 inet static
     address 192.168.11.1
     netmask 255.255.255.0
     network 192.168.11.0
     broadcast 192.168.11.255

auto eth2
iface eth2 inet static
     address 192.168.21.1
     netmask 255.255.255.0
     network 192.168.21.0
     broadcast 192.168.21.255

auto eth3
iface eth3 inet static
     address 192.168.31.1
     netmask 255.255.255.0
     network 192.168.31.0
     broadcast 192.168.31.255


I am also enable the ip forward by echo 1 > /proc/sys/net/ipv4/if_forward in rc.local.

my dnsmasq config as follow

except-interface=eth0
dhcp-range=interface:eth1,set:wifi,192.168.11.101,192.168.11.200,255.255.255.0
dhcp-range=interface:eth2,set:kids,192.168.21.101,192.168.21.200,255.255.255.0
dhcp-range=interface:eth3,set:game,192.168.31.101,192.168.31.200,255.255.255.0

the dhcp was working fine in eth1,eth2,eth3, any machine plug in the subnet can get correct subnet's ip.

My problem was, each subnet machine can't ping each other. for example.

192.168.11.101 can't ping 192.168.21.101 but can ping 192.168.128.1 192.168.31.101 can't ping 192.168.21.101 but can ping 192.168.128.1

I am also try to using route add -net 192.168.11.0 netmask 255.255.255.0 gw 192.168.11.1 (and also 192.168.21.0/192.168.31.0) at this multi-lan-port machine.

But still won't work.

Does anyone can help ? Thanks.

© Ask Ubuntu or respective owner

Related posts about 11.10

Related posts about router