具体配置如下【均为虚假地址,不要试图ping,或者...只是为了测试单网卡多ip的配置】:
[root@localhost network-scripts]# cat ifcfg-eth1:0
TYPE=Ethernet
DEVICE=eth1:0
ONBOOT=yes
NM_CONTROLLED=no
#BOOTPROTO=dhcp
BOOTPROTO=static
IPV6ADDR=2001:0db8:3c4d:0015::1a2f:1a2b
NETMASK=64
#GATEWAY=2001:0db8:3c4d::6
[root@localhost network-scripts]# cat ifcfg-eth1
TYPE=Ethernet
DEVICE=eth1
ONBOOT=yes
NM_CONTROLLED=no
#BOOTPROTO=dhcp
BOOTPROTO=static
IPV6ADDR=2001:4860:0:2001::2122
NETMASK=64
#GATEWAY=2001:4860:0:2001::6
service network restart ;tail -f messages 系统日志文件报错
/etc/sysconfig/network-scripts/ifup-aliases err error in ifcfg-eth0:1: already seen ipaddr in ifcfg-eth0:0
解决方法:
/etc/sysconfig/network-scripts/ifup-aliases
if [ -n "$ipseen" ]; then 替换为 if [ -n "$IPADDR" -a -n "$ipseen" ]; then
参考文档:https://opendev.org/starlingx/integ/commit/caac6ebf35cdd009b9e9eea9276dcf225fffa9ae