Ubuntu18.04选择networking.service或者network-manage.service(二选一),以下操作选择networking.
常用命令:
# 检查网卡情况
# ifconfig
# 检查路由
# route -n
# 查看网络服务状态
# systemctl status networking.service
# 查看电脑物理网卡名称
# lshw -c network 或者 lshw -c network |grep name
# 配置静态IP
vi /etc/network/interfaces 配置静态IP
auto lo iface lo inet loopback auto enp2s0 iface enp2s0 inet static netmask 255.255.255.0 gateway 10.1.10.xxx address 10.1.10.xxx # dns-nameservers 8.8.8.8 114.114.114.114
域名无法解析
查看系统解析服务状态
# systemctl status systemd-resolved
#vi /etc/systemd/resolved.conf ,修改DNS和FallbackDNS
[Resolve] DNS=xxx.xxx.xxx.xxx 多个以空格隔开 FallbackDNS=8.8.8.8 8.8.4.4 #Domains= #LLMNR=no #MulticastDNS=no #DNSSEC=no #Cache=yes #DNSStubListener=yes