将 Kali 连接到互联网

将 Kali 连接到互联网

我已经在我的树莓派上安装了 Kali。我已成功使用 Putty 通过 ssh 连接到它,但无法访问互联网。
更具体地说,我既不能更新/升级,也不能,ping www.google.com但我可以ping 8.8.8.8
PI和我的桌面连接到同一个路由器。
我检查了路由、网关、接口,我更换了电缆,认为这可能是物理链路,但没有任何效果。有什么建议 ?

root@kali:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.105  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 2a02:2f09:33ba:d200:ba27:ebff:fe54:38fd  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::ba27:ebff:fe54:38fd  prefixlen 64  scopeid 0x20<link>
        inet6 fdf8:b85b:7d29:0:ba27:ebff:fe54:38fd  prefixlen 64  scopeid 0x0<global>
        ether b8:27:eb:54:38:fd  txqueuelen 1000  (Ethernet)
        RX packets 561  bytes 39987 (39.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 294  bytes 42374 (41.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@kali:~# ping www.google.com
PING www.google.com(bud02s24-in-x04.1e100.net (2a00:1450:400d:803::2004)) 56 data bytes
^C
--- www.google.com ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 6007ms

root@kali:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=14.2 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=11.9 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=56 time=13.1 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=56 time=11.8 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=56 time=12.6 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 11.844/12.764/14.216/0.880 ms

PS 我已经将具有相同操作系统的相同设备连接到我朋友的不同路由器,并且无需任何调整即可工作。

答案1

您的问题是缺乏 IPv6 连接。

当您的 Pi 获得分配给它的 IPv6 地址时,系统将更喜欢使用 IPv6。但是,无论出于何种原因,您都无法获得出站互联网连接。

理想情况下,您应该检查路由器和其他计算机,并确保 IPv6 可以在它们上运行。但是,与此同时,您可以禁用它。

为此,请添加以下行/etc/sysctl.conf并重新启动:

net.ipv6.conf.eth0.disable_ipv6 = 1

当您的系统重新上线后,IPv6 将被禁用,您应该能够与任何 IPv4 网站建立正常连接。

相关内容