单个网卡上出现多个 IP 地址的奇怪问题 - OEL linux

单个网卡上出现多个 IP 地址的奇怪问题 - OEL linux

然而我得到了两个IP地址。但是当我使用ifconfig命令时,我无法在 ifconfig 命令中看到辅助 IP 地址(10.10.20.51)。当我使用ip addr命令时,我可以在 ifconfig 命令中看到主 IP 地址 (10.10.20.50) 和辅助 IP 地址 (10.10.20.51)。

我的环境:

  • 运行 VMWare ESX 主机上的 OEL 8.3。

以太网配置:

NM_CONTROLLED="yes"
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=none
DEFROUTE=yes
IPv4_FAILURE_FATAL=no
IPV6INIT=no
NAME=ens245
UUID=cb98ce56-5d69-421f-9317-9c26085ea695
DEVICE=ens245
ONBOOT=yes
IPADDR=10.10.20.50
PREFIX=24
DNS1=10.10.20.2
GATEWAY=10.10.20.1
DNS2=10.10.20.3
IPADDR1=10.10.20.51
PREFIX1=24

ifconfig 输出:

ifconfig
ens185: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 00:50:56:b7:f9:bf  txqueuelen 1000  (Ethernet)
        RX packets 652900  bytes 46106616 (43.9 MiB)
        RX errors 0  dropped 66  overruns 0  frame 0
        TX packets 3874  bytes 661180 (645.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

ens245: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.20.50  netmask 255.255.255.0  broadcast 10.50.12.255
        inet6 fe80::250:56ff:feb7:9f7d  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:b7:9f:7d  txqueuelen 1000  (Ethernet)
        RX packets 32005531  bytes 68607241200 (63.8 GiB)
        RX errors 0  dropped 39  overruns 0  frame 0
        TX packets 27034935  bytes 3974604262 (3.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 588975  bytes 99241280 (94.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 588975  bytes 99241280 (94.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ip 地址输出:

ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens185: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:b7:f9:bf brd ff:ff:ff:ff:ff:ff
3: ens245: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:b7:9f:7d brd ff:ff:ff:ff:ff:ff
    inet 10.10.20.50/24 brd 10.10.20.255 scope global noprefixroute ens224
       valid_lft forever preferred_lft forever
    inet 10.10.20.51/24 brd 10.10.20.255 scope global secondary noprefixroute ens224
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:feb7:9f7d/64 scope link
       valid_lft forever preferred_lft forever

亲切的问候,

相关内容