ipv6-helper: update default ipv6 settings
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 1588cac37c)
This commit is contained in:
@@ -23,9 +23,9 @@ endef
|
||||
|
||||
define Package/ipv6helper/install
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/60-6in4 $(1)/etc/hotplug.d/iface/60-6in4
|
||||
$(INSTALL_BIN) ./files/60-6in4 $(1)/etc/hotplug.d/iface/
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/60-ipv6-hybrid $(1)/etc/uci-defaults/60-ipv6-hybrid
|
||||
$(INSTALL_BIN) ./files/60-ipv6-lifetime $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ipv6helper))
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null"
|
||||
uci -q get system.@imm_init[0].ipv6 > "/dev/null" && exit 0
|
||||
|
||||
uci -q batch <<-EOF
|
||||
set dhcp.lan.ra="hybrid"
|
||||
set dhcp.lan.ndp="hybrid"
|
||||
set dhcp.lan.dhcpv6="hybrid"
|
||||
set dhcp.lan.ra_management="1"
|
||||
commit dhcp
|
||||
|
||||
set system.@imm_init[0].ipv6="1"
|
||||
commit system
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
18
package/emortal/ipv6-helper/files/60-ipv6-lifetime
Executable file
18
package/emortal/ipv6-helper/files/60-ipv6-lifetime
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null"
|
||||
[ "$(uci -q get system.@imm_init[0].ipv6)" = "2" ] && exit 0
|
||||
|
||||
uci -q batch <<-EOF
|
||||
delete dhcp.lan.dhcpv6
|
||||
delete dhcp.lan.ra_flags
|
||||
add_list dhcp.lan.ra_flags="none"
|
||||
set dhcp.lan.max_preferred_lifetime="2700"
|
||||
set dhcp.lan.max_valid_lifetime="5400"
|
||||
commit dhcp
|
||||
|
||||
set system.@imm_init[0].ipv6="2"
|
||||
commit system
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user