- 在网卡eth0上增加一个IP地址192.168.1.22
[root@AS-1 poccharging0]# ifconfig eth0:1 192.168.1.22 netmask 255.255.255.0
[root@AS-1 poccharging0]# ifconfig
eth0:1 Link encap:Ethernet HWaddr 5C:26:0A:FB:D8:88
inet addr:192.168.1.22 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:90 Memory:da000000-da012100
如果还要增加一个,执行 ifconfig eth0:2 192.168.1.23 netmask 255.255.255.0 就可以。
要删除该IP地址,执行 ifconfig eth0:2 down 即可。
. 在网卡eth0上增加一个IP地址192.168.1.22 另外一种方法
[root@AS-1 poccharging0]# ip addr add 192.168.1.22/24 dev eth0
[root@AS-1 poccharging0]# ip addr
2: eth0:
本文介绍如何在Linux系统中为网卡eth0增加额外的IP地址,例如192.168.1.22,并提供了两种方法:使用ifconfig命令和ip addr add命令。此外还介绍了如何删除已添加的IP地址。
684

被折叠的 条评论
为什么被折叠?



