Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set up a Debian Lenny box with 3 vbox Lenny machines running eth0 of the host in bridged mode (on virtualbox 3.1.6). When testing in my local LAN, this all worked perfectly well and traffic flowed to and from the IPs of the virtual machines as it should. However, now that it's in its co-lo home, the networking setup is a bit different, and I'm unable to get traffic to flow to the vboxes properly.

Specifically, the host has its own Primary IP, and I have a separate subnet of 8 (6 usable) IPs routed to the box for use by the vboxes.

So, eth0 on host is:

Machine IP:      2x.x.x.137
Gateway IP:     2x.x.x.138
Subnet Msk:    255.255.255.252

Subnet for vboxes is

Subnet:         2x.x.x.240/29
Netmask:      255.255.255.248

vbox1 is configured to 2x.x.x.241 on eth0 as follows:

auto eth0
iface eth0 inet static
     address 2x.x.x.241
     netmask 255.255.255.248

Setting up a virtual interface (eth0:0) on the host with one of these subnet IPs allows me to ping to that address only from vbox1, and it allows me to ping vbox1 from the host. I can also ping that virtual interface perfectly well from outside, so the IPs are definitely landing at my machine.

It seems I'm missing some sort of routing instruction either on the host or vbox1 to get traffic moving between the subnet and the default gateway, but I can't seem to figure out what it should be, or what glaringly obvious thing i'm missing. Most of my obvious attempts (the gw of eth0, the ip of eth0) were rejected by route command with SIOCADDRT: No such device (eg - i can't find it).

I tried setting vbox1 to bridge on eth0:0, but this was not an acceptable device name and VBoxHeadless refused to start. The physical machine does have an unused physical NIC at eth1 that can be used if necessary for something or other.

Host machine is running iptables configured by ferm, have experimented with it allowing forwarding for that subnet, but I wouldn't have thought this was necessary given the nature of the virtualbox devices (nor did it actually work). Clearing out all of these rules for a blank iptables set does not resolve the issue. (you can see ferm generated iptables at http://codedumper.com/ojaze)

Thanks for any help you can give...

Patrick

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

The exact answer you're looking for depends on your circumstances.

At the moment it seems that your network is disconnected, because you haven't said what the gateway of the 2x.x.x.240/29 subnet is. Does your colo provider have a router in that range, or do you need to create a virtual/bridge interface on the host? Have you enabled IP forwarding in sysctl? Are you better off using VirtualBox's NAT option?

Sort that out, and someone else (or Google) can help you with the finer details.

share|improve this answer
    
thanks alphax, that pointed me in the right direction (with a little bit of a "that was obvious" forehead slap!) - creating a virtual interface (eth0:0) on the host with an IP on that subnet, and having it act as gateway IP for the clients, seems to shuttle the traffic correctly back out via the main interface. –  patrick May 7 '10 at 1:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.