內容來源於人民郵電出版社《Linux命令應用大詞典》
講述729個命令,1935個例子
學習Linux系統的參考書、案頭書,遇到不懂的命令或命令選項一查即可
爭取每天都發布內容
本文出自 “airfish2000” 博客,更多命令查看博客:
http://airfish2000.blog.51cto.com/10829608/1894366
ifcfg命令
使用ifcfg命令可以進行IP地址管理,是一個替換ifconfig命令的簡單的腳本。
命令語法:
ifcfg [設備] [命令] [地址[/長度]]
命令中各選項的含義如表所示。
表 ifcfg命令選項含義
命令 | 描述 |
add | 添加新地址 |
del | 刪除地址 |
stop | 完全禁用IP |
例:爲網絡接口eth0添加IP地址。
[root@rhel ~]# ifcfgeth0 add 192.168.0.3
Forwarding is ON orits state is unknown (6). OK, No RDISC.
例:刪除網絡接口eth0的IP地址。
[root@rhel ~]# ifcfg eth0 del 192.168.0.3
Forwarding is ON or its state is unknown (6). OK, No RDISC.
例:完全禁用網絡接口eth0。
[root@rhel ~]# ifcfg eth0 stop