Put 30-netassist
into /etc/hotplug.d/iface
wget -qO /etc/hotplug.d/iface/30-netassist https://gist.githubusercontent.com/korzhyk/4e734924483de96e370415625bde4fed/raw/30-netassist
#!/bin/sh | |
update_tunnel_broker() { | |
local wan_ip | |
local username | |
local password | |
local proto | |
local tunnelid | |
config_get proto $1 proto | |
config_get tunnelid $1 tunnelid | |
# Check for corrent protocol and there are not HE.net tunnel | |
if [ "$proto" != "6in4" ] || [ "$tunnelid" != "" ]; then | |
return | |
fi | |
network_get_ipaddr wan_ip "$WAN_IFACE" | |
if [ -z "$wan_ip" ]; then | |
logger -p err -t 6in4 "'$WAN_IFACE' has no assigned IP address" | |
exit 0 | |
fi | |
config_get username $1 username | |
config_get password $1 password | |
wget -qO- "https://tb.netassist.ua/autochangeip.php?l=$username&p=$password&ip=$wan_ip" | while read res; do logger -t 6in4 "broker response: $res"; done | |
exit 0 | |
} | |
. /lib/functions/network.sh | |
network_find_wan WAN_IFACE | |
[ "$ACTION" = ifup ] && [ "$INTERFACE" = "$WAN_IFACE" ] && { | |
. /lib/functions.sh | |
config_load network | |
config_foreach update_tunnel_broker interface | |
} |
uci batch <<EOF | |
set network.wan6.proto='6in4' | |
set network.wan6.peeraddr='62.205.132.12' # Broker server ipv4 | |
set network.wan6.ip6addr='::2/64' # Client ipv6 addr | |
set network.wan6.ip6prefix='::/48' # Your routred ipv6 net | |
set network.wan6.username='EMAIL' # Username (email) | |
set network.wan6.password='PASSWORD' # Password | |
EOF | |
uci commit network |
@Yur0K в логах помилок не помічено? Я вже не памятаю, але можливо ще потрібно перезагрузити роутер оскільки там ще має підключатись модуль ядра для роботи цього інтерфейсу.