Red Hat Enterprise Linux Diagnostics and Troubleshooting
Diagnose and resolve network connectivity issues.
Outcomes
You should be able to diagnose and resolve network connectivity issues on a Red Hat Enterprise Linux 8 host.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
[student@workstation ~]$ lab start network-resolving
This command configures network interfaces and modifies DNS servers.
Instructions
A second network interface, eth1, was added to the servera and serverb systems. The interfaces are connected to a private network and have the following IP addresses:
servera: 172.24.250.10/24serverb: 172.24.250.11/24
Users report that the server cannot communicate with each other using the new interfaces. Additionally, DNS is not working on the servera system. The network settings must persist when the machine is rebooted.
Diagnose and resolve the issues you find so that the servera system can ping the eth1 interface on the serverb system, and also resolve the access.redhat.com website by using the 172.25.250.17 DNS server.
Log in to
serveraand switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Verify the network connectivity issues.
Run the
pingcommand against the IP address of theeth1interface onserverb. No reply is expected.[root@servera ~]#
ping -c 2 172.24.250.11PING 172.24.250.11 (172.24.250.11) 56(84) bytes of data. --- 172.24.250.11 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1059msRun the
pingcommand with theaccess.redhat.comdomain name. A "Name or service not known" error is expected.[root@servera ~]#
ping -c 2 access.redhat.comping: access.redhat.com: Name or service not known
Gather network information.
Display the current IP addresses.
[root@servera ~]#
ip addr show1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:00:fa:0a brd ff:ff:ff:ff:ff:ff inet 172.25.250.10/24 brd 172.25.250.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe00:fa0a/64 scope link valid_lft forever preferred_lft forever 3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:01:fa:0a brd ff:ff:ff:ff:ff:ffThe
eth0interface is up with an assigned IPv4 address and a link-local IPv6 address. Theeth1interface is also up but does not have any IP addresses assigned to it.Display the routing information.
[root@servera ~]#
ip routedefault via 172.25.250.254 dev eth0 proto static metric 100 172.25.250.0/24 dev eth0 proto kernel scope link src 172.25.250.10 metric 100The 172.24.250.0/24 network does not have a route, because the
eth1interface does not have an IP address in that subnet.Display the connection and device information.
[root@servera ~]#
nmcli conNAME UUID TYPE DEVICE Wired connection 1 8c6fd7b1-ab62-a383-5b96-46e083e04bb1 802-3-ethernet eth0 Wired connection 2 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 802-3-ethernet --- [root@servera ~]#nmcli devDEVICE TYPE STATE CONNECTION eth0 ethernet connected Wired connection 1 eth1 ethernet disconnected -- lo loopback unmanaged --NetworkManagerhas two connections: "Wired connection 1" and "Wired connection 2". The former is assigned toeth0, while no devices are assigned to the latter.Run the
digcommand to look for any information regarding the DNS issue.[root@servera ~]#
dig access.redhat.com; <<>> DiG 9.11.26-RedHat-9.11.26-4.el8_4 <<>> access.redhat.com ;; global options: +cmd ;; connection timed out; no servers could be reachedThe output indicates that an incorrect DNS server might be configured.
View the configuration of the
/etc/resolv.conffile.[root@servera ~]#
cat /etc/resolv.conf# Generated by NetworkManager search lab.example.com example.com nameserver172.25.250.117The IP address of the DNS server is incorrect.
Inspect the connection profiles. Filter the output to the parameters that are expected to be relevant.
[root@servera ~]#
nmcli con show "Wired connection 1" | grep dnsconnection.mdns: -1 (default) ipv4.dns: 172.25.250.117 ipv4.dns-search: lab.example.com,example.com ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.ignore-auto-dns: yes ipv6.dns: -- ipv6.dns-search: -- ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.ignore-auto-dns: yes [root@servera ~]#nmcli con show "Wired connection 2" | grep interfaceconnection.interface-name: ens1The "Wired connection 1" profile is configured with an incorrect IP address for its DNS server. The "Wired connection 2" profile is configured with the
ens1interface, which does not exist. Modifying theipv4.dnsparameter of the "Wired connection 1" profile and changing theifnameparameter of "Wired connection 2" should resolve the network connectivity issues.
Repair the
eth1interface issue, and then verify that the systems can communicate.Modify the
ifnameparameter of the "Wired connection 2" profile to reflect the correcteth1interface.[root@servera ~]#
nmcli con mod "Wired connection 2" ifname eth1Run the
nmcli con upcommand to activate the connection.[root@servera ~]#
nmcli con up "Wired connection 2"Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)Verify that the connection is now active with the correct interface.
[root@servera ~]#
nmcli con showNAME UUID TYPE DEVICE Wired connection 1 06d487b0-4ef5-3dcb-8baa-260c6f435574 ethernet eth0 Wired connection 2 97d45f09-316b-3678-b77d-9a3ef019d835 ethernet eth1Confirm that the
eth1interface now has an IP address.[root@servera ~]#
ip addr show eth13: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8942 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:01:fa:0a brd ff:ff:ff:ff:ff:ff inet 172.24.250.10/24 brd 172.24.250.255 scope global noprefixroute eth1 valid_lft forever preferred_lft forever inet6 fe80::243:e4c0:38fb:f19e/64 scope link noprefixroute valid_lft forever preferred_lft foreverVerify that the
pingcommand now works.[root@servera ~]#
ping -c 2 172.24.250.11PING 172.24.250.11 (172.24.250.11) 56(84) bytes of data. 64 bytes from 172.24.250.11: icmp_seq=1 ttl=64 time=1.48 ms 64 bytes from 172.24.250.11: icmp_seq=2 ttl=64 time=0.311 ms --- 172.24.250.11 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 0.311/0.897/1.483/0.586 ms
Repair the DNS issue and verify that you can resolve domain names.
Modify the
ipv4.dnsparameter of the "Wired connection 1" profile to reflect the correct IP address of the DNS server.[root@servera ~]#
nmcli con mod "Wired connection 1" ipv4.dns 172.25.250.17Attempt to ping the
access.redhat.comwebsite.[root@servera ~]#
ping -c 2 access.redhat.comping: access.redhat.com: Name or service not knownThe error persists because the
/etc/resolv.conffile does not change until the interface is restarted.Restart the
NetworkManagerservice to apply the changes.[root@servera ~]#
systemctl restart NetworkManagerNote
Normally, an interface is restarted to apply changes. However, in this case the SSH session drops if the interface goes down. Whenever possible, the
NetworkManagerservice keeps connections active as it restarts and applies changes.Verify that the
/etc/resolv.conffile now shows the correct server.[root@servera ~]#
cat /etc/resolv.conf# Generated by NetworkManager search lab.example.com example.com nameserver 172.25.250.17Observe the output of a successful
digcommand. TheNOERRORvalue in the header is expected.[root@servera ~]#
dig access.redhat.com; <<>> DiG 9.11.26-RedHat-9.11.26-4.el8_4 <<>> access.redhat.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64384 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;access.redhat.com. IN A ;; ANSWER SECTION: access.redhat.com. 2397 IN A 209.132.183.105 ;; Query time: 1 msec ;; SERVER: 172.25.250.17#53(172.25.250.17) ;; WHEN: Tue Oct 26 19:17:40 EDT 2021 ;; MSG SIZE rcvd: 55Verify that a ping to
access.redhat.comresolves the domain name.Note
A ping to external sites to the classroom might not work. For this exercise, ensure that the domain resolves correctly even if it does not respond to a ping.
[root@servera ~]#
ping -c 2 access.redhat.comPING e259367.dsca.akamaiedge.net (104.93.21.154) 56(84) bytes of data. 64 bytes from a104-93-21-154.deploy.static.akamaitechnologies.com (104.93.21.154): icmp_seq=1 ttl=54 time=6.60 ms 64 bytes from a104-93-21-154.deploy.static.akamaitechnologies.com (104.93.21.154): icmp_seq=2 ttl=54 time=2.59 ms --- e259367.dsca.akamaiedge.net ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 2.590/4.593/6.596/2.003 ms
Return to
workstationas thestudentuser.[root@servera ~]#
exit[student@servera ~]$exit[student@workstation ~]$