# how to automate wireless connection



## pnguine (Apr 2, 2010)

Hi all

I have finally managed to get my wireless connection going on my Toshiba Satellite 1800. I issued 
	
	



```
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
```
 and 
	
	



```
dhclient ath0
```
 from the cl in a terminal after setting up the wpa_supplicant.conf file following the wireless section in the handbook and other sources on the web. (I left the first terminal open because I didn't background the process and didn't want to take a chance on killing it, then ran the dhclient command in another term.)

My question is where do I put these lines so that they get run at boot time so the connection will come up automatically?


----------



## expl (Apr 2, 2010)

add to rc.conf


```
ifconfig_wlan0="WPA DHCP"
```

Then /etc/rc.d/netif startup script will start wpa_supplicant and dhclient for you at every bootup.


----------



## pnguine (Apr 2, 2010)

Thanks. I've done that but haven't rebooted since (thought I'd let it run for a while before I lost it again). Other resources also suggested putting 
	
	



```
wlans_ath0="wlan0"
```
 in rc.conf. Is that still necessary? And somewhere along the way I ran this: 
	
	



```
ifconfig wlan0 create wlandev ath0
```
 Do I need to do that somewhere? I tried so many different things I don't know if that had anything to do with getting it working.


----------



## pnguine (Apr 2, 2010)

Looks OK. Had to reboot to try a new X config on the Satellite and the wireless came up perfectly. I'm now getting xorg with pkg_add (nearly typed apt_get ).


----------

