Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 298550 - sys-apps/openrc-0.6 doesn't add default route
Summary: sys-apps/openrc-0.6 doesn't add default route
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-27 16:48 UTC by Darren Smith
Modified: 2009-12-29 01:02 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darren Smith 2009-12-27 16:48:46 UTC
openrc-0.5.1 had this section in /etc/init.d/network:
    if [ -n "$defaultroute" ]; then
        ebegin "Setting default route $defaultroute"
        if [ "$RC_UNAME" = Linux ]; then
            route add default gw $defaultroute
        else
            route add default $defaultroute
        fi
        eend $?
    fi

now it just has this:
    if [ -n "$defaultroute" ]; then
        ebegin "Setting default route $defaultroute"
        route add default $defaultroute
        eend $?
    elif [ -n "$defaultiproute" ]; then
        ebegin "Setting default route $defaultiproute"
        ip route add default $defaultiproute
        eend $?
    fi

Note the missing check for Linux which adds the "gw" to the route add line.

As a side note, why was the 0.5.x openrc series removed from the tree so quickly? Now there's nothing to use as a fallback.

Reproducible: Always
Comment 1 Roy Marples 2009-12-28 16:00:08 UTC
(In reply to comment #0)
> Note the missing check for Linux which adds the "gw" to the route add line.

This was done so that you can route via an interface instead of an address (needed for VMs).
Comment 2 William Hubbs gentoo-dev 2009-12-29 01:02:03 UTC
(In reply to comment #0)
> openrc-0.5.1 had this section in /etc/init.d/network:
>     if [ -n "$defaultroute" ]; then
>         ebegin "Setting default route $defaultroute"
>         if [ "$RC_UNAME" = Linux ]; then
>             route add default gw $defaultroute
>         else
>             route add default $defaultroute
>         fi
>         eend $?
>     fi
> now it just has this:
>     if [ -n "$defaultroute" ]; then
>         ebegin "Setting default route $defaultroute"
>         route add default $defaultroute
>         eend $?
>     elif [ -n "$defaultiproute" ]; then
>         ebegin "Setting default route $defaultiproute"
>         ip route add default $defaultiproute
>         eend $?
>     fi
> Note the missing check for Linux which adds the "gw" to the route add line.

That is correct.  The updated /etc/conf.d/network  shows that the default route variables now include "gw" as the first word in the setting, for example:

defaultroute="gw 192.168.0.1"

And, for defaultiproute, "via" needs to be included:

defaultiproute="via 192.168.0.1"

This should fix your issue.

Thanks,

William