Ubuntu 22.04 Netplan 配置静态IP

2024-07-26 618 0

dhcp

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens160:
      dhcp4: true
  version: 2

静态配置

root@ubuntu:~# cat /etc/netplan/00-installer-config.yaml 
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens160:
      dhcp4: false
      addresses: 
        - 192.168.77.12/24
      nameservers:
        addresses: 
          - 192.168.77.8
      routes:
        - to: default
          via: 192.168.77.1
  version: 2

生效

netplan apply

相关文章

dify smtp邮箱配置
vcenter 7 克隆虚拟机 ubuntu dhcp ip一样
prometheus 报错 “Out of order sample from remote write” err=”out of bounds”
ubuntu proxychains4 命令全局代理
OpenResty ModSecurity 编译
vCenter 7.0 禁用 vSphere 集群服务 (vCLS)

发布评论