运营商不下发ipv6前缀,通过openwrt热插拔特性,自动下发前缀

vim /etc/hotplug.d/iface/99-ipv6

#!/bin/sh
[ "$ACTION" = ifup ] || exit 0
[ "$INTERFACE" = wan_6 ] || exit 0
uci set network.globals.ula_prefix="$(ip -6 route show | grep default | sed -e 's/^.*from //g' | sed 's/ via.*$//g')"
uci commit network
/sbin/ifup lan

Q.E.D.


简单点,说话的方式简单点。