Last active
November 27, 2020 13:06
-
-
Save tjuyy/2a43a6ca75b0189cc73ba2f3118f8f13 to your computer and use it in GitHub Desktop.
Openwrt Hotplug script for NAT6 (auto add ipv6 route if wan6 up)
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
#!/bin/sh | |
#/etc/hotplug.d/iface/99-ipv6 | |
[ "$ACTION" = ifup ] || exit 0 | |
iface=wan6 | |
[ -z "$iface" -o "$INTERFACE" = "$iface" ] || exit 0 | |
ip -6 route add `ip -6 route show default|sed -e 's/from [^ ]* //'` | |
logger -t IPv6 "Add IPv6 default route." |
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
#!/bin/sh | |
#/etc/hotplug.d/iface/99-ipv6 | |
iface="wan6" | |
if [ "${ACTION}" = "ifup" ]; then | |
if [ "${INTERFACE}" = "${iface}" ]; then | |
ip -6 route add `ip -6 route show default|sed -e 's/from [^ ]* //'` | |
logger -t IPv6 "Add IPv6 default route." | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment