ただし、2つの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
ありがとう、