Ubuntu 22.04 Netplan 配置静态IP

2024-07-26 542 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

相关文章

OpenResty ModSecurity 编译
vCenter 7.0 禁用 vSphere 集群服务 (vCLS)
ESXI 7.0 分布式交换机 LACP 配置
yum 和 apt-get 安装指定版本
DELL R640 RAC0504 无机柜可显示
MacBook系统升级到Sequoia15.1 SSH密钥无权限解决

发布评论