-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
124 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
applications/luci-app-systools/root/usr/share/systools/full_ipv6.run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/sh | ||
|
||
ipv6_disable_lan_server() { | ||
uci -q batch <<-EOF >/dev/null | ||
del dhcp.lan.ra | ||
del dhcp.lan.ra_slaac | ||
del dhcp.lan.ra_flags | ||
del dhcp.lan.dhcpv6 | ||
del dhcp.lan.ndp | ||
EOF | ||
} | ||
|
||
ipv6_dns_on() { | ||
uci -q delete 'dhcp.@dnsmasq[0].filter_aaaa' | ||
} | ||
|
||
ipv6_relay_mode() { | ||
uci -q batch <<-EOF >/dev/null | ||
del network.wan6.auto | ||
set dhcp.wan6=dhcp | ||
set dhcp.wan6.interface='wan6' | ||
set dhcp.wan6.ignore='1' | ||
set dhcp.wan6.master='1' | ||
set dhcp.wan6.ra='relay' | ||
set dhcp.wan6.dhcpv6='relay' | ||
set dhcp.wan6.ndp='relay' | ||
set dhcp.lan.ra='relay' | ||
del dhcp.lan.ra_slaac | ||
del dhcp.lan.ra_flags | ||
set dhcp.lan.dhcpv6='relay' | ||
set dhcp.lan.ndp='relay' | ||
EOF | ||
ipv6_dns_on | ||
} | ||
|
||
ipv6_pppoe_mode() { | ||
ipv6_disable_lan_server | ||
ipv6_dns_on | ||
} | ||
|
||
is_lan_gateway() { | ||
[ "$(uci -q get network.lan.defaultroute)" = "0" ] && return 1 | ||
[ "$(uci -q get network.lan.proto)" = "dhcp" ] && return 0 | ||
[ "$(uci -q get network.lan.proto)" = "static" ] || return 1 | ||
[ -n "$(uci -q get network.lan.gateway)" ] | ||
} | ||
|
||
is_wan_pppoe() { | ||
[ "$(uci -q get network.wan.proto)" = "pppoe" ] | ||
} | ||
|
||
if is_lan_gateway; then | ||
echo "Single-Port Router (LAN Gateway) mode" | ||
ipv6_pppoe_mode | ||
elif is_wan_pppoe; then | ||
echo "PPPoE mode" | ||
ipv6_pppoe_mode | ||
uci -q delete network.wan.ipv6 | ||
else | ||
echo "DHCP-Client mode" | ||
ipv6_relay_mode | ||
fi | ||
|
||
uci -q batch <<-EOF >/dev/null | ||
commit dhcp | ||
commit network | ||
EOF | ||
|
||
/etc/init.d/odhcpd reload | ||
/etc/init.d/dnsmasq reload | ||
/etc/init.d/network reload | ||
|
||
echo "Done" |
34 changes: 34 additions & 0 deletions
34
applications/luci-app-systools/root/usr/share/systools/half_ipv6.run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
ipv6_dns_on() { | ||
uci -q delete 'dhcp.@dnsmasq[0].filter_aaaa' | ||
} | ||
|
||
ipv6_half_mode() { | ||
uci -q batch <<-EOF >/dev/null | ||
del network.wan.ipv6 | ||
del network.wan6.auto | ||
del dhcp.wan6 | ||
set dhcp.lan.ra='relay' | ||
del dhcp.lan.ra_slaac | ||
del dhcp.lan.ra_flags | ||
set dhcp.lan.dhcpv6='relay' | ||
set dhcp.lan.ndp='relay' | ||
EOF | ||
ipv6_dns_on | ||
} | ||
|
||
ipv6_half_mode | ||
|
||
uci -q batch <<-EOF >/dev/null | ||
commit dhcp | ||
commit network | ||
EOF | ||
|
||
/etc/init.d/odhcpd reload | ||
/etc/init.d/dnsmasq reload | ||
/etc/init.d/network reload | ||
|
||
echo "Done" |