New SuSE Network Configuration and Features

Support knowledgebase (mmj_network80)
Applies to

SuSE Linux: Versions since 8.0

Symptom:

You are having problems configuring your network and routing as you did in previous versions. /etc/rc.config does not even have the variables NETCONFIG, IPADDR, NETDEV, and IFCONFIG.

Cause:

For SuSE Linux 8.0, we redesigned the way the system is configured. It is now all done from the /etc/sysconfig directory. Network and routing is configured in the /etc/sysconfig/network directory. The former system had limitations and a new scheme was required.

Another important issue for network configuration is a switch to using the ip command instead of ifconfig and route. These commands will not go away or stop working. They only fall short if specific features only provided by ip are used.

Does the use of sysconfig remind you of how other distributions do things?
We had to develop a directory structure for configuration and decided to use a naming scheme that is already familiar to some Linux users. Nevertheless, we had to go our own way for implementing it. Some directory names are similar. Some parts still reflect the old /etc/rc.config.

Solution:

Read on for an introduction to how networking and routing is done with this scheme. /usr/share/doc/packages/sysconfig/README, ifup(8), and routes(5) are also good sources of information.

Network Device Configuraton

Here is an example of a configuration file for the network device eth0. That would be the file /etc/sysconfig/network/ifcfg-eth0.
STARTMODE="onboot"
BOOTPROTO="static"
BROADCAST="10.10.255.255"
IPADDR="10.10.11.184"
NETMASK="255.255.0.0"
For a DHCP client, it would be enough to have the following:
BOOTPROTO="dhcp"
STARTMODE="onboot"
For a token ring device, such as tr1, name the file /etc/sysconfig/network/ifcfg-tr1. For an explanation of the variables to use (there are extra variables for ISDN, modem, etc.), refer to the README file mentioned earlier.

Routing Configuration

/etc/sysconfig/network/routes is the main configuration file. An example of such a file:

# Destination     Dummy/Gateway     Netmask            Device
#
204.127.235.0     0.0.0.0           255.255.255.0      eth0
default           204.127.235.41    0.0.0.0            eth0
207.68.156.51     207.68.145.45     255.255.255.255    eth1
192.168.0.0       207.68.156.51     255.255.0.0        eth1

If you do not know the name to assign to a certain network interface (e.g. for PCMCIA or USB), make a file called /etc/sysconfig/network/ifroute-CONFIG, which then belongs to the corresponding /etc/sysconfig/network/ifcfg-CONFIG file. For example, to define the default route for a PCMCIA ISDN card for a laptop, create the file /etc/sysconfig/network/ifroute-ippp0. When an interface is set up, it first reads the routes from routes then from ifroute-CONFIG.

There is one small difference between these two files. If the Device field (4th field) is empty in routes, it stays empty. If setting up this route without an interface name makes no sense, an error message will occur. On the other hand, if an interface is set up and there is no interface given in ifroute-CONFIG, the interface name will be added. If an interface name is specified and differs from the current interface name, the one in ifroute-CONFIG will be ignored.

Additionally, you can use the ifroute-CONFIG files to specify distinct default routes for certain interfaces. Example: You use a NIC to connect from your laptop to your home net and have a default route for this in 'routes'. Now you plug in your pcmcia ISDN card. As soon as ippp0 is set up, it writes its own default route from ifroute-ippp0 to make autodial work. After you unplug it, the old default route gets restored.

Syntax of the Routing Configuration Files

The syntax of the routing files are the same:

<destination> <gateway> <netmask> <interface> [<rejecttype>] [<options>] 

If one of the first four entries is omitted, it has to be replaced by a dash '-'. If there is no field after a field with a '-', you can even omit this.

It is possible to use a prefix length after a destination instead of a netmask. An example where all lines do exactly the same:

10.2.0.0  192.168.0.15 255.255.0.0 -
10.2.0.0  192.168.0.15 255.255.0.0
10.2.0.0/16 192.168.0.15 - -
10.2.0.0/16 192.168.0.15
10.2/16 192.168.0.15
And with an interface name:
10.2.0.0  192.168.0.15 255.255.0.0 eth0
10.2.0.0/16 192.168.0.15 - eth0
10.2/16 192.168.0.15 - eth0
There are several reject types. Some of them are unreachable, prohibit, throw, blackhole. These types give the ability to make a routing configuration like this:
default 10.10.0.8 0.0.0.0 -
10.10.75.100 - - - blackhole
This will cause all packets to 10.10.75.100 to be silently dropped. Consult routes(8) for more information.

Miscellaneous Features and Options

With the new networking schemes, some additional features and options are available. The following is an attempt to explain some of these features. Look at /etc/sysconfig/network/config for the options there. The comments are verbose and explanatory, so these will not be covered here.
Keywords: NETWORK, ROUTING, SYSCONFIG, 8.0

Categories: Configuration

SDB-mmj_network80, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 05. Mär 2002
SuSE Linux AG - Last generated: 11. Jun 2002 by mmj (sdb_gen 1.40.0)