# How to connect to wireless SSID without password?



## freeink (Dec 17, 2019)

Such as “Starbucks” without password authentication.

Need edit  /etc/wpa_supplicant.conf ?


----------



## SirDice (Dec 17, 2019)

Handbook: 31.3. Wireless Networking


----------



## Phishfry (Dec 17, 2019)

Checkout section labeled Open Networks





						how to use wpa supplicant
					






					wiki.netbsd.org
				




You could also edit /etc/rc.conf and remove WPA from ifconfig line.
ifconfig_wlan0="DHCP"

A third option is to use a connection manager like net-mgmt/networkmgr

Please be advised that this is a security issue not using any wireless encryption.
You are at the mercy of the host network.


----------



## Deleted member 30996 (Dec 17, 2019)

Phishfry said:


> Please be advised that this is a security issue not using any wireless encryption.
> You are at the mercy of the host network.



And anyone sniffing it. I wouldn't log into anywhere that needed a password.


----------



## scottro (Dec 17, 2019)

I have a page that's a quick start to FreeBSD wireless.  http://srobb.net/fbsdquickwireless.html
It's in the section connecting to an open network


----------



## SirDice (Dec 18, 2019)

Trihexagonal said:


> And anyone sniffing it. I wouldn't log into anywhere that needed a password.


That's one of the reasons why those secure VPN services are so popular. Apart from having to trust that VPN provider, it's a good idea to use some form of VPN on these 'dodgy' open wireless networks. If you don't trust any of the commercial VPN providers you could setup your own VPN service on a hosted server and use that to protect your data from any prying eyes.


----------



## freeink (Dec 23, 2019)

Thanks Phishfry!

sysrc  ifconfig_wlan0="SYNCDHCP"  will add a code line?

What is the difference between  "DHCP"  and  "SYNCDHCP"?


----------



## Phishfry (Dec 23, 2019)

freeink said:


> What is the difference between "DHCP" and "SYNCDHCP"?











						Wireless setup and SYNCDHCP
					

Hi.  For years I have been using a special wireless startup script.  It doesn't bother me, and I never considered it an inconvenience.  Recently, a friend indicated that FreeBSD might be interesting, and I set about to create a completely setup-transparent WiFi access netbook computer.  Finally...




					forums.freebsd.org
				






freeink said:


> sysrc ifconfig_wlan0="SYNCDHCP" will add a code line?


Yes but use the append option for sysrc(8)
`sysrc ifconfig_wlan0+="SYNCDHCP"`
This makes sure that there is only one instance of ifconfig_wlan and appends the variable.


----------



## freeink (Dec 23, 2019)

Thanks following up, if two line code conflict, I guess system will choose the final ifconfig code at the bottom.


----------



## Phishfry (Dec 23, 2019)

I appended my answer for correctness. Notice the plus sign proceeding the equal sign.


----------



## Phishfry (Dec 23, 2019)

In my setting I only use ="DHCP".
I use Xorg with my laptops and the delay of bringing up Xfce gives enough time for the interface to get a lease.
If working from only the command line I could see the use of ="SYNCDHCP".
Xfce loading gives enough delay for my network, I would prefer a speedy startup instead of waiting for the DHCP lease then starting Xfce.
So it depends on your personal preferences and use pattern.


----------



## freeink (Dec 23, 2019)

Then I  use sysrc ifconfig_wlan0+="DHCP" for a fast startup at Starbucks and Airport.

At home I have two wireless routers two WPA protected SSID,
Do you have any quick switch command between different WPA SSIDs ,  switch from "WPA network A"  to  "WPA network B"


----------



## freeink (Dec 23, 2019)

Swtich between WPA SSIDs I will try this
Create a second file : wpa_supplicant2.conf
wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant2.conf

that will show associated but can not connect why?


----------



## freeink (Dec 23, 2019)

network={
         ssid="wifi_name1"
         psk="wifi_key1"
}



and

network={
         ssid="wifi_name2"
         psk="wifi_key2"
}



wpa_supplicant -B -i wlan0 -c <(wpa_passphrase MYSSID passphrase)


----------



## Phishfry (Dec 23, 2019)

Instead of using multiple wpa_supplicant.conf files you add all your networks to the one file:


```
network={
ssid="HOME1"
scan_ssid=1
psk="HOME1_PASS"
key_mgmt=WPA-PSK
}


network={
ssid="HOME2"
scan_ssid=1
psk="HOME2_PASSWORD"
key_mgmt=WPA-PSK
}

network={
        ssid="STARBUCKS"
        scan_ssid=1
        key_mgmt=NONE
}
```

Then you can use `wpa_cli` to switch between networks.
`wpa_cli list_networks`
`wpa_cli -i wlan0 select_network 2`


----------



## freeink (Dec 23, 2019)

wpa_cli list_networks
Failed to connect to non-global ctrl_ifname: (nil)  error: No error: 0


----------



## freeink (Dec 23, 2019)

wpa_supplicant  -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf

Which position should I put  -s and -f   option ? I want to see the debug file or syslog

-s = log output to syslog instead of stdout
*-f* Log output to debug file instead of stdout.


----------



## Phishfry (Dec 24, 2019)

freeink said:


> wpa_cli list_networks
> Failed to connect to non-global ctrl_ifname: (nil) error: No error: 0


Try it with the interface:
`wpa_cli -i wlan0 list_networks`
It will give you a numbered list of networks from your /etc/wpa_supplicant.conf.
Use the number of your desired netwok with select_network directive.


----------

