Network bridge

Installation
Install :

Host Configuration
First, we need to add the bridge device to the file. As an example, bridge configuration with DHCP:

More documentation can be found in.

Next, create the init script and start the interface as follows:

Finally, to make sure the bridge is automatically set up on subsequent boots, run:

To grant the guest access to the internet, you will need to use iptables. If it's not installed, first emerge :

Allow ip forwarding in your or with the following command:

Add the iptables rules to grand masqueraded access to the internet. For example (substitute 'eth0' with your external facing physical interface):

This is equivalent to: EXTIF=eth0 # external facing physical interface IP=`ifconfig $EXTIF|grep 'inet addr'|cut -d ':' -f2|cut -d ' ' -f1` iptables -t nat -A POSTROUTING -o $EXTIF -j SNAT --to-source $IP

Save the configuration and ensure it is restored at boot: