Bug 90858 - ifup breaks with missing default route
ifup breaks with missing default route
Status: CLOSED DUPLICATE of bug 79448
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2003-05-14 15:11 EDT by Pete Zaitcev
Modified: 2014-03-16 22:36 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-21 13:53:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Pete Zaitcev 2003-05-14 15:11:17 EDT
Description of problem:

If the DHCP server did not supply a default route (a standalone network),
the following happens:

[root@niphredil /]# ifup eth0
Determining IP information for eth0... done.
/sbin/ifup: line 268: [: : integer expression expected
[root@niphredil /]#

Version-Release number of selected component (if applicable):

[zaitcev@niphredil zaitcev]$ rpm -qf /sbin/ifup
[zaitcev@niphredil zaitcev]$ rpm -q initscripts
[zaitcev@niphredil zaitcev]$

How reproducible:

100%, but you have to have some unusual DHCP server configuration.

Additional info:

On some NAT boxes this happens if the Internet connection breaks,
perhaps that'll help reproducing.

Typically users notice this when GNOME refuses to start up and
posts a dialog "Cannot resolve host foo, login anyway?".
Comment 1 Pete Zaitcev 2003-05-14 15:15:23 EDT
Just so you don't have to unearth an old ifup, here's the line:

    # DHCP likes to create duplicate routes.  Fix that up.
    NUMDEFROUTES=`ip -o route | \
                  grep "^default" | \
                  awk '{ nlines++ } END { print nlines }'`
    if [ -n "$NUMDEFROUTES" -a "$NUMDEFROUTES" -gt 1 ]; then     <<==== 268
        # remove the default route for the new device (old route wins)
        ip route del default dev ${DEVICE}
Comment 2 Aleksey Nogin 2003-06-11 18:34:54 EDT

*** This bug has been marked as a duplicate of 79448 ***
Comment 3 Red Hat Bugzilla 2006-02-21 13:53:01 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.