Skip to content
Permalink
58106eef4d
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 53 lines (41 sloc) 819 Bytes
#!/bin/bash
modprobe kvm_amd 2>/dev/null
modprobe kvm_intel 2>/dev/null
chmod a+rw /dev/kvm
NETDEV=vlan.github0
BRIDGEDEV=br.github0
TAPDEV=tap.github0
USER=github
set -x
function start
{
# create tap device
ip tuntap add dev ${TAPDEV} mode tap user ${USER}
ip link set ${TAPDEV} up
# activate network device
ip link set ${NETDEV} up
# create bridge
brctl addbr ${BRIDGEDEV}
brctl addif ${BRIDGEDEV} ${NETDEV}
brctl addif ${BRIDGEDEV} ${TAPDEV}
ip link set ${BRIDGEDEV} up
}
function stop
{
ip link set ${BRIDGEDEV} down
brctl delbr ${BRIDGEDEV}
ip link set ${TAPDEV} down
ip tuntap del dev ${TAPDEV} mode tap
}
case "${1}" in
start)
start
;;
stop)
stop
;;
*)
echo "usage $0 {start|stop}" >&2
exit 1
;;
esac