# Netgear WG111v3 USB NIC DHCP problem



## spencer3096 (Jul 19, 2010)

I have hit a snag with configuring my Netgear WG11v3 USB NIC -- It won't use any other IP address except 0.0.0.0, regardless of whether or not I manually specify an address in /etc/rc.conf or try to use DHCP.

The configuration lines for the device in my rc.conf are:

```
wlans_urtw0="wlan0"
ifconfig_wlan0="ssid qwest5824-spencer DHCP"
```
I've tried using dhclient with the following output:

```
# dhclient wlan0
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 2
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
```

My ifconfig output also remains the same before and after:

```
# ifconfig
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
	ether 6c:f0:49:75:01:70
	inet 192.168.0.66 netmask 0xffffff00 broadcast 255.255.255.255
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
fwe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:37:18:6c:f0:49
	ch 1 dma -1
fwip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	lladdr 0.37.18.f8.0.6c.f0.49.a.2.ff.fe.0.0.0.0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000 
urtw0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether c0:3f:0e:3a:70:ac
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
	status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether c0:3f:0e:3a:70:ac
	inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
	media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
	status: associated
	ssid qwest5824-spencer channel 3 (2422 Mhz 11g) bssid 00:21:1e:4c:1e:a0
	country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
	bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
	protmode CTS
```
I am currently running 8.0-RELEASE amd64 with a slightly customized GENERIC kernel.
Any suggestions would be greatly appreciated.  Thank you for your consideration.


----------



## SirDice (Jul 19, 2010)

Try running `# tcpdump -ni wlan0 port 67 or port 68` in one terminal and fire off dhclient on the other. You should see the router respond. If you get responses that seem to have missing bytes, replace your router. Netgears seem to have a bug in the DHCP service and it breaks after a few hours.


----------



## spencer3096 (Jul 20, 2010)

I'm seeing the requests go out, but the router doesn't seem to respond back.

```
# tcpdump -ni wlan0 port 67 or port 68
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 96 bytes
22:08:30.350819 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
22:08:34.353754 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
22:08:45.356719 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
22:08:53.359732 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
22:09:00.362617 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
22:09:08.365635 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
22:09:18.369333 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
22:12:11.331163 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300
```
The output from dhclient was the same as before; I also tried running tcpdump with a higher verbosity (-vv), with the output looking like so:

```
22:09:18.369333 IP (tos 0x10, ttl 16, id 0, offset 0, flags [none], proto UDP (17), length 328)
    0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from c0:3f:0e:3a:70:ac, length 300, xid 0x4903218a, secs 48, Flags [none] (0x0000)
	  Client-Ethernet-Address c0:3f:0e:3a:70:ac [|bootp]
```
I think that I might try setting up a static route to my DSL router.  Thank you for your time.


----------



## SirDice (Jul 20, 2010)

Are you sure you are connected to the correct router? 

Make sure it's configured correctly, use WPA2-EAP for encryption and set a proper long key.


----------



## spencer3096 (Jul 30, 2010)

*[solved]*

I think that I've isolated the problem: the urtw driver only supported up to Netgear WG111v2 devices in 8.0-RELEASE -- mine is a v3.  Upgrading to 8.1-RELEASE seems to have fixed the issue since v3 is now supported.  I was attempting to connect to the correct router (both the ssid and bssid matched), but it wasn't responding back with any data.


----------



## larrypatrickmaloney (Jul 26, 2011)

*Works great!*



			
				SirDice said:
			
		

> Are you sure you are connected to the correct router?
> 
> Make sure it's configured correctly, use WPA2-EAP for encryption and set a proper long key.




OMG, thank you SOOO much SirDice!  I have had this problem for three years with my D-link router, and it's driven me crazy.  I'll use FreeBSD just fine outside of the house, but at home with my wlan0 interface and FreeBSD 8, I have a hell of a time getting dhclient to get the IP address, and connectivity is slow.

I just changed my ap from WPA2 Auto to WPA2 EAS, and WOW, what a huge difference.  dhclient instantly works, everytime,AND my net performance is like 3x faster!  SO AWESOME!


----------

