WavebreakmediaMicro - Fotolia

Tip

Linux network configuration turns positively wicked

Wicked replaces a lot of old Linux network configuration commands and utilities in SLES 12, making the OS more cloud friendly.

As Linux distributions rapidly become more cloud compatible, network configurations gain complexity and flexibility. SUSE introduced the wicked network management tool to handle cloud and cloud-ready networking.

With the introduction of SUSE Linux Enterprise Server (SLES) 12, wicked changes the way the network is addressed. Wicked is a central service that manages all scripts that store Linux network configuration. The wicked command also requests current status information about network interfaces.

Administrators won't see major changes, as you can still use front-end tools such as the ip command, or the YaST management interface. Now, you can also use the wicked command line utility.

The wicked service manages:

  • The ifcfg scripts in the directory /etc/sysconfig/network. These scripts contain Linux network configuration information for each individual interface. Listing 1 shows the contents of a typical script.
  • The /etc/sysconfig/network/config script, which provides generic settings that are not specific to particular network cards.
  • The /etc/sysconfig/network/routes script, in which all routes are stored.

Listing 1: This is typical Linux network configuration in an ifcfg script.

BOOTPROTO='static'

BROADCAST=''

ETHTOOL_OPTIONS=''

IPADDR='192.168.4.12/24'

MTU=''

NAME='82545EM Gigabit Ethernet Controller (Copper)'

NETWORK=''

REMOTE_IPADDR=''

STARTMODE='auto'

Let's get wicked

Use this procedure to manipulate Linux network configuration and explore wicked. It illustrates the generic interface for administrators. Start with wicked show all to get an overview of current interface configuration (see listing 2).

Listing 2: This is typical interface information displayed via wicked show all.

linux-kscc:/etc/sysconfig/network # wicked show all

lo              up

      link:     #1, state up

      type:     loopback

      cstate:   network-up

      config:   compat:/etc/sysconfig/network/ifcfg-lo

      leases:   ipv4 static granted

      addr:     ipv4 127.0.0.1/8

      addr:     ipv6 ::1/128

ens33           up

      link:     #2, state up, mtu 1500

      type:     ethernet, hwaddr 00:0c:29:3e:d8:59

      cstate:   network-up

      config:   compat:/etc/sysconfig/network/ifcfg-ens33

      leases:   ipv4 static granted

      addr:     ipv4 192.168.4.12/24

Then, open the file /etc/sysconfig/network/ifcfg-YOURINTERFACE with an editor and add the line IPADDR2='192.168.4.13/24' or anything similar that meets your current network configuration. Type wicked ifreload ens33 to activate the network card configuration. To see the IP address associated with this host, type wicked check resolv at www.sandervanvugt.com. Then use wicked check route 8.8.8.8 to see if the server with IP address 8.8.8.8 is reachable. If you modify network configuration files, you must restart or reload wicked.

Wicked offers an alternative to many old Linux network configuration and parameter modification utilities. You can stop using ifdown and ifup, among other tools that interact with the old style of network configuration files. Wicked also completely replaces Network Manager, which was used in older SLES and other Linux distributions. It consisted of a service and a front-end utility to manage network configuration and cards.

About the author:

Sander van Vugt is an independent trainer and consultant based in the Netherlands. He is an expert in Linux high availability, virtualization and performance. He has authored many books on Linux topics, including Beginning the Linux Command Line, Beginning Ubuntu LTS Server Administration and Pro Ubuntu Server Administration.

Next Steps

Learn more about SLES 12, such as Btrfs-based snapshots and new Linux boot options Grub2 and systemd.

Study the various Linux OS options available for data centers and cloud.

Dig Deeper on Data center ops, monitoring and management