I installed the RHD HAT6.5 system this morning. I was able to access the Internet in the morning, but after restarting the system and adding a router, I was unable to access the Internet.
The specific configuration is as follows:
After changing the DNS to point to the gateway, I still cannot access the external network (the gateway is: 192.168.3.1).
Then change the DNS again, and after DNS points to 114.114.114.114, you still cannot access the external network.
At this time, it is confirmed that it is not a DNS problem. Check whether the intranet can access it: (The results are as follows)
After checking, make sure there is no problem with the intranet, and then check whether the network settings are correct:
After confirming that there is no problem with the network configuration, add route add default gw 192.168.192.3.1 dev eth0
(This command is to add a gateway route, that is, to tell the system where to go) After this command, you can access the external network
After checking for a while, I found that there were other gateways in the /etc/sysconfig/network file.
Restore the system to the state before adding the command route add default gw 192.168.192.3.1 dev eth0.
After modifying the gateway in /etc/sysconfig/network, you can access the external network normally.
Problem Analysis:
Because there are other gateways in the /etc/sysconfig/network file, and the system uses the gateway of this file as the default access gateway, you can access the external network after adding the command route add default gw 192.168.192.3.1 dev eth0.
Troubleshooting ideas for failure to access the external network:
- Check whether the network IP is in the same segment as the gateway
- Check whether the intranet can be connected (check the correctness of the intranet)
- Check the correctness of the gateway configuration
- Check if DNS is correct
- Check whether there are multiple gateways in the /etc/sysconfig/network file
The above method is a general step to check if the network cannot access the external network. (PS: There are other methods to check network failures. If I donât write it well, please donât criticize me. I will update the content later.)