Ubuntu 22.04 Netplan 配置静态IP

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

相关文章

yum 和 apt-get 安装指定版本
DELL R640 RAC0504 无机柜可显示
MacBook系统升级到Sequoia15.1 SSH密钥无权限解决
haproxy 负载rabbitmq集群 报client unexpectedly closed TCP connection
Nginx Apache CORS OPTIONS预检请求配置
windows 2012 命令行批量修改文件权限 删除

发布评论