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.

Here is my situation. I have a server with 2 NICs. I have installed virtual box and I have created a few Guest Operating Systems on it. I want these Virtual Machines to be using a bridge.NIC2 would be used to setup this bridge and NIC1 would be connected to corporate network.I am not clear with how should I go on doing this. /etc/network/interfaces is the file which I am trying to modify etc. My approach is following

1) Define a configuration file /etc/network/interfaces
2) Create IPTABLES as how NIC1 will forward the packets to Bridge on NIC2

Now comes the problem I do not understand what is the meaning of following lines in the configuration file

auto lo
iface lo inet loopback

# The primary network interface
auto eth2
iface eth2 inet manual

auto br0
iface br0 inet static
       address 192.168.1.14
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255
       gateway 192.168.1.10
       # dns-* options are implemented by the resolvconf package, if installed
       dns-nameservers 192.168.13.2
       dns-search myserver.net
       bridge_ports eth2
       bridge_fd 9
       bridge_hello 2
       bridge_maxage 12
       bridge_stp off

So any pointers to what should be the entries of /etc/network/interfaces file. So that I understand which parameter is to be used when and where that would help me.

share|improve this question
    
How can I increase acceptance rate? –  Bond Jan 10 '11 at 7:51
add comment

1 Answer 1

up vote 1 down vote accepted
bridge_ports eth2

That's the key line, you should add your interfaces, virtual and otherwise, that you want to be a member of the bridge.

bridge_ports eth0 eth2

The rest of that just describes the options for the bridge. For further reading, the manpage on brctl will give you descriptions of the options.

Additionally, to dynamically add and remove ports to the bridge once they're created, just use brctl to do it.

brctl addif br0 eth3
brctl delif br0 eth3

To get a list of ports already in the bridge

brctl br0 show
share|improve this answer
    
Oh I see I did not knew about bridge_ports option thanks for that I checked out the corresponding man pages here manpages.ubuntu.com/manpages/maverick/man5/… and man-wiki.net/index.php/5:ifcfg-bridge </br> How ever as my understanding is when we have a bridge then we need to give an IP to the bridge and I want to give an IP to NIC1,so what will be corresponding entry for that?So if I give an IP to the NIC1 and an IP to bridge would that be correct?What I understand bridge just works on frames nothing else. –  Bond Jan 10 '11 at 7:57
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.