From 46ce629fe0e48236ef926debee5f188f5f99c3f0 Mon Sep 17 00:00:00 2001 From: Matthew Hagan Date: Tue, 18 Jan 2022 12:24:54 +0000 Subject: ipip: add 'nohostroute' option Add the nohostroute option as available for gre and wg tunnels to allow the user to prevent explicit creation of a route to the peer address. Signed-off-by: Matthew Hagan --- package/network/config/ipip/files/ipip.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'package/network/config/ipip/files/ipip.sh') diff --git a/package/network/config/ipip/files/ipip.sh b/package/network/config/ipip/files/ipip.sh index 15b1c978e3..c433ee0de4 100755 --- a/package/network/config/ipip/files/ipip.sh +++ b/package/network/config/ipip/files/ipip.sh @@ -12,7 +12,7 @@ proto_ipip_setup() { local remoteip local df ipaddr peeraddr tunlink ttl tos zone mtu - json_get_vars df ipaddr peeraddr tunlink ttl tos zone mtu + json_get_vars df ipaddr peeraddr tunlink ttl tos zone mtu nohostroute [ -z "$peeraddr" ] && { proto_notify_error "$cfg" "MISSING_PEER_ADDRESS" @@ -32,7 +32,9 @@ proto_ipip_setup() { break done - ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" ) + if [ "${nohostroute}" != "1" ]; then + ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" ) + fi [ -z "$ipaddr" ] && { local wanif="$tunlink" @@ -84,6 +86,7 @@ proto_ipip_init_config() { proto_config_add_string "ipaddr" proto_config_add_string "peeraddr" proto_config_add_boolean "df" + proto_config_add_boolean "nohostroute" } [ -n "$INCLUDE_ONLY" ] || { -- cgit v1.2.3