# Network almost setup, just a few problems.



## ikreos (Mar 12, 2011)

Hello everyone. Known about FreeBSD for years (still have a copy of 4.1 somewhere). Wanting to migrate from linux because its just getting ridiculous anymore. This will be a bit long winded so I thank you in advance for taking the time to read.

Well after much handbook reading and forum hopping, I almost have my network setup. I have PC-BSD on a secondary drive in my system to test it out before committing to my main drive. My wireless NIC is not directly supported so I had to resort to ndisgen. After much tinkering I got my RTL8185 chipset working. I have however run into a few minor(?) problems. The graphical network manager was no help at all to me, so I had to resort to manually configuring.

My lan is setup with an ADSL router/modem with a wireless router connected to it. Routing is turned off on the wireless router, it is only an access point for the router/modem. The router/modem is set up to allow 5 clients to connect via DHCP but I have setup all machines on the lan to have static IPs. The router/modem has the DNS IPs (OpenDNS) configured into it so it becomes my nameserver on my lan.

modem/router ip:    192.168.2.1
wireless router ip: 192.168.2.50

1) System is set up to load ndis, if_ndis, and rtl8185 modules during boot. They do load as kldstat shows but the interfaces do not appear. Manually unloading and loading the rtl8185 module creates and initializes the device.

I have added these lines to my /boot/loader.conf:

```
ndis_load="YES"
if_ndis_load="YES"
rtl8185_load="YES"
```

2) System can connect to wlan and can ping all machines connected to it. ping(ing) machines outside the lan i.e. google.com results in a "no route to host" error. Names are being resolved. Essentially I cannot connect to the 'internet'. I believe this is a routing issue but I am not sure how to resolve this issue.

My routing table from netstat -r:

```
Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
10.1.1.1           link#5             UH          0        2    lo1
localhost          link#2             UH          0        6    lo0
192.168.2.0        link#7             U           1       17  wlan0
192.168.2.41       link#7             UHS         0        0    lo0
```

3) Only happened while trying to set everything up but when it loses its connection to the wireless router due to bad signal or what have you it goes into an endless authentication loop. It tries to authenticate but continually times out. Not too sure about this one as it did not happen often.

ifconfig output for the relevant device:

```
ndis0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether xx:xx:xx:xx:xx:xx
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether xx:xx:xx:xx:xx:xx
        inet 192.168.2.41 netmask 0xffffff00 broadcast 192.168.2.255
        media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g
        status: associated
        ssid <ssid> channel 6 (2437 MHz 11g) bssid xx:xx:xx:xx:xx:xx
        country US authmode WPA privacy OFF txpower 0 bmiss 7 mcastrate 0
        mgmtrate 0 scanvalid 60 protmode CTS roaming MANUAL
```

rc.conf network seciton:

```
NIC="ndis"
gateway_enable="YES"
hostname="<system name>.localhost"
wlans_ndis0="wlan0"
ifconfig_wlan0="inet 192.168.2.41 netmask 255.255.255.0 ssid <ssid> WPA"
defaultrouter="192.168.2.1"
```

wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

network={
 ssid="<ssid>"
 priority=145
 scan_ssid=1
 key_mgmt=WPA-PSK
 psk="<wpa key>"
}
```

and my resolv.conf

```
nameserver 192.168.2.1
```

Thank you for taking the time to read this!


----------



## ikreos (Mar 12, 2011)

Oops forgot to mention I'm using 8.2.


----------



## wblock@ (Mar 12, 2011)

If urtw(4) will work with that card, it's probably better than NDIS.

The "NIC" in your rc.conf isn't doing anything.

Don't know why there's no default route in the netstat output when you set one in rc.conf.  Can set it manually with `# route add default 192.168.2.1`

DHCP is convenient.  If you want a fixed IP, set the DHCP server in the access point to hand that out based on MAC address.

All you should need in wpa_supplicant.conf is your ssid and psk.  "scan_ssid=1" made me rant about "hidden" ssids in another thread here recently.


----------



## ikreos (Mar 12, 2011)

wblock said:
			
		

> If urtw(4) will work with that card, it's probably better than NDIS.



As far as I have read my chipset RTL8185 is not supported. It was also not autodetected.



			
				wblock said:
			
		

> The "NIC" in your rc.conf isn't doing anything.



I assumed as much after I tried it. I just never removed it.



			
				wblock said:
			
		

> Don't know why there's no default route in the netstat output when you set one in rc.conf.  Can set it manually with `# route add default 192.168.2.1`



I did add it manually with route, but it told me it was already there.



			
				wblock said:
			
		

> DHCP is convenient.  If you want a fixed IP, set the DHCP server in the access point to hand that out based on MAC address.



Never thought of doing that, but the modem is configured for DHCP. The wireless router is only there to give access to the modem for wireless clients.



			
				wblock said:
			
		

> All you should need in wpa_supplicant.conf is your ssid and psk.  "scan_ssid=1" made me rant about "hidden" ssids in another thread here recently.



That was left over from the network manager I just never removed it (will be though).


----------



## ikreos (Mar 12, 2011)

Since I can't edit posts. I found out my neither my modem or router have the 'static DHCP' ability. However I can flash DD-WRT onto it. So I will be looking into that. I haven't had the chance to tinker with my BSD install yet. I will try the urtw driver. I'm going to try clearing my routes and redoing them.


----------



## ikreos (Mar 12, 2011)

Update. I'm connected to the internet on my BSD install now. I had to manually add the default route. Which is weird because last time I tried it told me it was already there. Anyway the urtw driver only supports usb devices, I'm using a PCI card. Probably should have stated that. Ah well my problem should be solved now. Now I just have to look into DD-WRT for my router. How do I set this thread as solved?


----------



## wblock@ (Mar 12, 2011)

After you have ten posts, you can edit, including setting the title to "solved".

DD-WRT is very good.  The layout is always confusing to me, but that might just be because it doesn't need to be changed very often.  It can do static DHCP leases, I just checked.


----------



## ikreos (Mar 12, 2011)

Yes that is the reason I didn't know about 'static DHCP', my router doesn't have it (I'm not an expert in networking I just know enough to get by). But Now that I know I'm going to use it once I attempt to flash DD-WRT. Hopefully Murphy keeps his law out of my attempt.


----------



## ikreos (Apr 11, 2011)

Final update. DD-WRT successfully flashed to my router (very nice piece of software). Went ahead and bought an Atheros based wifi card just to save myself the trouble. I would prefer to use a wired connection but currently my connectivity is no where near my computer. Oh and I scrapped PC-BSD in favor of FreeBSD with a light window manager. Much better than KDE4 bloat.


----------

