Efforts to make ucloud a python package
This commit is contained in:
parent
bbe09667a6
commit
1e7300b56e
71 changed files with 241 additions and 1043 deletions
24
ucloud/network/create-bridge.sh
Executable file
24
ucloud/network/create-bridge.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 3 ]; then
|
||||
echo "$0 brid dev ip"
|
||||
echo "f.g. $0 100 vxlan100 fd00:/64"
|
||||
echo "Missing arguments" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
brid=$1; shift
|
||||
dev=$1; shift
|
||||
ip=$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 $ip dev $bridge
|
||||
fi
|
||||
|
||||
echo $bridge
|
||||
Loading…
Add table
Add a link
Reference in a new issue