Ubuntu box static routing problem
        Posted  
        
            by 
                Rafael
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by Rafael
        
        
        
        Published on 2011-01-05T16:39:30Z
        Indexed on 
            2011/01/05
            16:55 UTC
        
        
        Read the original article
        Hit count: 453
        
Hello,
I'm trying to configure a ubuntu server to be a router. This is my interface configuration (eth2 connects to my WAN, eth0 to my LAN):
auto eth2
iface eth2 inet static
    address 192.168.0.249
    netmask 255.255.255.0
    gateway 192.168.0.1
    broadcast 192.168.0.255
auto eth0
iface eth0 inet static
    address 192.168.100.1
    netmask 255.255.255.0
This is the router information:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 eth2
And this is dhcp configuration:
subnet 192.168.100.0 netmask 255.255.255.0 {
    range 192.168.100.101 192.168.100.254;
    option domain-name-servers 201.70.86.133;
    option routers 192.168.100.1;
    authoritative;
}
I'm then connecting a mac os x by cable on eth0. This is en0 interface configuration:
en0: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
 ether 00:26:bb:5d:82:b0 
 inet6 fe80::226:bbff:fe5d:82b0%en0 prefixlen 64 scopeid 0x4 
 inet 192.168.100.101 netmask 0xffffff00 broadcast 192.168.100.255
 media: autoselect (100baseTX <full-duplex>)
 status: active
And this is the routing table:
Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            192.168.100.1      UGSc          139       32     en0
10.37.129/24       link#8             UC              2        0   vnic1
10.37.129.2        0:1c:42:0:0:9      UHLWI           0      839     lo0
10.37.129.255      ff:ff:ff:ff:ff:ff  UHLWbI          0        4   vnic1
10.211.55/24       link#7             UC              2        0   vnic0
10.211.55.2        0:1c:42:0:0:8      UHLWI           0      840     lo0
10.211.55.255      ff:ff:ff:ff:ff:ff  UHLWbI          0        4   vnic0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              3   507924     lo0
169.254            link#4             UCS             0        0     en0
172.16.42/24       link#10            UC              2        0  vmnet8
172.16.42.1        0:50:56:c0:0:8     UHLWI           0      839     lo0
172.16.42.255      link#10            UHLWbI          1       24  vmnet8
192.168.100        link#4             UC              2        0     en0
192.168.100.1      0:e0:7c:7e:f:99    UHLWI         139        0     en0    777
192.168.100.101    127.0.0.1          UHS             0        0     lo0
192.168.100.255    ff:ff:ff:ff:ff:ff  UHLWbI          0        4     en0
192.168.116        link#9             UC              2        0  vmnet1
192.168.116.1      0:50:56:c0:0:1     UHLWI           0      839     lo0
192.168.116.255    ff:ff:ff:ff:ff:ff  UHLWbI          0        4  vmnet1
When I ping 192.168.100.1, it works. When I ping 192.168.0.249, it also works. However, when I try to ping 192.168.0.1 it does not.
Does anyone has any way to solve this? Is there a way to debug it?
Thanks,
© Server Fault or respective owner