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
26
ucloud/network/create-vxlan.sh
Executable file
26
ucloud/network/create-vxlan.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "$0 vxlanid dev"
|
||||
echo "f.i. $0 100 eno1"
|
||||
echo "Missing arguments" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
netid=$1; shift
|
||||
dev=$1; shift
|
||||
vxlan=vxlan${netid}
|
||||
|
||||
if ! ip link show $vxlan > /dev/null 2> /dev/null; then
|
||||
ip -6 link add $vxlan type vxlan \
|
||||
id $netid \
|
||||
dstport 4789 \
|
||||
group ff05::$netid \
|
||||
dev $dev \
|
||||
ttl 5
|
||||
|
||||
ip link set $dev up
|
||||
ip link set $vxlan up
|
||||
fi
|
||||
|
||||
echo $vxlan
|
||||
Loading…
Add table
Add a link
Reference in a new issue