Created
May 2, 2013 14:27
-
-
Save oskar456/5502567 to your computer and use it in GitHub Desktop.
OpenSUSE Policy Based Routing for IPv6
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
BOOTPROTO='static' | |
IPADDR='2001:718:1:fff0:50:56ff:feef:4/64' | |
STARTMODE='onboot' | |
NAME='VMXNET3 Ethernet Controller MGMT' | |
PRE_UP_SCRIPT='local-disablera' | |
POST_UP_SCRIPT='local-postup-pbr6' | |
PRE_DOWN_SCRIPT='local-predown-pbr6' | |
LOCAL_PBR6_PRIO='40001' | |
LOCAL_PBR6_DEFAULTPRIO='60001' | |
LOCAL_PBR6_GW='2001:718:1:fff0::1' | |
LOCAL_PBR6_FROMADDR='2001:718:1:fff0:50:56ff:feef:4' |
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 | |
confdir="/proc/sys/net/ipv6/conf/$2" | |
if [ -n "$2" ] && [ -d $confdir ]; then | |
echo 0 > "${confdir}/accept_ra" | |
else | |
echo "Usage: $0 <whatever> <iface>" | |
fi |
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 | |
iface=$2 | |
if [ -z "$iface" ]; then | |
echo "Usage: $0 <configfilesuffix> <interface>" | |
exit | |
fi | |
. /etc/sysconfig/network/ifcfg-$1 | |
ip -6 route flush table $iface | |
ip -6 route add default via $LOCAL_PBR6_GW dev $iface table $iface | |
ip -6 rule add from $LOCAL_PBR6_FROMADDR prio $LOCAL_PBR6_PRIO table $iface | |
[ -n "$LOCAL_PBR6_DEFAULTPRIO" ] && ip -6 rule add prio LOCAL_PBR6_DEFAULTPRIO table $iface |
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 | |
iface=$2 | |
if [ -z "$iface" ]; then | |
echo "Usage: $0 <configfilesuffix> <interface>" | |
exit | |
fi | |
. /etc/sysconfig/network/ifcfg-$1 | |
ip -6 route flush table $iface | |
while ip -6 --oneline rule show | grep -q "lookup $iface"; do | |
ip -6 rule del lookup $iface | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment