uncloud/network/create-bridge.sh

23 lines
451 B
Bash
Executable File

#!/bin/sh
if [ $# -ne 2 ]; then
echo "$0 brid dev"
echo "f.g. $0 100 vxlan100"
echo "Missing arguments" >&2
exit 1
fi
brid=$1; shift
dev=$1; shift
bridge=br${brid}
sysctl net.ipv6.conf.all.forwarding=1 > /dev/null
if ! ip link show $bridge > /dev/null 2> /dev/null; then
ip link add name $bridge type bridge
ip link set $bridge up
ip link set $dev master $bridge
ip address add fd00:/64 dev $bridge
fi
echo $bridge