From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030922 Description of problem: /etc/sysconfig/network-scripts/ifup-routes is invoked to add static routes when interfaces are brought up. It handles 'old' (pre RHEL 3/RHL 9) and new format files defining the routes, however it no longer handles comments in old-style route definition files. This breaks systems that have been migrated from RHEL 2.1. Version-Release number of selected component (if applicable): 7.31.9.EL-1 How reproducible: Always Steps to Reproduce: 1. create an 'old-style' file e.g.: /etc/sysconfig/network-scripts/route-eth0 as: 129.16.30.196/32 dev eth0 2. Add a hashed-out comment 3. Try to bring up interface Actual Results: 'ip route add' in ifup-routes throws an error Expected Results: ifup-routes should work Additional info:
This is still present as of RHEL4 as well as initscripts-8.07-1 in Fedora Core Rawhide today. Bug #154353 deals with a superset of this issue and has a possible patch.
Created attachment 112994 [details] patch for this issue Please try the attached.
Fixed in 7.31.24.EL-1 for RHEL 3.
Fixed in 7.93.14.EL-1 for RHEL-4.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-606.html
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-607.html
Does this errata fix it only for old-style route-<if> files ? I am still not able to add comments on a new-style route-<if> on RHEL3AS U7. One of the advantages of text config-files on Unix, is that one can add comments in configuration files in order to work together much more efficiently. For each comment like: ### Route to NTP servers (ntpserver1 and ntpserver2) 1.2.3.0/24 via 4.3.2.1 I see an error like: Apr 12 14:29:33 server1 ifup: Error: an inet prefix is expected rather than "###". Apr 12 14:29:33 server1 ifup: RTNETLINK answers: No such device
Just to clarify: The excerpt you showed is from an old-style file. New ones look kind of like the ifcfg-<if> files, with entries like ADDRESSn=<network> NETMASKn=<network/prefix mask> GATEWAYn=<next-hop router/gateway IP address> But anyway, I can reproduce your problem as well on RHEL3 RHEL 4 (where I can't reproduce it) has # older format while read line; do if [[ ! "$line" =~ '^[[:space:]]*(\#.*)?$' ]]; then /sbin/ip route add $line fi done < "$file" and RHEL3 has # older format while read line; do if [ "$line" == "${line##[[:space:]]*\#}" ]; then /sbin/ip route add $line fi done < "$file" bash in rhel3 hasn't got the "=~" operator, so it's not that easy though. /August, also ran into this, the original bug report stems from an install RH did here.
I suspect that just changing it to: if [ "$line" == "${line##\#}" ]; then ... as in the original patch will fix it for you?
Works for me. /August.
*** This bug has been marked as a duplicate of 190395 ***