ubuntu16,18-20,22 配置静态ip
ubuntu 16.04 - server
vim /etc/network/interfaces auto lo iface lo inet loopback auto eth32 iface eth32 inet static address 192.168.254.100 netmask 255.255.255.0 gateway 192.168.254.254 dns-nameservers 8.8.8.8 114.114.114.114
ubuntu 18.04-20.04 - server
Ubuntu18.04-20.04 配置静态IP和DNS #单块网卡配置静态IP vim /etc/netplan/50-cloud-init.yaml network: version: 2 ethernets: ens32: addresses: [192.168.254.100/24] dhcp4: no optional: true gateway4: 192.168.254.254 nameservers: addresses: [8.8.8.8,114.114.114.114] #网卡配置生效 netplan --debug apply
ubuntu 22.04 - server
Ubuntu22.04-23.04配置静态IP和DNS vim /etc/netplan/50-cloud-init.yaml network: version: 2 renderer: networkd ethernets: ens32: dhcp4: no dhcp6: no addresses: [192.168.254.100/24] routes: - to: default via: 192.168.254.254 nameservers: addresses: [114.114.114.114,8.8.8.8] #网卡配置生效 netplan --debug apply
本文来自博客园,站在巨人的肩膀上,坚持开源精神,遵循开源协议:Apache Licene 2.0协议。
浙公网安备 33010602011771号