Kali Network Debugging
Note: These notes cover Kali version 1 and are out of date.
After booting into Kali v 1, I had no ability to reach the internet.
$ ping google.com ping: unknown host: google.com
I was sitting on a small network on a wireless router, with another installation of Kali Linux also on the network and able to get out to the internet. So, the problem was with the laptop running Kali Linux.
First thing to check is the IP address.
- 1 IP Address
- 2 Gateway
- 3 DNS
- 4 Connection
- 5 Digging Deeper
- 6 The Clues
- 7 The Solution
I could see my ip address with
and I could type 10.0.0.1 into a browser and connect to my router. But I couldn't get past the router. I tried resetting the eth0 network interface:
$ ifconfig eth0 down $ ifconfig eth0 up
No such luck. Still couldn't reach the outside.
$ ping -c 4 google.com ping: could not reach host: google.com
Also tried restarting the network manager service:
$ service network-manager restart
But no luck there.
I tried using dhclient to obtain a new IP address for eth0:
dhclient -v eth0
but this simply acquired a new IP address from the router that was the same as the old IP address.
Still no luck.
The next thing to check was the gateway. Since I could reach my router, which is my gateway, I figured this was okay, but checked anyway.
I used route to check the current routing path:
$ route -n
This showed that my gateway was 10.0.0.1, and my subnet was 255.255.255.0, as expected.
Nothing to see here.
I suspected that the problem with reaching the host had something to do with DNS. The resolvconf file, in
/etc/resolv.conf, lists a couple of
nameserver entries. If an IP address is listed as a nameserver, it means that server is providing you with DNS information. Because ping was returning "unknown host", I suspected this was due to a DNS error.
In the resolvconf file were some nameservers added automatically by the network manager:
nameserver 126.96.36.199 nameserver 188.8.131.52
Okay, these seem fine. But they don't work.
I tried a couple of other pairs:
OpenDNS: 184.108.40.206 and 220.127.116.11
Google: 18.104.22.168 and 22.214.171.124
None of these led to any changes.
Just in case, I checked /etc/hosts for anything unusual, but all I saw were the loopback interfaces for 127.0.0.1/localhost.
The next step, at this point in debugging, is to run ping to see if you can connect to anything. But that's exactly the problem...
If ping returns "unknown host" it indicates an issue with the DNS address.
If ping returns "destination host unreachable", you have a DNS route or gateway address issue.
So, at this point I was completely stumped.
I really didn't want to have to spend another 2-3 hours reinstalling Kali just because of some dumb network configuration that I had screwed up, so I kept digging...
Using Router for DNS
At this point, I knew I was dealing with a DNS issue - ping was returning "destination host unreachable," I couldn't reach Google.com, but I could reach any computer inside the network.
I also knew I was dealing with a DNS issue between my laptop and the router - since I knew that the DNS service worked fine for the other Kali Linux desktop running on the local network.
I started by forcing the DNS server to be the router itself:
$ echo "nameserver 10.0.0.1" > /etc/resolv.conf
Then I gave ping another try:
$ ping linux.org PING linux.org (126.96.36.199) 56(84) bytes of data.
At this point, we had SOME success - the router worked as a DNS server, and we were able to successfully turn a domain name (linux.org) into an IP address. But we still had a problem: ping wasn't actually returning anything. Everything was being dropped.
Network Dropping Everything
Okay, now the problem was that the network was dropping everything. I had no idea what was going on.
I rebooted into Mac OS X. I left the network cable plugged in. I got to the desktop, and opened a browser, and typed linux.org.
It said "Connecting to host..."
Wireless Network Not Dropping Everything
I pulled out the network cable and hit refresh - and there it was! Linux.org!
Something very fishy was going on with the ethernet wire I was using.
Changing Wired Cable and Port
At this point, I tried switching ethernet cables and ports with the Kali Linux desktop that I knew was working. This cable was guaranteed to work, this port was guaranteed to work.
I rebooted into Kali, and tried to ping google.com and linux.org.
Here are the clues we have:
- The problem is particular to the connection between my laptop and my router.
- (Wireless wasn't working in Kali.)
- Ethernet problems in Kali showed up in Mac, too (couldn't find a route to the host).
- Wireless works ok in Mac, so it isn't a problem with the laptop itself.
- Another computer on the network works, so it isn't a problem with the router itself.
With all of these clues, I determined that the problem was with THE MAC ADDRESS OF MY MAC LAPTOP'S WIRED PORT.
So anytime I tried to connect, FROM my laptop's wired network port, TO the router, using any cable or any port, the problem would arise.
I opened the router's configuration page in a browser at 10.0.0.1 and logged in.
I released the network address for my wired mac laptop connection (it was plugged into the network - remember, I could access 10.0.0.1 and the whole subnet just fine using the wired connection).
I refreshed the router configuration page.
I got a new IP address.
I opened a browser window and typed "Linux.org". Voila! Linux.org came up! The wired router connection now worked!
It just came down to some crud in the network cache.
Networkingpages and notes about computer networks.
Man in the Middle attack vectors on wired networks: Man in the Middle/Wired
Packet analysis with Wireshark: Packet Analysis
Linux networking: Linux/Networking
Using Aircrack: Aircrack
Many Ways to Crack a Wifi: Cracking Wifi
Notes on OpenVPN: OpenVPN
Setting Up a Static Key VPN: OpenVPN/Static Key
IP Version 6: IPv6
Flags · Template:NetworkingFlag · e
Kali Linux"The quieter you become, the more you are able to hear."
Penetration testing Linux distribution.
1 Physical Attacks: Kali/Layer 1 Attacks
2 Data/MAC Attacks: Kali/Layer 2 Attacks
3 Network Attacks: Kali/Layer 3 Attacks
4 Transport Attacks: Kali/Layer 4 Attacks
5 Session Attacks: Kali/Layer 5 Attacks
6 Presentation Attacks: Kali/Layer 6 Attacks
7 Application Attacks: Kali/Layer 7 Attacks
Kali on Raspberry Pi:
Flags · Template:KaliFlag · e