方法1
rambo@test3:~$ sudo vim /etc/network/interfaces # 追加如下内容
....
....
auto ens33
iface ens33 inet static
address 172.16.186.133
netmask 255.255.255.0
gateway 172.16.186.2
dns-nameservers 172.16.186.2
rambo@test3:~$ sudo systemctl restart networking.service
方法2
rambo@test2:~$ sudo vim /etc/network/interfaces.d/ens33
auto ens33
iface ens33 inet static
address 172.16.186.132
netmask 255.255.255.0
gateway 172.16.186.2
dns-nameservers 172.16.186.2
rambo@test2:~$ sudo systemctl restart networking.service