set static dual-stack ip
This commit is contained in:
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ LUCI_TITLE:=LuCI for Tailscale
|
||||
LUCI_DEPENDS:=+tailscale
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_VERSION:=1.2.6
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ return view.extend({
|
||||
|
||||
const addr_info = iface.addr_info || [];
|
||||
addr_info.forEach(addr => {
|
||||
if (addr.family === 'inet') {
|
||||
if (addr.family === 'inet' && !parsedInfo.ipv4) {
|
||||
parsedInfo.ipv4 = addr.local;
|
||||
} else if (addr.family === 'inet6') {
|
||||
} else if (addr.family === 'inet6' && !parsedInfo.ipv6) {
|
||||
parsedInfo.ipv6 = addr.local;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -57,10 +57,10 @@ if [ -z "$(uci -q get network.tailscale)" ]; then
|
||||
uci add_list network.ts_lan.ports=$port || revert_exit "Failed to add port $port."
|
||||
done
|
||||
else
|
||||
ts_ip=$(tailscale ip -4)
|
||||
[ -n "$(uci batch <<-EOF 2>&1
|
||||
set network.tailscale.proto='static'
|
||||
set network.tailscale.ipaddr=$ts_ip
|
||||
set network.tailscale.ipaddr=$(tailscale ip -4)
|
||||
add_list network.tailscale.ip6addr=$(tailscale ip -6)
|
||||
set network.tailscale.netmask='255.0.0.0'
|
||||
set network.tailscale.device=$ts0
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user