Suse 9: Network configuration

Network configuration on Suse has substantially evolved since version 8.0 and resembles the one found in various other Linux distributions.
As usual Yast2 can be used to fully configure network devices nad TCP/IP settings and since we presume you already know how to do it with a graphical interface, let's see, more deeply the involved files.

Configuration files
/etc/sysconfig/network/ifcfg-*
These are the systems's configuration files for every network interface where "*" can be the name of the inteface (eth0, eth1, lo, ppp0...), its MAC address (ex: 00c09f2dc8a4) or indicate what hardware is used (usb, pcmcia).
The main parameters used in these files are:
BOOTPROTO - Can be static (IP configured manually), dhcp (IP oubtained through DHCP)
IPADDR BROADCAST NETMASK NETWORK - Define typical IP parameters: IP address, broadcast, netmask and network address
MTU - Defines the Maximum Transfer Unit (the size of every IP packet). Default on ethernet devices is 1500.
STARTMODE - Indicates the to activate the interface: onboot (at system's boot), hotplug (when a pluggable network device is inserted), manual (manually).
Other parameters can be used and can vary according to the interface type.

/etc/sysconfig/network/config
Contains various, well commented, variables that are applied to every interface, they include also what actions can be done when the interface status is changed. The same values can be specified in the single /etc/sysconfig/network/ifcfg-* files, for a more granular control on the single interfaces.
/etc/sysconfig/network/dhcp, similarly, sets parameters related to dhcp use (logging, lease time, timouts, modification of system's settings, wait time at boot and so on).
/etc/sysconfig/network/wireless sets and describes the various parameters that can be applied to wireless devices (wieless mode, essid, frequency, sensibility, encryption key...). As usual they can be used in the ifcfg files of the single wireless devices, but it's useful to know the options than can be used.

/etc/sysconfig/network/routes
Defines all the (general) static routes. It's possible to specify routes exclusively related to the activation of single interfaces with the files /etc/sysconfig/network/ifroute-interface.
The format of this file is:
DESTINATION  GATEWAY  NETMASK|PREFIX INTERFACE [TYPE] [OPTIONS]


/etc/resolv.conf
Defines, as in most Unixes, the address of the DNS server to be used by the system.
Some services (pppd, ipppd, dhcpclient, hotplug, pcmcia, pptpclient) can temporarily modify this file in order to use, according to the new connection established, the appropriate DNS server. This is done by Suse's nice shell script /sbin/modify_resolvconf which has various options to handle and manage different dynamic entries in /etc/resolv.conf and /etc/named.conf.

/etc/hosts
As in most Unixes, in this file you can statically assign IP addresses to host names. You can also use /etc/networks for IP networks. The resolver by default first checks this file, before querying the DNS servers in /etc/resolv.conf. This order and other settings about how the system assigns names to resources can be changed (as in every Linux) in /etc/host.conf (old configuration file used by libc4 and libc5 linked programs) or /etc/nsswitch.conf (used by every recent program linked with glibc libraries).

/etc/HOSTNAME
Contains the hostname of the system, used by various startup scripts.

Commands
SuSE features typical Linux network related commands as ifconfig route netstat ip and other commands which can be found in various distros such as ifup (can be invoked also by the symlinks ifstatus or ifdown giving status info on the specified interface or shutting it down) .
Similarly to RedHat's service command, SuSE provides a set of scripts, or better symlinks, to manage to init scripts for the various services:
/sbin/rcnetwork restart restarts the network services as would do the command /etc/init.d/network restart.