Using Debian squeeze, I setup a bridge between two interfaces (eth1 and eth2) using the following instructions. Note that eth0 is the management interface.
Install bridge utils
sudo apt-get install bridge-utils
Edit /etc/network/interfaces
sudo nano /etc/network/interfaces
-
# This file describes the network interfaces available on your system
-
# and how to activate them. For more information, see interfaces(5).
-
-
# The loopback network interface
-
auto lo eth0 eth1 eth2 br0
-
iface lo inet loopback
-
-
# The primary network interface
-
iface eth0 inet static
-
address 10.1.0.73
-
broadcast 10.1.0.255
-
netmask 255.255.255.0
-
gateway 10.1.0.254
-
-
iface eth1 inet static
-
address 0.0.0.0
-
broadcast 0.0.0.0
-
netmask 255.255.255.0
-
-
-
iface eth2 inet static
-
address 0.0.0.0
-
broadcast 0.0.0.0
-
netmask 255.255.255.0
-
-
# Bridge setup
-
iface br0 inet static
-
bridge_ports eth1 eth2
-
address 169.254.2.2
-
broadcast 169.254.2.255
-
netmask 255.255.255.0
-
gateway 169.254.2.1
-
-
# Bridge OPTIONS
-
bridge_ports eth1 eth2
-
bridge_stp off
-
bridge_waitport 0
-
bridge_fd 0
Now you need to edit /etc/sysctl.conf and uncomment these dirrectives
sudo nano /etc/sysctl.conf
-
net.ipv4.tcp_syncookies=1
-
-
# Uncomment the next line to enable packet forwarding for IPv4
-
net.ipv4.ip_forward=1
-
-
# Uncomment the next line to enable packet forwarding for IPv6
-
# Enabling this option disables Stateless Address Autoconfiguration
-
# based on Router Advertisements for this host
-
net.ipv6.conf.all.forwarding=1
Next, edit rc.local and add the following:
sudo nano /etc/rc.local
-
/etc/init.d/procps restart
-
ifup eth0
-
ifup br0
-
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
Reboot your box and you should be good to go :)
Add new comment