Linux series-Solve the problem of ping failure

The author focuses on technologies such as Java, architecture, Linux, applets, crawlers, and automation. I sorted out some information with tears during the work, searched on WeChat for [Programmer Master Road], and responded to [java] [hacker] [crawler] [small program] [interview] and other keywords to obtain free information. Technical exchanges and project cooperation can be privately chatted. 

Preface

Linux FAQ summary article: Linux FAQ summary

Here are the detailed steps:

Step1 Configure the local network card

Step2 Configure virtual network card

VMware Network Adapter VMnet8 network adapter IP settings and virtual machine IP need to be in the same network segment

Step3 Configure virtual network DHCP

Step4 NAT settings

Step5 ifcfg-eth*

修改/etc/sysconfig/network-scripts/ifcfg-eth0:


 
  
  
  1. DEVICE=eth 0 #Network card interface name  
  2. TYPE=Ethernet #Network card type is Ethernet
  3. ONBOOT=yes #Automatically activate the network card when the system starts
  4. NM_CONTROLLED= no  
  5. BOOTPROTO=none #There   are usually four types of protocols: static dhcp bootp none
  6. DEFROUTE = yes  
  7. PEERDNS=yes
  8. PEERROUTES=yes
  9. IPV4_FAILURE_FATAL=yes #Use   IPV4 protocol version
  10. IPV6INIT= no #Do not use IPV6 protocol version    
  11. NAME= "System eth0"
  12. = IPADDR 192.168 . 1.111 ip address of #linux  
  13. = GATEWAY 192.168 . 1.1 # Gateway    
  14. NETMASK = 255.255 . 255.0 #Subnet mask  
  15. DNS1= 114.114 . 114.114 #DNS server address  
  16. ARPCHECK= no  

step6 Permanently turn off the firewall

chkconfig iptables off

Step7 Add DNS under /etc/resolv.conf

nameserver 114.114.114.114 
nameserver 8.8.8.8

Step8 Restart the network service

service network restart

Step9 If the above steps do not work, try another DNS

For example: change 192.168.1.1 to 192.168.1.55 (maybe 192.168.1.1 is occupied by someone else). If the
host ip address is changed, the ip address of linux should also be changed.

The author focuses on technologies such as Java, architecture, Linux, applets, crawlers, and automation. I sorted out some information with tears during the work, searched on WeChat for [Programmer Master Road], and responded to [java] [hacker] [crawler] [small program] [interview] and other keywords to obtain free information. Technical exchanges and project cooperation can be privately chatted. 

Guess you like

Origin blog.csdn.net/D_J1224/article/details/107535854