You are not logged in.

#1 2011-07-10 13:51:14

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Multiple routes and cards with network daemon in non-deprecated way.

In the good old way I had lines like:

route1='8.31.65.4.3 dev eth0'
route2='default gw 8.31.65.4.3'
ROUTES=(route1 route2)

How can I say the same thing with the new way?
I am a little confused by the single gateway line...

Besides I have two different network cards. When I set $interface I can put only one... how it works?


Just for information, this is the code /etc/rc.d/network executes:

network_up() {
    /usr/sbin/ip link set dev $interface up || return 1

    if [[ $address ]]; then
        for var in netmask gateway; do
            if [[ -z ${!var} ]]; then
                printf "${C_FAIL}Error: static address defined without $var!\n"
                return 1
            fi
        done
        /usr/sbin/ip addr add $address/$netmask dev $interface || return 1
        /usr/sbin/ip route add default via $gateway || return 1
    else
        /sbin/dhcpcd $DHCPCD_ARGS $interface || return 1
    fi
}

Thanks.

Offline

Board footer

Powered by FluxBB