xavier NX板子上安装的事ubuntu18, 简单记录一下ubuntu18如何配置静态IP地址。
首先生成一下文件:
sudo netplan generate
运行这一句的时候如果提示netplan command not found,执行下面的命令
sudo apt install netplan.io
然后创建文件
sudo vim /etc/netplan/01-netcfg.yaml
文件内容如下
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [172.31.8.77/24, ]
gateway4: 172.31.8.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
注意,上述文件写的时候,:后面都有两个空格,不加空格后面会提示错误。
然后生效文件
sudo netplan apply
标签:文件,sudo,network,静态,8.8,netplan,ubuntu18,IP地址
来源: https://www.cnblogs.com/cumtchw/p/13262136.html