Description of problem: Unlike in the ipv4 case there is no file like rule-ethX for ipv6 and this makes it impossible to add ipv6 rules using the initscripts Here is a patch to implement this: [root@byo0 network-scripts]# diff ifup-ipv6-original ifup-ipv6 -u --- ifup-ipv6-original 2011-02-27 16:11:16.559838001 +0100 +++ ifup-ipv6 2011-02-27 15:59:04.589837343 +0100 @@ -167,6 +167,13 @@ done fi +# Setup additional static IPv6 rules +if [ -f "/etc/sysconfig/network-scripts/rule6-$DEVICE" ]; then + cat "/etc/sysconfig/network-scripts/rule6-$DEVICE" | sed 's/#.*//g' | grep -v '^[[:space:]]*$' | while read line; do + /sbin/ip -6 rule add $line + done +fi + # Setup of 6to4, if configured if [ "$IPV6TO4INIT" = "yes" ]; then valid6to4config="yes" Tobias Oed
ifup-post & ifup-routes still run. Does /sbin/ip not handle ipv6 rules without an explicit -6 attached?
nope ip needs the -6 to do ipv6 stuff. From my experience, it never tries to guess and assumes ipv4 unless the -6 is there. For one thing, there is no way to tell if ip rule add prio 5 fwmark 5/15 table mytable is ipv4 or ipv6. Further the -6 must be the first argument so one cannot cheat in rule-ethX by adding a -6 at the beginning of a line. I forgot the other half of my patch that removes the rules when an interface goes down. Not sure if this should be done in ifup-routes, but since that only does ipv4 rules and routes and ifup-ipv6 already handles ipv6 routes, I thought it would make sense to add the ipv6 rules there too. [root@byo0 network-scripts]# diff ifdown-ipv6-original ifdown-ipv6 -u --- ifdown-ipv6-original 2011-03-01 16:43:31.009064001 +0100 +++ ifdown-ipv6 2011-02-27 15:53:41.394831411 +0100 @@ -134,3 +134,13 @@ # Delete all current configured IPv6 addresses on this interface ipv6_cleanup_device $DEVICE + +# Delete static IPv6 rules +if [ -f "/etc/sysconfig/network-scripts/rule6-$DEVICE" ]; then + cat "/etc/sysconfig/network-scripts/rule6-$DEVICE" | sed 's/#.*//g' | grep -v '^[[:space:]]*$' | while read line; do + /sbin/ip -6 rule del $line + done +fi + Tobias
Created attachment 481718 [details] test patch In an effort to merge ipv4 and ipv6s somewhat, I came up with the following - does it work for you?
Hello, sorry about the delay. There are a few problems, I'm attaching a slightly improoved version. Cheers Tobias
Created attachment 483774 [details] improoved patch This is the improoved patch
Added in git as http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=fc73bbccaae3858ea3f895e746467a758e6b5593. Will be in rawhide/F-15.
I guess this already has been fixed. -- Fedora Bugzappers Member Team