Created
May 11, 2015 21:24
-
-
Save jlongman/fd1e034f3dba96159f09 to your computer and use it in GitHub Desktop.
FreeBSD bridge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ifconfig bridge0 > /dev/null | |
if [ $? != 0 ] ; then | |
ifconfig bridge create | |
fi | |
if1=em0 | |
if2=em3 | |
ifconfig bridge0 addm $if1 addm $if2 up | |
ifconfig $if1 up | |
ifconfig $if2 up | |
ifconfig bridge0 up | |
sysctl net.link.bridge.ipfw=1 | |
ipfw delete 1000 | |
# be sure to use bridged and not "out via bridge0" - doesn't work (on FBSD8?) | |
ipfw add 1000 pipe 1 ip from any to any bridged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment