forked from eugenepaniot/initscripts-vxlan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathifup-vxlan
executable file
·44 lines (33 loc) · 891 Bytes
/
ifup-vxlan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
. /etc/init.d/functions
cd /etc/sysconfig/network-scripts
. ./network-functions
[ -f ../network ] && . ../network
CONFIG=${1}
need_config ${CONFIG}
source_config
if [ -z "$PHYS_DEV" ]
then
ip link add ${DEVICE} type vxlan \
id ${VNI} \
dstport ${DSTPORT:-4789} \
local ${LOCAL_ADDR} \
ttl ${ttl:-255} \
for VTEP in ${REMOTE_VTEPS}
do
bridge fdb append 00:00:00:00:00:00 dev ${DEVICE} dst ${VTEP}
done
else
/etc/sysconfig/network-scripts/ifup ${PHYS_DEV}
ip link add ${DEVICE} type vxlan \
id ${VNI} \
dstport ${DSTPORT:-4789} \
local ${LOCAL_ADDR} \
ttl ${ttl:-255} \
dev ${PHYS_DEV} ${OPTIONS}
for VTEP in ${REMOTE_VTEPS}
do
bridge fdb append 00:00:00:00:00:00 dev ${DEVICE} dst ${VTEP}
done
fi
/etc/sysconfig/network-scripts/ifup-eth ${DEVICE}