編輯網路配置文档
先使用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