1

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)

1
  • WHY (in the name of all sanity) do you want to do this? What specific, practical problem are you trying to solve?
    – voretaq7
    Dec 10, 2013 at 20:55

1 Answer 1

1

For that you can you the tracepath. It will show you every host that you ping passes through.

and don't forget to check the firewalls !

4
  • Hey thanks for the suggestion, I gave that a try and it looks like I have done something wrong, I have updated my question if you want to take a look
    – TomSelleck
    Dec 10, 2013 at 13:18
  • Which is the role of 10.0.2.2 ? is it a gateway ? (again, check the firewall) and also if you have the packet forward enabled Dec 10, 2013 at 13:20
  • I'm not sure to be honest... Any way to check?
    – TomSelleck
    Dec 10, 2013 at 14:20
  • You could have a look at servercomputing.blogspot.ch/2012/02/… for packet forwarding. Dec 10, 2013 at 14:27

Not the answer you're looking for? Browse other questions tagged .