1. 程式人生 > >centos7 臨時修改,增加和刪除ip地址的方式

centos7 臨時修改,增加和刪除ip地址的方式

1.臨時修改ip地址,ifconfig 網絡卡名稱 ip地址(重啟失效)

命令:

ifconfig ens33 192.168.1.110

2.多個臨時ip,ifconfig 網絡卡名:0 第一個ip

命令:

ifconfig ens33:0 192.168.1.112

ifconfig ens33:1 192.168.2.111

3.重啟

命令:

systemctl restart network(centos7)

service network restart(centos6)

 

4.檢視ip地址:

命令:

ifconfig或者ifconfig ens33(enp為獨立網絡卡)

5.刪除臨時ip

命令:

ifconfig ens33:0 del 192.168.1.111