Network is unreachable kali linux

«Network is unreachable» when attempting to ping google, but internal addresses work

I can get to other PCs in my house on the 192 network, but trying to go outside gives me the «network is unreachable» message. p3p1 is up with a good IP Address. Running Fedora 16. What should I do next to troubleshoot? All other PCs in the house are working (Windows, Mac).

Does any other PCs in your house have external internet access? (Can other PC ping google?) Restarted your house ADSL/cable/? modem?

Ping 8.8.4.4 fails @MariusMatutiae — same error, «connect: Network is unreachable.» But then I did a «route -n» and realized I had no gateway, added one («route add -net 0.0.0.0 gw 192.168.1.1 p3p1») and now I can ping 8.8.4.4 but still not 74.125.229.194 (google).

Yes @r3mus I can ping 192.168.1.1. On a working machine I go to «whatismyipaddress.com» and get my external address, and can ping that successfully as well from my failing machine.

3 Answers 3

You say all other pcs in your house have a connection. Then the problem lies only with your linux machine. There are several possibilities:

    You do have a connection, but you cannot reach your DNS; you can diagnose this by

if you can reach Google, then you have a connection, and you only need to update your DNS servers. Edit (as sudo) your /etc/resolv.conf file and add these two lines:

nameserver 8.8.8.8 nameserver 8.8.4.4 
default via 192.168.11.1 dev wlan0 proto dhcp metric 600 

(this is for my laptop). What is important is that the correct IP address of your router is shown exactly where mine (192.168.11.1) is shown. If an incorrect IP address is shown, or, worse, if the ip route show default command receives no reply, then your routing table has been corrupted. You may simply restore it by means of:

sudo ip route del default (only if the wrong IP address appears) sudo ip route add default via IP.address.OfYour.Router 

Источник

Читайте также:  Linux переименовать несколько файлов одновременно

How to fix the error “Network unreachable” when you ping any domain/computer in Kali Linux 2020?

I tried reaching google.com and many other hosts using “Ping” utility in Linux terminal. I repeatedly got “Network Unreachable” error or “Temporary failure in name resolution” error.

I faced the same error, when I tried reaching my own computer.

I am using Kali Linux Version 5.9.0-kali1-amd64 released in Oct 2020. I feel the behavior is erratic and unstable. The simple commands that worked previous day does not work next day.

After reading a lot of answers/reviews in google, I was able to find the root cause and solution as well.

  1. Doubtfully I checked the Metasploitable server entries. There I found an error in Ethernet Interface “eth0” : Interrupt:17 Base address:0x2000 , which we normally ignore or side-line. We mainly look for the ip address when we do “ifconfig” not the other output the server provides.

2) Also, I checked the status of Ethernet Interface in Linux terminal to confirm my doubt. There too, it showed the eth0 is down .

The solution to this problem is very simple as we clearly know that the “first Ethernet Interface(eth0)” is down. We need to activate “eth0” to send and receive information.

A simple command would activate this interface.

Now try reaching any domain/computer, the interface would allow you to interact. I, again, tried reaching google.com and my own computer. I got response.

Источник

connect: Network is unreachable

There are probably lots of situation when this can happen, but this is a big mistery for me. Some tools can use the network just fine (wget, dig, apt-get, . ), but some tools are just failing (ping, traceroute, the browser, . ). For example, I can download a file with wget :

gonvaled@pegasus ~ » wget archive.ubuntu.com --2014-10-02 10:52:34-- http://archive.ubuntu.com/ Resolving archive.ubuntu.com (archive.ubuntu.com). 2001:67c:1360:8c01::18, 2001:67c:1360:8c01::19, 91.189.91.14, . Connecting to archive.ubuntu.com (archive.ubuntu.com)|2001:67c:1360:8c01::18|:80. connected. HTTP request sent, awaiting response. 200 OK Length: 671 [text/html] Saving to: ‘index.html.2’ 100%[========================================================================================================================================================>] 671 --.-K/s in 0s 2014-10-02 10:52:34 (30,8 MB/s) - ‘index.html.2’ saved [671/671] 
gonvaled@pegasus ~ » dig archive.ubuntu.com ; > DiG 9.9.5-3-Ubuntu > archive.ubuntu.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER 

