diff -urN rc-scripts.orig/rc-scripts.spec.in rc-scripts/rc-scripts.spec.in --- rc-scripts.orig/rc-scripts.spec.in Sun Mar 3 20:59:12 2002 +++ rc-scripts/rc-scripts.spec.in Mon Mar 4 06:31:30 2002 @@ -208,7 +208,7 @@ %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/network %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/static-routes %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/static-nat -%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/timezone +%config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/sysconfig/ip-rules %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/adjtime %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/inittab %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/initlog.conf diff -urN rc-scripts.orig/rc.d/init.d/functions.network rc-scripts/rc.d/init.d/functions.network --- rc-scripts.orig/rc.d/init.d/functions.network Sun Mar 3 20:59:12 2002 +++ rc-scripts/rc.d/init.d/functions.network Sun Mar 3 21:43:40 2002 @@ -504,6 +504,22 @@ REALDEVICE=$DEVICE fi } +# following function setups advanced routing rules +# Olgierd Pieczul +setup_ip_rules () { +typeset args +if [ -f /etc/sysconfig/ip-rules ] ; then + if [ "$1" = "on" -o "$1" = "yes" ] ; then + egrep "^(from|to|iif|tos|fwmark|dev|pref)[[:blank:]]" /etc/sysconfig/ip-rules | while read args; do + /sbin/ip rule add $args + done + else + egrep "^(from|to|iif|tos|fwmark|dev|pref)[[:blank:]]" /etc/sysconfig/ip-rules | while read args; do + /sbin/ip rule del $args + done + fi +fi +} # This must be last line ! # vi:syntax=sh:tw=78:ts=8:sw=4 diff -urN rc-scripts.orig/rc.d/init.d/network rc-scripts/rc.d/init.d/network --- rc-scripts.orig/rc.d/init.d/network Sun Mar 3 20:59:12 2002 +++ rc-scripts/rc.d/init.d/network Sun Mar 3 21:56:34 2002 @@ -67,6 +67,7 @@ setup_forwarding on setup_nat on setup_routes on +setup_ip_rules on # Setup IPX if is_yes "$IPX"; then if [ -n $IPXAUTOPRIMARY ] ; then @@ -107,6 +108,7 @@ { setup_forwarding off setup_routes off +setup_ip_rules off # Set down NAT rules setup_nat off diff -urN rc-scripts.orig/sysconfig/Makefile.am rc-scripts/sysconfig/Makefile.am --- rc-scripts.orig/sysconfig/Makefile.am Sun Mar 3 20:59:12 2002 +++ rc-scripts/sysconfig/Makefile.am Mon Mar 4 06:29:52 2002 @@ -11,6 +11,7 @@ static-routes \ static-nat \ i18n \ - timezone + timezone \ + ip-rules EXTRA_DIST = $(sysconfig_DATA) diff -urN rc-scripts.orig/sysconfig/ip-rules rc-scripts/sysconfig/ip-rules --- rc-scripts.orig/sysconfig/ip-rules Thu Jan 1 01:00:00 1970 +++ rc-scripts/sysconfig/ip-rules Sun Mar 3 22:14:46 2002 @@ -0,0 +1,15 @@ +# ip rules +# +# rules: to, from, iif, tos, fwmark, dev, pref +# rule arguments: prefix, firewall mark, TOS number, device, preference value +# destinations: table, nat, special route (prohibit | reject | unreachable), +# realms +# destination arguments: table IP/name, address, realms +# +# Enrty format: + + +# examples: +#from 10.0.1/24 table 100 +# you can specify multiple rules and/or destinations: +#from 10.0.1/24 to 10.2/16 fwmark 3 table 4 nat 10.3.0.1