forked from Ivasoft/openwrt
wireguard-tools: add tunlink option for hostroute
In a multi-wan setup, netifd may need guidance on which wan device to use to create the route to the remote peer. This commit adds a 'tunlink' option similar to other tunneling interfaces such as 6in4, 6rd, gre, etc. Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
This commit is contained in:
committed by
Hans Dedecker
parent
05b8e84362
commit
47b2ee2d9a
@@ -112,6 +112,7 @@ proto_wireguard_setup() {
|
||||
config_get fwmark "${config}" "fwmark"
|
||||
config_get ip6prefix "${config}" "ip6prefix"
|
||||
config_get nohostroute "${config}" "nohostroute"
|
||||
config_get tunlink "${config}" "tunlink"
|
||||
|
||||
ip link del dev "${config}" 2>/dev/null
|
||||
ip link add dev "${config}" type wireguard
|
||||
@@ -173,7 +174,7 @@ proto_wireguard_setup() {
|
||||
sed -E 's/\[?([0-9.:a-f]+)\]?:([0-9]+)/\1 \2/' | \
|
||||
while IFS=$'\t ' read -r key address port; do
|
||||
[ -n "${port}" ] || continue
|
||||
proto_add_host_dependency "${config}" "${address}"
|
||||
proto_add_host_dependency "${config}" "${address}" "${tunlink}"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user