|
|
@ -17,7 +17,7 @@ proto_6in4_setup() { |
|
|
|
local mtu ttl ipaddr peeraddr ip6addr tunnelid username password |
|
|
|
local mtu ttl ipaddr peeraddr ip6addr tunnelid username password |
|
|
|
json_get_vars mtu ttl ipaddr peeraddr ip6addr tunnelid username password |
|
|
|
json_get_vars mtu ttl ipaddr peeraddr ip6addr tunnelid username password |
|
|
|
|
|
|
|
|
|
|
|
[ -z "$ip6addr" -o -z "$peeraddr" ] && { |
|
|
|
[ -z "$peeraddr" ] && { |
|
|
|
proto_notify_error "$cfg" "MISSING_ADDRESS" |
|
|
|
proto_notify_error "$cfg" "MISSING_ADDRESS" |
|
|
|
proto_block_restart "$cfg" |
|
|
|
proto_block_restart "$cfg" |
|
|
|
return |
|
|
|
return |
|
|
@ -33,14 +33,16 @@ proto_6in4_setup() { |
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
local local6="${ip6addr%%/*}" |
|
|
|
|
|
|
|
local mask6="${ip6addr##*/}" |
|
|
|
|
|
|
|
[[ "$local6" = "$mask6" ]] && mask6= |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proto_init_update "$link" 1 |
|
|
|
proto_init_update "$link" 1 |
|
|
|
proto_add_ipv6_address "$local6" "$mask6" |
|
|
|
|
|
|
|
proto_add_ipv6_route "::" 0 |
|
|
|
proto_add_ipv6_route "::" 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ -n "$ip6addr" ] && { |
|
|
|
|
|
|
|
local local6="${ip6addr%%/*}" |
|
|
|
|
|
|
|
local mask6="${ip6addr##*/}" |
|
|
|
|
|
|
|
[[ "$local6" = "$mask6" ]] && mask6= |
|
|
|
|
|
|
|
proto_add_ipv6_address "$local6" "$mask6" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
proto_add_tunnel |
|
|
|
proto_add_tunnel |
|
|
|
json_add_string mode sit |
|
|
|
json_add_string mode sit |
|
|
|
json_add_int mtu "${mtu:-1280}" |
|
|
|
json_add_int mtu "${mtu:-1280}" |
|
|
|