But I can not ping the site (not because the site is not replying to pings, but because Network is unreachable ):

gonvaled@pegasus ~ » ping archive.ubuntu.com connect: Network is unreachable 
gonvaled@pegasus ~ » traceroute archive.ubuntu.com traceroute to archive.ubuntu.com (91.189.88.149), 30 hops max, 60 byte packets connect: Network is unreachable 
gonvaled@pegasus ~ » ifconfig eth0 eth0 Link encap:Ethernet HWaddr 2c:76:8a:e0:b0:6b inet addr:10.11.44.84 Bcast:10.11.255.255 Mask:255.255.0.0 inet6 addr: 2001:4dd0:fff4:11:2c3f:5f86:f975:579f/64 Scope:Global inet6 addr: fe80::2e76:8aff:fee0:b06b/64 Scope:Link inet6 addr: 2001:4dd0:fff4:11:2e76:8aff:fee0:b06b/64 Scope:Global UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37502 errors:0 dropped:0 overruns:0 frame:0 TX packets:14119 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:13558552 (13.5 MB) TX bytes:3533448 (3.5 MB) gonvaled@pegasus ~ » route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.11.0.0 * 255.255.0.0 U 0 0 0 eth0 link-local * 255.255.0.0 U 1000 0 0 eth0 

EDIT

There seem to be two things at play here: IPv6 and default gateway. Whenever I enable wlan, I get these routes:

gonvaled@pegasus ~ » route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 10.11.0.1 0.0.0.0 UG 0 0 0 wlan0 10.11.0.0 * 255.255.0.0 U 0 0 0 eth0 10.11.0.0 * 255.255.0.0 U 9 0 0 wlan0 link-local * 255.255.0.0 U 1000 0 0 eth0 
  1. Why don't I get a default gateway with my eth0? (this is the real issue at hand)
  2. Why does IPv6 does not need a default gateway? (this is what was confusing me all along)

Источник

A Firewall Engineer

Everything about Cisco ASA, PIX, Check Point, Firewall, GNS3, Linux, Unix, Microsoft Windows, Networking, Network Security

[Solution] Network is unreachable

NETWORK DIAGRAM

routing

tc@Core1:~$ traceroute 172.16.0.1
traceroute to 172.16.0.1 (172.16.0.1), 30 hops max, 38 byte packets
1traceroute: sendto: Network is unreachable
tc@Core1:~$

tc@Core1:~$ ping 172.16.0.1
PING 172.16.0.1 (172.16.0.1): 56 data bytes
ping: sendto: Network is unreachable
tc@Core1:~$

tc@Core1:~$ ip route get 172.16.0.1
RTNETLINK answers: Network is unreachable
tc@Core1:~$

tc@Core1:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.0.0.0 U 0 0 0 eth1
127.0.0.1 * 255.255.255.255 UH 0 0 0 lo
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
tc@Core1:~$

2. Since there is no route to 172.16.0.1, add it with the following command

FORMAT: route add –net gw

EXAMPLE: route add -net 172.16.0.0/24 gw 10.0.0.2

tc@Core1:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.0.0.0 U 0 0 0 eth1
127.0.0.1 * 255.255.255.255 UH 0 0 0 lo
172.16.0.0 10.0.0.2 255.255.255.0 UG 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
tc@Core1:~$

4. Verify with ping/traceroute/ip route get command

tc@Core1:~$ ip route get 172.16.0.1
172.16.0.1 via 10.0.0.2 dev eth1 src 10.0.0.1
cache
tc@Core1:~$

Источник

Оцените статью
Adblock
detector