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的方法
相关推荐
- *{eWebGuru.com} 廉价专用服务器| 免费 SSL 证书
- *🍂 黑色星期五前促销🔥30% 折扣!👉 即时服务器!💎 不限流量!💎 E5 特惠 + Ryzen
- *229 美元/月 E-2276G + 128GB RAM + 2x1TB NVMe + 10TB 备份 + 1Gbps 20TB BW 限时优惠!
- 灯泡每月 79 美元 E3-1230v3 + 32 GB RAM + 2×480 GB SSD + 1x2TB SATA + 10 TB 带宽限时优惠!
- *★★ 八核 HT Xeon 特价销售!| 中西部专用主机 | 美国印第安纳波利斯 ★★
- 【中国狂欢节】云服务器低至1.66美元;裸机E5/16g/1T闪购价仅需17.99起! – CST服务器
- Spin 服务器 | 双 Intel Xeon Platinum 8173M | 56C/ 112T | 1.5TB RAM |100TB 10G
- *Dedirock 为您提供首月 10% 闪购折扣,立即抢购!!!