Created
May 4, 2016 06:05
-
-
Save sspans/bb018a039f7b64151ba3e3b5dc3e5252 to your computer and use it in GitHub Desktop.
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
# Update routes when a ROUTE_MTU is configured | |
if [ -n "$ROUTE_MTU" ]; then | |
ip route show dev ${DEVICE} proto kernel | while read line; do | |
ip route change ${line} dev ${DEVICE} proto kernel mtu ${ROUTE_MTU} >/dev/null 2>&1 | |
done | |
ip route show dev ${DEVICE} proto static | while read line; do | |
ip route change ${line} dev ${DEVICE} proto static mtu ${ROUTE_MTU} >/dev/null 2>&1 | |
done | |
fi | |
# Enable policy routing when requested | |
if [ "$ROUTE_POLICY" = "yes" ]; then | |
ip route flush table 1 | |
ip route show dev ${DEVICE} | while read line; do | |
ip route add ${line} dev ${DEVICE} table 1 >/dev/null 2>&1 | |
done | |
ADDR=$(ip route show dev ${DEVICE} scope link) | |
ADDR=${ADDR##* src} | |
ip rule del pref 1 >/dev/null 2>&1 | |
ip rule add from ${ADDR} table 1 pref 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment