Skip to content

Instantly share code, notes, and snippets.

@hgn
Last active January 4, 2016 01:49
Show Gist options
  • Save hgn/8550815 to your computer and use it in GitHub Desktop.
Save hgn/8550815 to your computer and use it in GitHub Desktop.
#!/bin/sh
# aptitude install bridge-utils
if1=eth0
if2=eth1
ifconfig $if1 down
ifconfig $if2 down
ifconfig $if1 0.0.0.0 up
ifconfig $if2 0.0.0.0 up
# create bridge
brctl addbr br0
brctl addif br0 $if1
brctl addif br0 $if2
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
brctl stp off
ifconfig br0 up
brctl show
# show learned mac addresses
brctl showmacs br0
# information:
# http://people.debian.org/~ultrotter/talks/dc10/networking.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment