Ubuntu 22.04 Netplan 配置静态IP

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

相关文章

MacBook系统升级到Sequoia15.1 SSH密钥无权限解决
haproxy 负载rabbitmq集群 报client unexpectedly closed TCP connection
Nginx Apache CORS OPTIONS预检请求配置
windows 2012 命令行批量修改文件权限 删除
CICD持续部署 Jenkins 部署
CICD持续集成 SonarQube 代码检测部署

发布评论