On 10/7/20 7:00 AM, Marius Tomaschewski wrote:
Hi!
It does not work, because it's about the RH (network-scripts/ifcfg-*) files, not SUSE (network/ifcfg-*) files and they don't have much more than the "ifcfg-" file prefix in common - they grew up independently. :-)
You can use "yast2 lan" to add them and when you'd look into "man 5 ifcfg" documenting the SUSE ifcfg files, you'd find:
IPADDR[suffix] {IPv4|IPv6}[/PREFIXLEN] [...]
and related (e.g. REMOTE_IPADDR) variables using an optional "[suffix]" which also support both, IPv4 and IPv6 addresses.
And also "Multiple addresses" in "EXAMPLES" at the end of the man page.
That is you can just append a suffix to the variable name, for example: IPADDR_1="192.168.1.11/24" IPADDR_2="192.168.1.12/24" IPADDR_3="192.168.1.13/24" IPADDR_5="2001:db8::10/64"
It works with any suffix, also: IPADDR4="192.168.1.16/24" IPADDR6="2001:db8::16/64" or any other keyword, as long as it remains a /bin/sh variable name.
Variables with the same suffix belong together, e.g.:
IPADDR_foo="192.168.1.15/32" or REMOTE_IPADDR_foo="192.168.1.1"
that results in:
There aren't any "ifcfg-eth0:1" files for the Linux kernel **2.0** net aliases emulation, but a LABEL[suffix] variable, which defaults to the name of the interface without :label-suffix, e.g. LABEL_1="eth0:1" LABEL_2="eth0:lan"
which would result for an ifcfg-eth0 file in following ip command equivalents (wicked is sending them as msg via netlink to the kernel same as ip does, but is not using the ip utility):
ip addr add $IPADDR_1 dev eth0 label $LABEL_1 ip addr add $IPADDR_2 dev eth0 label $LABEL_2 ip addr add $IPADDR_3 dev eth0 ip addr add $IPADDR_5 dev eth0 ip addr add $IPADDR4 dev eth0 ip addr add $IPADDR6 dev eth0 ip addr add $IPADDR_foo peer §REMOTE_IPADDR_foo dev eth0
(the order may differ, this is just an example) that is in:
# ip addr add 192.168.1.11/24 dev eth0 label eth0:1 # ip addr add 192.168.1.12/24 dev eth0 label eth0:lan # ip addr add 192.168.1.13/24 dev eth0 # ip addr add 192.168.1.15/32 peer 192.168.1.1 dev eth0 # ip addr add 192.168.1.16/24 dev eth0 # ip addr add 2001:db8::16/64 dev eth0
calls and in following IPs applied to the eth0 interface:
# ip addr show dev eth0 [...] inet 192.168.1.11/24 scope global eth0:1 valid_lft forever preferred_lft forever inet 192.168.1.15 peer 192.168.1.1/32 scope global eth0 valid_lft forever preferred_lft forever inet 192.168.1.12/24 scope global secondary eth0:lan valid_lft forever preferred_lft forever inet 192.168.1.13/24 scope global secondary eth0 valid_lft forever preferred_lft forever inet 192.168.1.16/24 scope global secondary eth0 valid_lft forever preferred_lft forever inet6 2001:db8::10/64 scope global valid_lft forever preferred_lft forever inet6 2001:db8::16/64 scope global valid_lft forever preferred_lft forever [...]
Note: maximal length of interface with and without label 15.
Thus don't become confused, that the obsolete "ifconfig" utility will show the labels as separate interfaces and truncate the names (it is using older limit of AFAIR 9 characters), ... -> use "ip".
On 10/2/20 8:08 PM, Mark Hounschell wrote:
How do I assign a permanent second ip address to a single nic on Leap-15.2?
I used this as an example bit doesn't seem to work.
Best regards / Mit freundlichen Grüßen, Marius Tomaschewski <mt@suse.de>, <mt@suse.com> -- SUSE Software Solutions Germany GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany, HRB 36809, AG Nürnberg, GF: Felix Imendörffer
I found how to do it via Yast2. Network Card Setup - General - Additional Address. Just add them there and all works . Mark -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org