- 在命令行下测试网络的连通性
显示主机名
hostname
测试网络连通性
ping
显示正确的路由表
ip route- 跟踪路由
traceroute
tracepath
mtr- 确定名称服务器使用
nslookup
host
dig
官网文档:
https://help.ubuntu.com/lts/serverguide/network-configuration.html.zh-CN
cat /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: yes
cat /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 192.168.6.10/24
- 10.10.10.10/24
gateway4: 192.168.6.1
nameservers:
search: [mydomain, otherdomain]
addresses: [223.5.5.5, 8.8.8.8, 1.1.1.1]
ip addr
route -n
- ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Dec 12 11:36 /etc/resolv.conf
\> ../run/systemd/resolve/stub-resolv.conf- systemd-resolve --status
hostnamectl set-hostname ubuntu1904
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。