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 four IP addresses on my Debian machine: 1 main (eth0) + 3 extra (eth0:0, eth0:1, eth0:2).

I want to assign the eth0:1 as bridged network to my VM. Who do I need to add in the /etc/network/interfaces?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Virtual interfaces are not real, and don't behave like real interfaces. (They're actually not recommended at all, and can be replaced with multiple addresses attached to a single interface.) They can't be used by iptables, and they can't be used in bridges[0].

If you want to bridge the VM onto the real network then just put eth0 into the bridge. The bridge doesn't need an IP because it's just doing layer 2 forwarding. If you want the VM to use one of the external IPs then put eth0 and the VM in the bridge, and attach the IP inside the actual VM and not on the host at all.

If you really want to use an external IP on the bridge (without putting eth0 in the bridge) you can attach it to the bridge instead of to a virtual interface and use Proxy ARP to announce it on the real network.

[0] Well, technically they can, but the real interface gets added.

share|improve this answer
    
Thanks für you answer. I just want to use one of the additional IPs to access my VM. I thought i need to bridge the virtual interface not the main eth0. I'm new in this stuff and i just have a simple HowTo for install VirtualBox, install OS in there, etc... From your answer i think i just need to bridge eth:0 (br) and set bridge_ports eth0:1 –  Chris Apr 28 '12 at 5:33
    
Added that to the answer. You want to put eth0 into the bridge, and configure the IP inside the VM, not on the host at all. –  mgorven Apr 28 '12 at 5:52

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.