Slackware HowTo

Configure static networking on Slackware with rc.inet1

Static IP, gateway, and DNS on Slackware with the traditional network scripts.

If you work remotely via SSH, be careful: a wrong IP configuration can disconnect you from the server.

1. Main files

2. Identify the interface

ip a
ifconfig -a   # if available

Example: eth0 or enp3s0.

3. Static IP configuration in rc.inet1.conf

# /etc/rc.d/rc.inet1.conf (example)
IPADDR[0]="192.168.1.50"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
GATEWAY="192.168.1.1"

The index [0] is the first interface. Make sure it matches the correct NIC on your system.

4. DNS

cat > /etc/resolv.conf <<'EOF'
nameserver 1.1.1.1
nameserver 8.8.8.8
EOF

5. Restart networking

/etc/rc.d/rc.inet1 restart

6. Checks

ip a
ip r
ping -c 3 192.168.1.1
ping -c 3 1.1.1.1
ping -c 3 google.com
If IP and DNS pings work, the configuration is correct.

7. Common errors

Quick checklist

[ ] Interface identified
[ ] IPADDR/NETMASK/GATEWAY configured
[ ] DNS in /etc/resolv.conf
[ ] rc.inet1 restart executed
[ ] Ping gateway/IP/hostname OK

Back to the Linux HowTo section