Page 1 of 1

[Solved] Separate Host and Guest Adapter,Bridged Networking?

Posted: 16. Aug 2009, 17:55
by urilabob
Host: CentOS 5
Guest: Fedora 11
Version: 3.0.4

I'm trying to set up bridged networking, with the host and guest using separate adapters (I'm forced to do this because my university ties IP addresses to MAC addresses, and I need separate IP addresses for the two machines; but it also has security advantages). That is, I want traffic for the host to use the host's eth0, while traffic for the guest uses the interface the CentOS host calls eth1 (though the fedora guest installer insists on calling this eth0). It hardly ever works; one reboot in ten it may work magically, but the other nine fail.

Settings:
Host (in network configuration gui):
eth0 active,
eth1 inactive
(if I make eth1 active here, the host network communications crash reliably)

VBox settings:
Only adapter 2 enabled (I thought this would be eth1 in the guest). I set it as PCnet-FAST III (the physical device is Broadcom Gigabit PCIE), Bridged Adapter, cable connected, eth1 (adapters 1, 3 and 4 are set disabled)


Guest:
Network configuration gui:
Shows only one device, eth0 on eth0; statically set IP address is set to the university-allocated address, hardware shows as MAD PCnet32 LANCE with correct MAC address, activation is greyed out
Settings in "Network Connections" are also as expected (just as if the guest were directly connected to the network)
However eth0 shows up under the network icon as not activated. Attempts to activate it fail. If I disable/enable networking I get the message "The network connection has been disconnected".


Both host and client are 64-bit installations

Can anyone see a way to do what I want? Or is it actually possible?

I'm guessing I _do_ need to activate both adapters in the host. But I assume I also need to tell it that its outbound routing should only use eth0 (except for outgoing guest traffic) even though eth1 is active. I'm not too sure how to do this without sending the routing for the guest the same way (that is, I think I need to set the routing based on the source ip address, not the destination). Can anyone help?

Re: Separate Host and Guest Adapters, Bridged Networking?

Posted: 16. Aug 2009, 18:35
by baf
When you use bridged mode the guest will use its own macaddress so you should be able to do what you want with only one interface.
If you keep trying with two intefaces you will have to get host-eth1 to be up otherwise it wont work.

As a test in terminal(host):

Code: Select all

sudo ifconfig eth1 up 
And see if that helps.

Linux assigns id:s to network interfaces when they first see them so the first it finds will forever be eth0 second eth1 and so on.
Look in file /etc/udev/rules.d/70-persistent-net.rules and you will see how it works.

Re: Separate Host and Guest Adapters, Bridged Networking?

Posted: 17. Aug 2009, 17:19
by urilabob
Thank you. That worked! On why I'm splitting them: I didn't realise that I would be able to have two separate MAC addresses responding to the same NIC. But in any case, I prefer this setup, because now I can set my host firewall up so that it simply doesn't allow host traffic on the guest NIC, and vice versa. Of course, if the VBox security is perfect, this won't matter; but it's not hard to imagine security glitches that this would catch.