Results 1 to 2 of 2

Thread: Kali Rolling - DHCP stopped working?

  1. #1
    Join Date
    2015-Aug
    Posts
    19

    Kali Rolling - DHCP stopped working?

    I have been having an issue for a few days now and I think it comes down to the fact that my DHCP stopped working properly. Everything seems fine until I take down the interface (ifconfig wlan0 down) and then bring it back up (ifconfig wlan0 up). Up until last week, there was no issue for me, but now upon bringing the interface back up, I do not get a default gateway, therefore I can not get out to the net unless I enter the default gateway manually. This NEVER had to be done until last week when this started happening. I have reproduced this on Kali via Virtual Box, on a dual boot machine, on multiple networks, and on a freshly downloaded ISO which I installed to Virtual Box.

    Can anyone help me get DHCP working right again?


    Here is what it looks like:

    root@kali:~# route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 10.0.1.1 0.0.0.0 UG 0 0 0 wlan0
    10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

    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=51 time=18.0 ms
    64 bytes from 8.8.8.8: icmp_seq=2 ttl=51 time=1036 ms
    64 bytes from 8.8.8.8: icmp_seq=3 ttl=51 time=30.1 ms
    ^C
    --- 8.8.8.8 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2013ms
    rtt min/avg/max/mdev = 18.017/361.469/1036.212/477.141 ms, pipe 2

    root@kali:~# ifconfig wlan0 down

    root@kali:~# ifconfig wlan0 up

    root@kali:~# ping 8.8.8.8
    connect: Network is unreachable

    root@kali:~# route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

    root@kali:~# route add default gw 10.0.1.1

    root@kali:~# route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 10.0.1.1 0.0.0.0 UG 0 0 0 wlan0
    10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

    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=51 time=1015 ms
    64 bytes from 8.8.8.8: icmp_seq=2 ttl=51 time=22.2 ms
    ^C
    --- 8.8.8.8 ping statistics ---
    2 packets transmitted, 2 received, 0% packet loss, time 999ms
    rtt min/avg/max/mdev = 22.242/518.795/1015.348/496.553 ms, pipe 2

  2. #2
    Join Date
    2015-Aug
    Posts
    19
    UPDATE: and the closest thing I have to a solution!

    Kali closed my bug report with the following message:

    "If you cut the network connection, then you have to reconfigure it the next time
    you bring it up. That's nothing new really. Maybe you were using DHCP before?
    In any case it's not a bug."

    Ok, great. I get that. And yes, I must have been using DHCP before, and for some reason this is no longer the case. But why? What happened and how can I changed it back and use DHCP again?

    So here is what I came up with. I am using an example of a macchanger script. It was originally only the first 3 commands, but I added a 4th due to this issue, and it seems to work:

    #!/bin/bash

    ifconfig wlan0 down

    macchanger -r wlan0

    ifconfig wlan0 up

    dhclient wlan0

    So this will work for now, I hope, but it would be great to know what went wrong and how to put it back.

Similar Threads

  1. xrdp stopped working
    By alg in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2017-01-19, 22:15
  2. Replies: 2
    Last Post: 2016-06-23, 13:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •