Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 的一些小 Tip #333

Open
Bpazy opened this issue Aug 30, 2024 · 1 comment
Open

Ubuntu 的一些小 Tip #333

Bpazy opened this issue Aug 30, 2024 · 1 comment

Comments

@Bpazy
Copy link
Owner

Bpazy commented Aug 30, 2024

记录一些 ubuntu 的小知识点

@Bpazy
Copy link
Owner Author

Bpazy commented Aug 30, 2024

修改网关和 DNS 地址

$ cat /etc/netplan/00-installer-config.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens18:
      dhcp4: no # 关闭 DHCP 自动获取 IP
      addresses:
        - 192.168.31.31/24 # 手动指定当前设备 IP 地址
      gateway4: 192.168.31.3 # 这是要指定的网关地址
      nameservers:
        addresses: [192.168.31.3] # 这是要指定的 DNS 地址,和网关地址保持一致即可
  version: 2

变更文件后应用: sudo netplan apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant