During the use of the RHEL virtual machine at home today, after the network is switched from Wi-Fi to wired, a problem suddenly occurs: unable to connect to the network. This problem was discovered by the wsdl2h tool during gsoap code writing. It always prompts that the server cannot be connected to the specified server.
Ping Baidu.com, but it seems that it is a DNS problem. Modify the/etc/resolv. conf file, change the nameserver in it to the same as that in Windows (automatically obtained by DHCP), and then restart the network service:
/Etc/init. d/network restart
Ping www.baidu.com again, still not good, think of/etc/sysconfig/network-scripts/ifcfg-eth0 file has not been modified, so go in to change gateway to the same as windows, and then restart the network service, finally, you can ping Baidu.
I have never found this problem because I have always used wi-fi at home, and I have always used wired lines at the company. Today I have used wired lines at home for a long time, as a result, RHEL uses the wired network configuration and thus cannot access the Internet (because the company's DNS servers and gateways are the company's intranet addresses, which are different from those at home ).
Pay attention to this issue later.