Linux系统在线增加多个ip首先要先查看ip
代码:
linuxedu.net# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:BA:EF:21:E2
inet addr:192.168.1.1 Bcast:192.168.1.255 mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3433865 errors:0 dropped:0 overruns:0 frame:0
TX packets:2730922 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2610363482 (2489.4 Mb) TX bytes:577832769 (551.0 Mb)
Interrupt:11 Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:811139 errors:0 dropped:0 overruns:0 frame:0
TX packets:811139 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2007636558 (1914.6 Mb) TX bytes:2007636558 (1914.6 Mb)
添加ip
代码:
ifconfig eth0:0 192.168.1.2 netmask 255.255.255.255 up
在查看.
代码:
linuxedu.net# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:BA:EF:21:E2
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3433865 errors:0 dropped:0 overruns:0 frame:0
TX packets:2730922 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2610363482 (2489.4 Mb) TX bytes:577832769 (551.0 Mb)
Interrupt:11 Base address:0xc000
eth0:0 Link encap:Ethernet HWaddr 00:50:BA:EF:21:E2
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3433471 errors:0 dropped:0 overruns:0 frame:0
TX packets:2730637 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2610321034 (2489.3 Mb) TX bytes:577696691 (550.9 Mb)
Interrupt:11 Base address:0xc000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:811139 errors:0 dropped:0 overruns:0 frame:0
TX packets:811139 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2007636558 (1914.6 Mb) TX bytes:2007636558 (1914.6 Mb)
最后写到文件里,使从新启动时生效.
vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
代码:
DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.2
去掉ip
代码:
ifconfig eth0:0 192.168.1.2 netmask 255.255.255.255 down
rm /etc/sysconfig/network-scripts/ifcfg-eth0:0
完成.
在Linux系统下在线增加多个ip的方法
转载请注明出处:服务器评测 » 在Linux系统下在线增加多个ip的方法
相关推荐
- *美国✅专用服务器 99.99% 正常运行时间 ✅ 最佳网络 ✅ 24/7 支持 ✅ 84 美元起
- 双 E5-2695v4 ✅ 10Gbps NL 专用服务器✅低延迟强国,适用于 CDN、VPN、流
- [意大利][欧洲]Aruba 专用服务器 – DELL 服务器 25% 折扣,起价为 37.43 欧元 + 增值税/月
- *🔥WHT销售+EoL清仓🔥新价格👉即时服务器💎未计量10G和Ryzen 9 ECC
- *██ Ryzen 9 9950X 192G NVMe █ L.A. R7s, R9s Xeon GOLDs █ 免费升级!█ 100G 端口 ██ $34
- SolaDrive 促销!Ryzen 5950x, 4TB NVMe, 128GB RAM, 10Gbps 带宽, 每月 95 美元
- *热卖!RackNerd 的专用服务器促销!SSD, NVMe & HIGH STORGAGE DEDIS每月59美元起
- 爱沙尼亚和荷兰10Gbps专用服务器优惠 – 在它消失之前立即抢购你的