apt-get install bridge-utilsConfiguring the bridge:
ifconfig eth0 0.0.0.0 promisc upIn this example, I suppose you are using eth0 and eth1. In the ifconfig line, I assigned IP address 1.2.3.4 to the bridge so I can access it remotely. Use an IP address in your network.
ifconfig eth1 0.0.0.0 promisc up
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
ifconfig br0 1.2.3.4 netmask 255.255.255.0 up
route add default gw 1.2.3.4 dev br0
You may check that the bridge is working by using tcpdump:
# tcpdump -n -i eth0Plug your machine into the network, and everything should work. Your Linux box is now a big, expensive two-port switch.
...
(lots of funny stuff)
...
# tcpdump -n -i eth1
...
(lots of funny stuff)
...
Making the Bridge Permanent
Edit the file /etc/network/interfaces and add:
auto br0
iface br0 inet dhcp
bridge_ports eth1 eth2
bridge_stp on
No comments:
Post a Comment