What should I do if Kali cannot connect to the Internet? ! !

  • First, ping 8.8.8.8. If we can ping successfully, it means there is no problem with our network. If ping fails, we need to modify our virtual network settings.

  • If we can ping8.8.8.8 but cannot ping baidu.com, it means there is a problem with our DNS. Then we need to modify our network configuration at this time.

  • If it is NAT mode, we need to check the network card of VMnet8, and then configure the address of this network segment. If it is bridge mode, we need to check the ipv4 address of the Ethernet adapter Ethernet 2.

  • If pinging Baidu fails in NAT mode, enter vi /etc/reslov.conf and add nameserver 8.8.8.8 to access Baidu.

  • It's special that I can't connect to the Internet this time. I can't ping both 8.8.8.8 and Baidu. This is because I use the campus network and use unified authentication to log in. In this case, I can only use NAT mode and then modify it. Download the network configuration file vim /etc/network/interfaces, restart the network, and it will be fine. If service networking restart reports an error, it means there is an error in the network configuration file.

  • Or you can try the following command

  • Enter cat /etc/resolv.conf and add nameserver

 

Also check to see if your physical machine is connected to the campus network. If so, Kali needs to change to NAT mode and cannot use bridge mode!

After following these steps, kali should be able to connect to the Internet.

Guess you like

Origin blog.csdn.net/weixin_53270267/article/details/130820324