ip forwarding/routing in guest with NAT

Discussions about using Linux guests in VirtualBox.
Post Reply
mike1777
Posts: 3
Joined: 2. Jul 2010, 17:34
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu 10.4

ip forwarding/routing in guest with NAT

Post by mike1777 »

Hi,
Here is my configuration: vbox 3.2.6 (latest) on Windows XP with TWO ubuntu guests u10 and u8.

u8 has one single host-only network interface

u10 has 2 network interface, 1 host-only network interface and a NAT interface

on u8, I added a default gateway, so that all traffic will be route via u10
sudo route add default gateway u10.local

on u10
I enabled ip forwarding with
sudo sysctl -w net.ipv4.ip_forward=1

back to u8
ping 172.25.10.15 # this is a name server that I should have access to, ping it from u10 working just fine with NAT interface in place
no getting anything back

on u10
did a tcpdump on both interfaces and it revealed that
sudo tcpdump -i any
...
12:17:37.319938 IP u8.local > ftcnsmmk3.fmr.com: ICMP echo request, id 65046, seq 14, length 64
12:17:37.319938 IP u8.local > ftcnsmmk3.fmr.com: ICMP echo request, id 65046, seq 14, length 64
12:17:37.323940 ARP, Request who-has u8.local (Broadcast) tell 10.0.3.2, length 46
12:17:38.316436 IP u8.local > ftcnsmmk3.fmr.com: ICMP echo request, id 65046, seq 15, length 64
12:17:38.316436 IP u8.local > ftcnsmmk3.fmr.com: ICMP echo request, id 65046, seq 15, length 64
12:17:38.320438 ARP, Request who-has u8.local (Broadcast) tell 10.0.3.2, length 46

looks like the default gateway for the NAT interface 10.0.3.2 is unable to route the reply back to u8 due to repeated failed attempt to resolve the MAC addess of u8. (see the repeated ARP requests, there are a LOT more of those)
but running arp -a under command prompt shows that
arp -a
? (10.0.3.2) at <incomplete> on eth1
u8.local (192.168.56.101) at 08:00:27:f1:a3:8d [ether] on eth0

everything looks o.k.

THIS IS SOMETHING I'VE GOT IT WORKING WHILE I WAS ON THE PREVIOUS version of VBOX. Anything changed? How do I debug further?

Regards

Michael
mike1777
Posts: 3
Joined: 2. Jul 2010, 17:34
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu 10.4

Re: ip forwarding/routing in guest with NAT

Post by mike1777 »

O.K. So I was not delusional after all. The configuration I described in the original post did work under vbox 2.x. But not under 3.x. See this bug report for more details. http://www.virtualbox.org/ticket/5028

The trick to get it work again is sysctl -w net.ipv4.conf.all.proxy_arp=1

I'd appreciate anyone who could shed some lights on the following ,
1. is net.ipv4.conf.all.proxy_arp a new setting in Linux or it is just not being utilized in vbox before?

Regards

Michael
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: ip forwarding/routing in guest with NAT

Post by Perryg »

AFAIK I don't think this is a VBox issue. That command sets up for ARP requests between segments on your network. It's a *nix thing.
Of course I have not done this in years. I use real routers and not software routers these days.
Post Reply