如何将Ubuntu 18.04系统设置为固定的静态IP地址?
- 内容介绍
- 文章标签
- 相关推荐
本文共计638个文字,预计阅读时间需要3分钟。
系统版本:之前的版本通过etc/network/interfaces文件配置网络信息,18.04及以上版本也适用,只需重启生效。通过命令行操作如下:root@ubuntu:/# systemctl network restart
系统版本:之前的版本网卡配置信息配置在etcnetworkinterfaces文件,可以如下配置,在18.04上也是可以用的,只是要重启才能生效。通过servicenetworki系统版本:
root@ubuntu:/# lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 18.04 LTSRelease: 18.04Codename: bionicroot@ubuntu:/#之前的版本网卡配置信息配置在/etc/network/interfaces文件,可以如下配置,
auto ens33iface ens33 inet staticaddress 192.168.0.111netmask 255.255.255.0gateway 192.168.0.1在18.04上也是可以用的,只是要重启才能生效。通过service networking restart无效。
下面介绍一下在18.04上新采用的netplan命令。
本文共计638个文字,预计阅读时间需要3分钟。
系统版本:之前的版本通过etc/network/interfaces文件配置网络信息,18.04及以上版本也适用,只需重启生效。通过命令行操作如下:root@ubuntu:/# systemctl network restart
系统版本:之前的版本网卡配置信息配置在etcnetworkinterfaces文件,可以如下配置,在18.04上也是可以用的,只是要重启才能生效。通过servicenetworki系统版本:
root@ubuntu:/# lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 18.04 LTSRelease: 18.04Codename: bionicroot@ubuntu:/#之前的版本网卡配置信息配置在/etc/network/interfaces文件,可以如下配置,
auto ens33iface ens33 inet staticaddress 192.168.0.111netmask 255.255.255.0gateway 192.168.0.1在18.04上也是可以用的,只是要重启才能生效。通过service networking restart无效。
下面介绍一下在18.04上新采用的netplan命令。

