n2n: remove unsupported -s param (#8644)

This commit is contained in:
小甲哥 2022-01-08 11:10:12 +08:00 committed by GitHub
parent 8aba1a4072
commit 67da0a5372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,15 +24,15 @@ start_instance() {
config_get community "$cfg" 'community' config_get community "$cfg" 'community'
config_get key "$cfg" 'key' config_get key "$cfg" 'key'
config_get_bool route "$cfg" 'route' '0' config_get_bool route "$cfg" 'route' '0'
address="$ipaddr" address="$ipaddr/$prefix"
supernode_bak="" supernode_bak=""
[ "$second_supernode" -a "$second_port" ] && supernode_bak=" -l ${second_supernode}:${second_port}" [ "$second_supernode" -a "$second_port" ] && supernode_bak=" -l ${second_supernode}:${second_port}"
[ "$route" = "1" ] && args='-r' [ "$route" = "1" ] && args='-r'
[ "$mode" = 'dhcp' ] && address='0.0.0.0' [ "$mode" = 'dhcp' ] && address='0.0.0.0'
[ "-$mtu" != "-" ] && mtu="-M $mtu" [ "-$mtu" != "-" ] && mtu="-M $mtu"
eval "$(ipcalc.sh "$ipaddr/$prefix")" # eval "$(ipcalc.sh "$ipaddr/$prefix")"
netmask="$NETMASK" # netmask="$NETMASK"
/usr/bin/edge -u 0 -g 0 -d $tunname -a ${mode}:${address} -s $netmask -c $community $([ -n "$key" ] && echo -k $key) -l ${supernode}:${port}$supernode_bak $args $mtu /usr/bin/edge -u 0 -g 0 -d $tunname -a ${mode}:${address} -c $community $([ -n "$key" ] && echo -k $key) -l ${supernode}:${port}$supernode_bak $args $mtu
iptables -I FORWARD -i "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth' iptables -I FORWARD -i "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
iptables -I FORWARD -o "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth' iptables -I FORWARD -o "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
iptables -t nat -I POSTROUTING -o "$tunname" -j MASQUERADE -m comment --comment 'n2n edge net' iptables -t nat -I POSTROUTING -o "$tunname" -j MASQUERADE -m comment --comment 'n2n edge net'