linux下更改ip和mac命令

1. 設置mac地址
       ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
2. 關閉打開網卡
       ifconfig eth0 down/up
3. 設置ip和子網掩碼
       ifconfig eth0 192.168.1.10 netmask 255.255.255.0
4. 爲一個網卡設置多個ip
       ifconfig eth0:1 192.168.1.10 netmask 255.255.255.0
       ifconfig eth0:2 192.168.1.11 netmask 255.255.255.0
5.  永久更改ip設置,重啓生效
       vim /etc/sysconfig/network-scripts/ifcfg-eth0
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章