例如
在 servera.lab.example.com 上完成以下实验:
配置网络,要求如下: l 主机名:servera.lab.example.com l IP 地址:172.25.250.10/24 l 网关:172.25.250.254 l DNS:172.25.250.254
# nmcli connection show 网络连接的查看
# nmcli connection modify "Wired connection 1" ipv4.addresses 172.25.250.10/24 ipv4.gateway 172.25.250.254 ipv4.dns 172.25.250.254 ipv4.method manual connection.autoconnect yes网络的详细配置 包含ipv4 静态配置 和网络连接自启动
# nmcli connection up "Wired connection 1" 网络连接的启动
# hostnamectl set-hostname servera.lab.example.com 设置主机名
# ip a s 检查IP 地址
# hostname 检查主机名
# nslookup serverb.lab.example.com 检查dns
# ip route 检查网关