Administrator
发布于 2024-07-05 / 101 阅读
1

Ubuntu 22.04设置固定IP

1、设置IPV4

2、设置IP和dns

sudo vim /etc/netplan/50-cloud-init.yaml


network:
  version: 2
  renderer: networkd
  ethernets:
    eth0: #Edit this line according to your network interface name.
      dhcp4: no
      addresses:
        - 192.168.1.10/24
      gateway4: 192.168.1.1
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4