虚拟机serverA的root密码为liuguohua.com,请为此虚拟机配置以下网络参数:
主机名:serverA.lab.liuguohua.com
IP地址:172.25.250.10
子网掩码:255.255.255.0
默认网关:172.25.250.254
DNS服务器:172.25.250.254

应试答案:
设置主机名为serverA.lab.liuguohua.com
[root@servera~]#hostnamectl set-hostname serverA.lab.liuguohua.com

查询网络配置文件
[root@servera~]# nmcli connection show
NAME UUID TYPE DEVICE
Wired connection 1 ec3a15fb-2e26-3254-9433-90c66981e924 ethernet eth0

删除默认的网络配置文件 wired,后面可以 tab
[root@servera~]# nmcli connection delete Wired\ connection\ 1

创建网络配置文件
[root@serverA~]# nmcli connection add type ethernet ifname eth0 con-name eth0 ipv4.method manual ipv4.addresses 172.25.250.10/24 ipv4.gateway 172.25.250.254 ipv4.dns 172.25.250.254 autoconnect yes

激活网络配置文件
[root@servera~]# nmcli connection up eth0

测试网络是否连通
[root@serverA~]# ping classroom.liuguohua.com
PING 172.25.250.254 (172.25.250.254) 56(84) bytes of data.
64 bytes from 172.25.250.254: icmp_seq=1 ttl=64 time=1.11ms
64 bytes from 172.25.250.254: icmp_seq=2 ttl=64 time=0.412ms

 

或通过nmtui,字符型图形界面配置信息,最后再激活一下

[root@serverA~]# nmcli connection up Wired\ connection\ 1

声明:欢迎大家光临本站,学习IT运维技术,转载本站内容,请注明内容出处”来源刘国华教育“。如若本站内容侵犯了原著者的合法权益,请联系我们进行处理。