首先ifconfig查看你新的网卡的名字,例如是叫enp0s3,那么:
vim /etc/network/interfaces
Change from:
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.56.5
netmask 255.255.255.0
gateway 192.168.56.1
Change to:
auto lo
iface lo inet loopback
allow-hotplug enp0s3
iface enp0s3 inet static
address 192.168.56.5
netmask 255.255.255.0
gateway 192.168.56.1