Linux系統線上增加多個ip(轉)
Linux系統線上增加多個ip(轉)[@more@]首先檢視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
完成.
程式碼:
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
完成.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10617731/viewspace-950156/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux系統下封殺非法IP(轉)Linux
- 用LIDS增強Linux系統安全(轉)Linux
- Linux命令列得到系統IPLinux命令列
- linux繫結多個ip(轉載)Linux
- wemall商業版微商城系統增加多功能
- linux系統設定IP的方法Linux
- 20個Linux系統管理員必知系統監控工具(轉)Linux
- 線上環境 Linux 系統呼叫追蹤Linux
- 六個線上CRM系統的優勢
- 對於Linux系統管理員很有用的16個線上工具Linux
- 自己動手做一個迷你 Linux 系統(轉)Linux
- 拯救Linux系統(轉)Linux
- 紅旗Linux作業系統美化/個性化(轉)Linux作業系統
- 線上CRM系統
- Linux系統哪個更好用?Linux系統盤點!Linux
- Linux檔案系統 (轉)Linux
- Linux 系統管理(上)(轉)Linux
- Linux 系統管理(中)(轉)Linux
- Linux 系統管理(下)(轉)Linux
- linux系統防DDOS(轉)Linux
- javascript向陣列中追加多個元素JavaScript陣列
- Linux系統超詳細Linux設定靜態IP教程!Linux
- 【Linux】Linux檔案系統管理6 線上擴充套件、收縮lvm檔案系統Linux套件LVM
- Linux系統管理命令二(轉)Linux
- linux系統升級指南(轉)Linux
- Linux命令FAQ:系統配置(轉)Linux
- Linux(admin)系統管理(轉)Linux
- 安全使用RedHat Linux系統(轉)RedhatLinux
- Linux系統呼叫講義(轉)Linux
- LINUX系統效能調諧(轉)Linux
- Linux系統管理簡介(轉)Linux
- Linux檢視系統命令(轉)Linux
- java線上聊天系統Java
- JavaScript 陣列一次追加多個元素JavaScript陣列
- Linux核心即時入侵檢測安全增強-系統呼叫執行步驟(轉)Linux
- Linux下域名IP互轉Linux
- linux 域名轉ip的方法Linux
- 線上快速匹配IP