使用樹莓派4 安裝完kali linux后,配置好ip,能ping通上級路由。
但ping公網地址顯示網絡不可達。
Ping: connect: network is unreachable
解決方法如下。
編輯NetworkManager.conf文件
將managed參數修改為true。
保存退出:wq
重啟服務即可正常訪問
root@kali:~# /etc/init.d/network-manager restart
Restarting network-manager (via systemctl): network-manager.service.
root@kali:~#
如果還是不行,查看一下路由信息
root@kali:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
看起來是路由問題
新增一下路由
root@kali:~# route add default gw 192.168.2.1 root@kali:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 root@kali:~# ping www.baidu.com PING www.a.shifen.com (112.80.248.76) 56(84) bytes of data. 64 bytes from 112.80.248.76 (112.80.248.76): icmp_seq=1 ttl=54 time=13.6 ms
這樣就沒問題了。