Skip to content

Instantly share code, notes, and snippets.

@jlongman
Created May 11, 2015 21:24
Show Gist options
  • Save jlongman/fd1e034f3dba96159f09 to your computer and use it in GitHub Desktop.
Save jlongman/fd1e034f3dba96159f09 to your computer and use it in GitHub Desktop.
FreeBSD bridge
#!/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