Posted by: isaraffee | September 15, 2009

Network Configuration in Slackware 12.0

Network Configuration in Slackware 12.0

I have configured my network settings to use DHCP. So when it booted it was assigned an IP address.

root@galaxy:~# ifconfig eth0

eth0 Link encap:Ethernet HWaddr 00:E0:4D:69:5B:94

inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0

inet6 addr: fe80::2e0:4dff:fe69:5b94/64 Scope:Link

UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

RX packets:11 errors:0 dropped:0 overruns:0 frame:0

TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:2387 (2.3 KiB) TX bytes:1962 (1.9 KiB)

Interrupt:18 Base address:0x6000

Other commands you can use to check the gateway IP address:

root@galaxy:~# ip route show

192.168.1.0/24 dev eth0 scope link

127.0.0.0/8 dev lo scope link

default via 192.168.1.1 dev eth0

Also it’s a good practice to check the DNS server:

root@galaxy:~# more /etc/resolv.conf

# Generated by dhcpcd for interface eth0

nameserver 192.168.1.1

Static IP

To view static IP address, type:

root@galaxy:~# less /etc/rc.d/rc.inet1.conf

It’s a very long list. If we want to see what parameters and values are set, type:

root@galaxy:~# less /etc/rc.d/rc.inet1.conf | grep -v “^#”

IPADDR[0]=””

NETMASK[0]=””

USE_DHCP[0]=”yes”

DHCP_HOSTNAME[0]=””

IPADDR[1]=””

NETMASK[1]=””

USE_DHCP[1]=””

DHCP_HOSTNAME[1]=””

IPADDR[2]=””

NETMASK[2]=””

USE_DHCP[2]=””

DHCP_HOSTNAME[2]=””

IPADDR[3]=””

NETMASK[3]=””

USE_DHCP[3]=””

DHCP_HOSTNAME[3]=””

GATEWAY=””

DEBUG_ETH_UP=”no”

Configure Network Using GUI

To configure network using GUI, type:

root@galaxy:~# netconfig

It’s quite simple. Just follow the wizard and when you reached the last menu, save and quit.

But when I checked the /etc/resolv.conf file, it still reflect the previous gateway IP address. ifconfig command also shows that eth0 retained the old IP address.

So I decided to reboot the system. And after that, the network settings are set correctly:

root@galaxy2:~# ifconfig eth0

eth0 Link encap:Ethernet HWaddr 00:E0:4D:69:5B:94

inet addr:172.16.0.2 Bcast:172.16.255.255 Mask:255.255.0.0

inet6 addr: fe80::2e0:4dff:fe69:5b94/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:0 (0.0 b) TX bytes:492 (492.0 b)

Interrupt:17 Base address:0x8000

root@galaxy2:~# more /etc/resolv.conf

search universe.org

root@galaxy2:~# ip route show

172.16.0.0/16 dev eth0 proto kernel scope link src 172.16.0.2

127.0.0.0/8 dev lo scope link

default via 172.16.0.1 dev eth0 metric

In case you edit the /etc/rc.d/rc.inet1.conf file, to restart the network services, type:

root@galaxy:~# /etc/rc.d/rc.inet1 restart

The network scripts are listed below:

/etc/rc.d/rc.inet1

/etc/rc.d/rc.inet2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: