EVE-NG静态IP配置

通过以下命令进入IP配置界面
root@eve-ng:~# vi /etc/network/interfaces
修改pnet0的网卡IP
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet manual
auto pnet0
iface pnet0 inet static   #dhcp变更为sataic
    bridge_ports eth0
    bridge_stp off
    address 172.16.19.202
    netmask 255.255.255.0
    gateway 172.16.19.254
    dns-nameserver 114.114.114.114
重启网卡以保证配置生效 ,以下2条命令可任意选其一使用
systemctl  restart  networking.service  

/etc/init.d/networking restart

注意点

配置IP时需要注意不可误删除其他配置,否则会导致配置生效时报错
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet manual
auto pnet0
iface pnet0 inet static
    bridge_ports eth0
    bridge_stp off
    address 172.16.19.202
    netmask 255.255.255.0
    gateway 172.16.19.254
    dns-nameserver 114.114.114.114

# Cloud devices
iface eth1 inet manual
auto pnet1
iface pnet1 inet manua  #配置时如果误删除l
    bridge_ports eth1
    bridge_stp off

iface eth2 inet manual
auto pnet2
iface pnet2 inet manual
    bridge_ports eth2
    bridge_stp off

iface eth3 inet manual
auto pnet3
iface pnet3 inet manual
    bridge_ports eth3
    bridge_stp off

iface eth4 inet manual
auto pnet4
iface pnet4 inet manual
    bridge_ports eth4
    bridge_stp off

iface eth5 inet manual
auto pnet5
iface pnet5 inet manual
    bridge_ports eth5
    bridge_stp off

导致重启网卡时报错
root@eve-ng:~# systemctl  restart  networking.service 
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.


root@eve-ng:~# /etc/init.d/networking restart
Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.
 failed!

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