- 准备2台虚拟机
IP地址分别为
192.168.118.6
192.168.118.66
[root@localhost ~]
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.118.6 netmask 255.255.255.0 broadcast 192.168.118.255
inet6 fe80::29a4:1493:e6cd:c703 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:fa:2c:d4 txqueuelen 1000 (Ethernet)
RX packets 135 bytes 25778 (25.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 147 bytes 17086 (16.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.118.66 netmask 255.255.255.0 broadcast 192.168.118.255
inet6 fe80::5221:1a2c:46e2:7026 prefixlen 64 scopeid 0x20<link>
inet6 fe80::29a4:1493:e6cd:c703 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ba:af:d8 txqueuelen 1000 (Ethernet)
RX packets 100 bytes 16269 (15.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 104 bytes 12148 (11.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- 修改主机名
[root@m ~]
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.118.6
[root@m ~]
m.zzq.org
[root@m ~]
192.168.118.6 m m.zzq.org
192.168.118.66 s s.zzq.org
[root@m ~]
SELINUX=permissive
[root@m ~]
[root@m ~]
m.zzq.org
[root@s ~]
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.118.66
[root@s ~]
s.zzq.org
192.168.118.6 m m.zzq.org
192.168.118.66 s s.zzq.org
[root@m ~]
SELINUX=permissive
[root@s ~]
[root@s ~]
s.zzq.org
[root@s ~]
PING m (192.168.118.6) 56(84) bytes of data.
64 bytes from m