Daizc
count.articles42
count.tags21
count.categories3
Linux下的简单网络管理

Linux下的简单网络管理

使用Netplan管理网络配置

相关资料

步骤

  1. 修改配置
  2. 应用网络策略sudo netlpan apply
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    # This is the network config written by 'subiquity'
    network:
    version: 2
    # 可选值 NetworkManager | networkd
    renderer: NetworkManager
    ethernets:
    eno1:
    addresses:
    - 192.167.20.211/24
    gateway4: 192.167.20.1
    nameservers:
    addresses:
    - 192.167.20.1
    - 114.114.114.114
    - 1.1.1.1
    search: []
    eno2:
    dhcp4: true

  3. 使用sudo nmtui微调网络,如果nmtui中看不到接口,则检查配置后使用sudo systemctl reload NetworkManager重启服务即可

静态配置(旧版Ubuntu)

  • 静态ip配置: /etc/network/interfaces
  • 静态dns配置: /etc/resolv.conf

copyright.author:Daizc
copyright.permalink:https://note.bequick.run/Linux%E4%B8%8B%E7%9A%84%E7%AE%80%E5%8D%95%E7%BD%91%E7%BB%9C%E7%AE%A1%E7%90%86/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可
×