2021-01-07 20:56:49 +01:00
|
|
|
protocol=vxlan
|
|
|
|
|
|
|
|
vxlan_clear() {
|
|
|
|
while uci -q delete network.@vxlan_peer[0]; do :; done
|
2022-03-24 09:12:09 +01:00
|
|
|
uci set network.vxlan0.vid="0"
|
2022-03-24 17:44:24 +01:00
|
|
|
uci set network.vxlan0.disabled="1"
|
|
|
|
uci set network.vxbat.disabled="1"
|
2021-01-07 20:56:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
vxlan_addpeer() {
|
|
|
|
json_get_var address address
|
|
|
|
address=$(ping6 -w1 -c1 "$address" | awk '/from/ {print substr($4, 1, length($4)-1); exit}')
|
|
|
|
[ -z $address ] && return ## address not reachable
|
2022-03-24 09:26:08 +01:00
|
|
|
uci set network.vxlan0.vid="$id"
|
2022-03-24 17:44:24 +01:00
|
|
|
uci set network.vxlan0.disabled="0"
|
|
|
|
uci set network.vxbat.disabled="0"
|
2021-01-07 20:56:49 +01:00
|
|
|
uci add network vxlan_peer
|
|
|
|
uci set network.@vxlan_peer[-1].vxlan="vxlan0"
|
|
|
|
uci set network.@vxlan_peer[-1].dst="$address"
|
|
|
|
}
|
|
|
|
|
|
|
|
vxlan_start_stop() {
|
2022-03-24 17:44:24 +01:00
|
|
|
reload_config
|
2021-01-07 20:56:49 +01:00
|
|
|
}
|