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