ubuntu 20.04改网关,静态IP,DNS

改网关

sudo vim /etc/systemd/resolved.conf

[Resolve]
DNS=192.168.30.2
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#Cache=yes
#DNSStubListener=yes

静态IP,网关

sudo vim /etc/netplan/01-network-manager-all.yaml

# Let NetworkManager manage all devices on this system
#network:
#  version: 2
#  renderer: NetworkManager
#
network:
    ethernets:
        ens33:
            dhcp4: no
            addresses: [192.168.30.145/24]
            optional: true
            gateway4: 192.168.30.2
            nameservers:
                    addresses: [192.168.30.2,223.6.6.6]
 
    version: 2
 

你可能感兴趣的:(tcp/ip,ubuntu,服务器)