close
Ubuntu Linux 20.04 網路設定
edit /etc/netplan/00-installer-config.yaml
#使用dhcp 抓動態IP
# This is the network config written by 'subiquity'
network:
ethernets:
eth0:
dhcp4: true
version: 2
#靜態IP
1. 先確認 /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg 是否為以下參數
network: {config: disabled}
2. 修改 /etc/netplan/00-installer-config.yaml
network:
ethernets:
eth0:
addresses: 192.168.1.100/24
gateway4: 192.168.1.254
nameservers:
addresses:
-8.8.8.8
-168.95.1.1
version: 2
3. 套用設定
# netplan apply
4. 檢查是否生效
# ip addr show 或
# ifconfig
文章標籤
全站熱搜