编辑网络配置文件
先使用vim打开/etc/network/interfaces配置文件
vim /etc/network/interfaces
在配置文件里添加
auto 网卡号
allow-hotplug 网卡号
iface 网卡号 inet static
address IP地址
auto ens33
allow-hotplug ens33
iface ens33 inet static
address 172.16.100.254/24
接下来重头戏来了
debian网卡重启
在Debian里好多网卡重启的命令都不可用, 经过测试以后只有这个套路还凑合,要是重启过后还不行,建议重启服务器/虚拟机
/etc/init.d/networking restart