I have OpenWRT running in a virtual machine. It's network adapter is bridged to the host.
Host ifconfig
root@michael-VirtualBox:/home/michael/Scripts/python# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:8c:1b:c3
inet addr:10.0.2.16 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe8c:1bc3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:784199 errors:0 dropped:0 overruns:0 frame:0
TX packets:452028 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:953595278 (953.5 MB) TX bytes:30390503 (30.3 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4393 errors:0 dropped:0 overruns:0 frame:0
TX packets:4393 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:386626 (386.6 KB) TX bytes:386626 (386.6 KB)
OpenWRT ifconfig
root@OpenWrt:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:8A:24:52
inet addr:10.0.2.18 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe8a:2452/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5241 errors:0 dropped:0 overruns:0 frame:0
TX packets:5130 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:461014 (450.2 KiB) TX bytes:1198305 (1.1 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:262 errors:0 dropped:0 overruns:0 frame:0
TX packets:262 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20416 (19.9 KiB) TX bytes:20416 (19.9 KiB)
If I want to say, ping 8.8.8.8 from my host, and route it through the VM, would I do the following from the host?
route add 8.8.8.8 gw 10.0.2.18
And if so, should I be able to see the ping's coming through using tcpdump
on the virtual machine side?
When I do a tcpdump
on the OpenWRT VM, it doesn't seem to pump out information for each ping on the host side.
After I do route add 8.8.8.8 gw 10.0.2.18
, I get a reply for each ping.
Is there any way to verify if the ping's are being routed correctly?
Update
Output of tracepath 8.8.8.8
root@michael-VirtualBox:/home/michael/Scripts/python# tracepath 8.8.8.8
1: michael-VirtualBox.local 0.189ms pmtu 1500
1: 10.0.2.2 0.393ms
1: 10.0.2.2 0.539ms
2: no reply
3: no reply
4: no reply
5: no reply
6: no reply
7: no reply
8: no reply
9: no reply
10: no reply
11: no reply
12: no reply
13: no reply
14: no reply
15: no reply
16: no reply
17: no reply
18: no reply
19: no reply
20: no reply
21: no reply
22: no reply
23: no reply
24: no reply
25: no reply
26: no reply
27: no reply
28: no reply
29: no reply
30: no reply
31: no reply
Too many hops: pmtu 1500
Resume: pmtu 1500
p.s root@michael-VirtualBox is my host machine (also running in a VM :P)