Created
June 10, 2014 15:24
-
-
Save GuoJing/0ff59e34025abde96097 to your computer and use it in GitHub Desktop.
br.sh
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/bash | |
set -e | |
device=$1 | |
vlanid=$2 | |
interface=vlan$vlanid | |
bridge="docker0" | |
modprobe 8021q | |
vconfig set_name_type VLAN_PLUS_VID_NO_PAD | |
vconfig add $device $vlanid | |
ifconfig $interface up | |
brctl addbr $bridge | |
brctl setfd $bridge 0 | |
brctl stp $bridge off | |
brctl addif $bridge $interface | |
ifconfig $bridge up | |
trap - EXIT | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment