2

I want to setup an IP address alias on a network card. I created a file /etc/sysconfig/network/ifcfg-ens160 and its contents are:

BOOTPROTO='static'
STARTMODE='onboot'
IPADDR='192.168.0.113'
NETMASK='255.255.255.0'
BROADCAST=''
ETHTOOL_OPTIONS=''
MTU=''
NAME=''
NETWORK=''
REMOTE_IPADDR=''
IPADDR_0='192.168.0.194'
NETMASK_0='255.255.255.0'
LABEL_0='0'

Restarted network using systemctl restart network.service. Still when I do ifconfig -a I do not get IP address from alias (IPADDR_0) only it shows IP address mentioned in IPADDR.

When I do individual interface restart:

ifdown ens160:0
ifdown: no matching interfaces

ifup ens160
wicked: No valid configuration files found at /etc/wicked/ifconfig
ifup: no matching interfaces

But I notice that pings to both IP address works. It just that it does not showup in the list when I give ifconfig -a.

I suspect that I have to create a config file in /etc/wicked/ifconfig to get this listed in ifconfig -a. Is there any way to detect if IP alias is set other than ifconfig -a.

1
  • I know that following ifconfig command - "ifconfig ens160:0 192.168.0.194" lists the ip alias in ifconfig command. But I am looking into persisting it. I have also configured the ip alias setting via Yast, it gives me identical config file but the results in ifconfig -a does not show the ip alias. Mar 13 '14 at 22:27
2

First, I know that there will be a new image release this week or next week, hoping that you can get the latest image to retest again.

Second, instead of restarting the network.service, you should perform the following command:

wicked ifreload ens160

or if this is the first run:

wicked ifup ens160

ifconfig is obsolete. Use iproute2 instead:

ip addr show
ip a s

both of those are equivalent

wicked: No valid configuration files found at /etc/wicked/ifconfig

This is irrelevant here. Wicked supports ifcfg type of configuration files and looks for them in /etc/sysconfig/network directory. The above means that there is no native wicked configuration source in /etc/wicked/ifconfig which is the default case at the moment - no error.

Third, regarding the rest:

ifdown ens160:0
ifdown: no matching interfaces

ens160:0 is also obsolete syntax. There is no more aliases usage. IP addresses are applied to the same interface (please see ip a s command output).

ifup ens160
wicked: No valid configuration files found at /etc/wicked/ifconfig
ifup: no matching interfaces

Please run the following to see the reason:

wicked --debug all ifup ens160
1
  • "ens160:0 is also obsolete syntax." <- It was remarkably difficult to hunt down this particular factoid. upvotes++ Aug 17 at 6:11
0

In SLES 12 wicked supports configs in ifcfg-* style but aliases need to be set in this manner (192.168.0.113 is the primary ip address and it should contains suffix too (_0 in this case)):

BOOTPROTO='static'
STARTMODE='onboot'
IPADDR_0='192.168.0.113'
NETMASK_0='255.255.255.0'
IPADDR_1='192.168.0.194'
NETMASK_1='255.255.255.0'

or

BOOTPROTO='static'
STARTMODE='onboot'
IPADDR_0='192.168.0.113/24'
IPADDR_1='192.168.0.194/24'

instead of creating ifcfg-*:<alias_suffix> configs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.