SuSE Linux: Versions since 8.0
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.
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.
/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.
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.15And 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 - eth0There 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 - - - blackholeThis will cause all packets to 10.10.75.100 to be silently dropped. Consult routes(8) for more information.
# rcnetwork restart -o type=tr,eth
grep -r XNTPD_INITIAL_NTPDATE /etc/sysconfig /etc/sysconfig/xntp:XNTPD_INITIAL_NTPDATE=""Then you know that you have to edit /etc/sysconfig/xntp with your favorite editor, run SuSEconfig, and it is done.