Network fail on FreeBSD: Ping to router fails, but router believes computer is connected

dhcpethernetfreebsdnetworkingwifi

I have a TP-Link TL-WN851N wireless adapter, which is based on an Atheros device. When I attempt to connect to my WPA2 wireless network, ifconfig wlan0 tells me that the connection is 'associated'. My computer also shows up as connected in the list on the router. However, I can not ping anything, even the router itself.

On the same system, running Linux, there are no connection problems, and running Windows, there are occasional dropped connections, but no failure to reconnect. DHCP is noticeably slow on both of these however.

After doing some debugging with people on the #freebsd channel on Freenode, I have found the following:

  • arp -an shows up no routes.
  • If I attempt to get an IP address from DHCP, it fails. On the FreeBSD system, it shows DHCPDISCOVER, then gives an error about no DHCPOFFER. According to my router's web interface, it believes it has given the computer an IP address after this.

Best Answer

This indicates that the wifi connection is successful (you have attached a virtual cable between your computer and your router) but that the TCP/IP layer does not get configured correctly.

Unless explicitly configured otherwise the typical home scenario is that your computer asks the router for a network configuration using DHCP, and that this somehow fails for you.

You can try explicitly configuring TCP/IP statically (remember DNS and gateway) and see if you can connect. If yes, you can start troubleshooting the DHCP server in the router (looking at logs or attaching a working computer with a network traffic analysis tool running), or just keep using a static address at home.

Related Question