Ubuntu Server20.04 上设置静态 IP 地址 网关地址指向旁路由openwrt
Ubuntu Server 20.04 上设置静态 IP 地址 网关地址指向旁路由openwrt
vi编辑命令
sudo vi /etc/netplan/00-installer-config.yaml
sudo vi /etc/netplan/00-installer-config.yaml
文件内容
----------------------------------------------------------------
----------------------------------------------------------------
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens18: #你的网卡
dhcp4: no
addresses: [192.168.5.119/24]
gateway4: 192.168.5.5
nameservers:
addresses: [114.114.114.114]
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens18: #你的网卡
dhcp4: no
addresses: [192.168.5.119/24]
gateway4: 192.168.5.5
nameservers:
addresses: [114.114.114.114]
----------------------------------------------------------------------
之后 :wq 保存并退出
启动服务
$ sudo netplan apply
查看网络服务的状态
$ networkctl status
之后 :wq 保存并退出
启动服务
$ sudo netplan apply
查看网络服务的状态
$ networkctl status