Slackware Network Setup

short hostname is fine, although the installer did not let you

grep HOSTNAME /etc/rc.d/rc.M
vi /etc/HOSTNAME

static name resolution

cp -pi /etc/hosts hosts.dist
vi /etc/hosts

127.0.0.1 localhost
x.x.x.x slack.localdomain slack
x.x.x.x gw

identify your network interfaces as usual with either mii-tool or ethtool, then

mv -i /etc/rc.d/rc.inet1 /etc/rc.d/rc.inet1.dist
chmod -x /etc/rc.d/rc.inet1.dist
vi /etc/rc.d/rc.inet1

#!/bin/bash

echo rc.inet1 PATH is $PATH

if [[ $1 != stop && $1 != down ]]; then
    echo -n lo...
    ifconfig lo up && echo done

    #echo -n eth1.2001...
    #modprobe 8021q
    #vconfig add eth1 2001
    #ifconfig eth1 mtu 9000 txqueuelen 10000 up
    #ifconfig eth1.2001 mtu 9000 txqueuelen 10000 x.x.x.x/xx up && echo done

    #dhclient -v eth0
    echo -n eth0...
    ifconfig eth0 x.x.x.x/xx up && echo done

    echo -n default route...
    route add default gw x.x.x.x && echo done
else
    #dhclient -r
    route delete default
    ifconfig eth0 down
    ifconfig lo down
fi

chmod +x /etc/rc.d/rc.inet1

now if you want XEN and/or links aggregation - you can mix this with bridges and bonding

apply and check,

/etc/rc.d/rc.inet1
ping -W1 -c1 208.67.222.222

DNS

cat /etc/resolv.conf
cat > /etc/resolv.conf <<-EOF
nameserver 208.67.222.222
nameserver 208.67.220.220
EOF
ping -W1 -c1 opendns.com

Trash

a better way to shut the NICs down would be

downall() {
        for netif in `ifconfig | egrep '^[[:alpha:]]+: ' | cut -f1 -d:`; do
                [[ $netif = lo ]] && continue
                ifconfig $netif down
        done; unset netif
        exit 0
}

[[ $1 = stop ]] && downall

Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml