I am using a virtual machine with OpenWRT for routing, on a Linux machine (Slackware). I am trying to configure a host only interface (eth0) as the wan interface. eth1 is Ethernet attached as a bridge interface.
I tried to test the configuration pinging to an external ip address (from OpenWRT).
# ping -I eth0 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 0 packets received, 100% packet loss
I used wireshark and i saw the system (OpenWRT side) is sending ARP request asking for the mac address of 8.8.8.8. What is going on? It looks that the gateway is being ignored.
My route:
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.56.1 0.0.0.0 UG 1 0 0 eth0
default 192.168.56.1 0.0.0.0 UG 5 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.56.0 * 255.255.255.0 U 5 0 0 eth0
Iptables is configure to accept all packets for input, output and forward.
More tests:
# ping -I eth0 192.168.56.1
PING 192.168.56.1 (192.168.56.1): 56 data bytes
64 bytes from 192.168.56.1: seq=0 ttl=64 time=10.000 ms
64 bytes from 192.168.56.1: seq=1 ttl=64 time=0.000 ms
64 bytes from 192.168.56.1: seq=2 ttl=64 time=0.000 ms
64 bytes from 192.168.56.1: seq=3 ttl=64 time=0.000 ms
^C
--- 192.168.56.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.000/2.500/10.000 ms
.
# ip route show
default via 192.168.56.1 dev eth0 proto static metric 1
default via 192.168.56.1 dev eth0 proto static metric 5
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1
192.168.56.0/24 dev eth0 proto static scope link metric 5