#设置双网卡
nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto enp1s0
iface enp1s0 inet static
address 10.9.9.99
netmask 255.255.255.0
gateway 10.9.9.1
dns-nameservers 8.8.8.8 8.8.4.4
auto enp2s0
iface enp2s0 inet manual
up ip link set enp2s0 up
down ip link set enp2s0 down
sudo /etc/init.d/networking restart
# 或者使用 ifdown/ifup
sudo ifdown eth0 && sudo ifup eth0
sudo ifdown eth1 && sudo ifup eth1