From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 Description of problem: There is apparently no way to configure routing rules without modifying the actual initscripts themselves. It would be useful if there was a per-interface set of rules (like the route-nnn files) but for routing rules. I suppose that there is some argument that it might be simpler/better to just have a single global file for the rules and save/restore it similarly to iptables rules as an alternative. I can live with either solution, but I suggest the first one purely on the selfish grounds that it happens to suit my needs better at this particular moment in time :-) The reason for the request is to make network configuration for multiple providers easier, but I'm sure that other users of advanced routing will find it useful too. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: N/A Enhancement request Additional info:
Got an example?
My example looks like this: [root@chywoon network-scripts]# /sbin/ip rule 0: from all lookup local 32765: from 194.39.143.232/29 lookup bogons 32766: from all lookup main 32767: from all lookup default [root@chywoon network-scripts]# /sbin/ip route show table main 10.44.1.0/24 dev eth0 proto kernel scope link src 10.44.1.10 169.254.0.0/16 dev eth0 scope link default proto kernel nexthop via 10.44.1.1 dev eth0 weight 1 nexthop via 10.44.1.3 dev eth0 weight 1 nexthop via 10.44.1.11 dev eth0 weight 1 [root@chywoon network-scripts]# /sbin/ip route show table bogons 194.39.143.232/29 dev eth0 scope link 10.44.1.0/24 dev eth0 scope link 127.0.0.0/8 dev lo scope link default via 10.44.1.3 dev eth0 [root@chywoon network-scripts]# /sbin/ip route show table diogel 10.44.1.0/24 dev eth0 scope link 127.0.0.0/8 dev lo scope link default via 10.44.1.11 dev eth0 its incomplete... when I get my IP allocation from diogel, it will have an extra rule, plus an extra route in the diogel table to match whats already there for bogons. The situation is a web server with several virtual hosts some of which are accessible through one gateway to a certain provider and some of which are accessible through a different gateway to a different provider. In each case the IPs depend upon the providers and I plan to pair them off such that there will be one IP per provider for each virtual host and use DNS load balancing between them. I also expect to be expanding this system in the future to have further providers attached to it, hence more rules. I may also want to use separate physical interfaces for them as well at some stage. Currently each provider connects through a separate gateway box onto a local lan to which the web server is attached. There is a further example in the Linux Advanced Routing HOWTO where the providers are on different interfaces (see the url: http://lartc.org/howto/lartc.rpdb.multiple-links.html) I can currently do everything with the standard config files except the adding of the rules.
Updating this to FC3 since its still outstanding, also attaching an example of what the proposed ifup-rules script could look like. The ifdown-rules script would be identical aside from swapping the add to del in the ip rule command line. The scripts could be hooked into ifup-post and ifdown-post at a suitable point (which is what I've done on my system).
Created attachment 110546 [details] Example ifup-rules file
Support for rule-$device added in CVS.
Built as 8.36-1.