mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Various fix for IPv6, disable Shadowsocks for IPv6 with ss-redir
This commit is contained in:
parent
0ef3754412
commit
5b10fe3bd5
8 changed files with 58 additions and 15 deletions
|
@ -162,7 +162,7 @@ interface_multipath_settings() {
|
|||
ifconfig $iface txqueuelen 10000 > /dev/null 2>&1
|
||||
}
|
||||
fi
|
||||
if [ "$(sysctl -n net.ipv6.conf.all.disable_ipv6 | tr -d '\n')" != "1" ]; then
|
||||
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" != "1" ] && [ "$config" != "omr6in4" ]; then
|
||||
# IPv6 Updates:
|
||||
local ip6addr
|
||||
local ipaddr6
|
||||
|
@ -179,12 +179,12 @@ interface_multipath_settings() {
|
|||
ip6addr=$(ip -6 addr show dev $iface | grep -v 'scope link' | grep inet6 | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||
gateway6=$(ip -6 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
||||
[ -z "$gateway6" ] && gateway6=$(uci -q get "network.$config.ip6gw")
|
||||
[ -z "$gateway6" ] && gateway6=$(ubus call network.interface.$config status | jsonfilter -q -l 1 -e '@.inactive.route[@.target="::/0"].nexthop' | tr -d "\n")
|
||||
[ -z "$gateway6" ] && gateway6=$(ubus call network.interface.$config status | jsonfilter -q -l 1 -e '@.inactive.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
if [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ]; then
|
||||
gateway6=$(ubus call network.interface.$config status | jsonfilter -q -e '@.route[@.target="::/0"].nexthop' | tr -d "\n")
|
||||
gateway6=$(ubus call network.interface.$config status | jsonfilter -q -e '@.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
if [ -z "$gateway6" ] || [ "$( valid_subnet6 $gateway6 )" != "ok" ]; then
|
||||
gateway6=$(ubus call network.interface.${config}_6 status 2>/dev/null | jsonfilter -q -e '@.inactive.route[@.target="::/0"].nexthop' | tr -d "\n")
|
||||
gateway6=$(ubus call network.interface.${config}_6 status 2>/dev/null | jsonfilter -q -e '@.inactive.route[@.target="::"].nexthop' | tr -d "\n")
|
||||
fi
|
||||
netmask6=$(ip -6 addr show dev $iface | grep -v 'scope link' | grep inet6 | awk '{print $2}' | cut -d/ -f2 | tr -d "\n")
|
||||
network6=`ipcalc $ip6addr | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||
|
@ -207,7 +207,7 @@ interface_multipath_settings() {
|
|||
delete network.${config}_route6_default
|
||||
set network.${config}_route6_default=route6
|
||||
set network.${config}_route6_default.interface=${config}
|
||||
set network.${config}_route6_default.target='::/0'
|
||||
set network.${config}_route6_default.target='::'
|
||||
set network.${config}_route6_default.gateway=$gateway6
|
||||
set network.${config}_route6_default.table=6${id}
|
||||
commit network
|
||||
|
|
|
@ -332,8 +332,8 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(
|
|||
/etc/init.d/odhcpd enable > /dev/null 2>&1
|
||||
elif [ -z "$ip6addr" ] && [ "$(uci -q set dhcp.lan.ra_default)" = 1 ]; then
|
||||
_log "Disable IPv6 RA"
|
||||
uci -q del dhcp.lan.ra
|
||||
uci -q del dhcp.lan.dhcpv6
|
||||
uci -q delete dhcp.lan.ra
|
||||
uci -q delete dhcp.lan.dhcpv6
|
||||
/etc/init.d/odhcpd start > /dev/null 2>&1
|
||||
/etc/init.d/odhcpd enable > /dev/null 2>&1
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue