DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 17th June 2021
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default Problem connecting to public wifi

There is a coffee shop a few blocks from where I live which offers free wifi to customers. I was there today for 2 hours and couldn't manage to connect.

I edited /etc/hostname.iwn0"
join coffeeshop wpakey password

no good.

I tried:
ifconfig iwn0 down
pkill dhclient
sh /etc/netstart

no good.

Sometimes I would get "no link" Sometimes "no link no lease" Several times I got "got link...lease accepted" but still couldn't ping anywhere.

If anyone can point me to where I should look I'd appreciate it.

Thanks
Reply With Quote
  #2   (View Single Post)  
Old 17th June 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,164
Default

I hardly ever use wireless, but with an USB wireless adapter I can manually connect/debug/configure it ....
Maybe you can try this approach first, before you do a hostname.if setup.

Code:
# ifconfig
[snip]

pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
        index 6 priority 0 llprio 3
        groups: pflog
urtwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        lladdr d0:37:45:65:36:6e
        index 9 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect
        status: no network
        ieee80211: nwid ""
Notice that the USB wireless interface urtwn0 is not UP and RUNNING.

Code:
# ifconfig urtwn0 up ; ifconfig urtwn0

urtwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr d0:37:45:65:36:6e
        index 9 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect (DS1)
        status: no network
        ieee80211: nwid ""
Scan for networks:
Code:
ifconfig urtwn0 scan

urtwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr d0:37:45:65:36:6e
        index 9 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect (DS1 mode 11g)
        status: no network
        ieee80211: nwid ""
                nwid H369A8E0054 chan 9 bssid 34:da:b7:8e:00:54 -44dBm HT-MCS23 privacy,short_slottime,ra
dio_measurement,wpa2
                nwid SitecomD72D8C chan 8 bssid 00:0c:f6:d7:2d:8c -52dBm HT-MCS15 privacy,short_preamble,
short_slottime,wpa2
                nwid TP-LINK_32E2 chan 1 bssid 48:8d:36:39:3b:a8 -72dBm HT-MCS15 privacy,short_slottime,r
adio_measurement,wpa2
         [snip]
Choosing our Sitecom with wpa2 ....
Code:
# ifconfig urtwn0 nwid SitecomD72D8C wpaprotos wpa2
# ifconfig urtwn0

urtwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr d0:37:45:65:36:6e
        index 9 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect (DS1)
        status: no network
        ieee80211: nwid SitecomD72D8C
Specifying my wpakey (instead of join I probably should have used nwid) :
Code:
# ifconfig urtwn0 join SitecomD72D8C wpakey "mysecretwpakey"
# ifconfig urtwn0

urtwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr d0:37:45:65:36:6e
        index 9 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect (DS1 mode 11g)
        status: active
        ieee80211: join SitecomD72D8C chan 8 bssid 00:0c:f6:d7:2d:8c -52dBm wpakey wpaprotos wpa2 wpaakms
 psk wpaciphers ccmp wpagroupcipher ccmp
Running dhclient ...
Code:
# dhclient urtwn0
urtwn0: 192.168.0.102 lease accepted from 192.168.0.1 (00:0c:f6:d7:2d:8c)

# ifconfig urtwn0
urtwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr d0:37:45:65:36:6e
        index 9 priority 4 llprio 3
        groups: wlan egress
        media: IEEE802.11 autoselect (DS2 mode 11g)
        status: active
        ieee80211: join SitecomD72D8C chan 8 bssid 00:0c:f6:d7:2d:8c -56dBm wpakey wpaprotos wpa2 wpaakms
 psk wpaciphers ccmp wpagroupcipher ccmp
        inet 192.168.0.102 netmask 0xffffff00 broadcast 192.168.0.255
Code:
root@ml310e[~]netstat -rn -f inet
Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
default            192.168.0.1        UGS        2        5     -    12 urtwn0
default            192.168.222.10     GS         3     3959     -     8 bge0
224/4              127.0.0.1          URS        0      430 32768     8 lo0
10.17.89/24        10.17.89.15        UCn        0        0     -     4 wg4
10.17.89.15        wg4                UHl        0        0     -     1 wg4
10.17.89.255       10.17.89.15        UHb        0        0     -     1 wg4
127/8              127.0.0.1          UGRS       0        0 32768     8 lo0
127.0.0.1          127.0.0.1          UHhl       1        7 32768     1 lo0
192.168.0/24       192.168.0.102      UCn        1        0     -     8 urtwn0
192.168.0.1        00:0c:f6:d7:2d:8c  UHLch      1        5     -     7 urtwn0
192.168.0.102      d0:37:45:65:36:6e  UHLl       0        7     -     1 urtwn0
192.168.0.255      192.168.0.102      UHb        0        0     -     1 urtwn0
192.168.222/24     192.168.222.242    Cn         1        0     -     4 bge0
192.168.222.10     link#1             HLch       2       25     -     3 bge0
192.168.222.242    a0:1d:48:97:5b:74  UHLl       0     1059     -     1 bge0
192.168.222.255    192.168.222.242    Hb         0        0     -     1 bge0
Then I unplugged my wired ethernet (bge0) and could do a DNS query using the Google 8.8.8.8 nameserver:
Code:
root@ml310e[~]dig www.openbsd.org @8.8.8.8

; <<>> dig 9.10.8-P1 <<>> www.openbsd.org @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63170
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.openbsd.org.               IN      A

;; ANSWER SECTION:
www.openbsd.org.        21599   IN      A       129.128.5.194

;; Query time: 24 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Jun 18 00:55:49 CEST 2021
;; MSG SIZE  rcvd: 60
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 18th June 2021 at 04:19 AM. Reason: Cleaning up ....
Reply With Quote
  #3   (View Single Post)  
Old 18th June 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,164
Default

You also can find info about incoming (Ipkts) or outgoing packets (Opkts) and/or their failures/collisions with netstat:
Code:
$ netstat -in

Name    Mtu   Network     Address              Ipkts Ifail    Opkts Ofail Colls
lo0     32768 <Link>                             132     0      132     0     0
lo0     32768 ::1/128     ::1                    132     0      132     0     0
lo0     32768 fe80::%lo0/ fe80::1%lo0            132     0      132     0     0
lo0     32768 127/8       127.0.0.1              132     0      132     0     0
bge0    1500  <Link>      a0:1d:48:97:5b:74   105930     0    50484   156     0
bge0    1500  192.168.222 192.168.222.242     105930     0    50484   156     0
bge1*   1500  <Link>      a0:1d:48:97:5b:75        0     0        0     0     0
[snip]
pflog0  33136 <Link>                               0     0        0     0     0
urtwn0  1500  <Link>      d0:37:45:65:36:6e    12274  1420     9253     0     0
urtwn0  1500  192.168.0/2 192.168.0.102        12274  1420     9253     0     0
The percentage of the failed input packets is 11.56:
Code:
$ echo 'scale=2 ; 1420 / 122.74' | bc  
11.56
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 18th June 2021 at 12:41 AM.
Reply With Quote
  #4   (View Single Post)  
Old 18th June 2021
jmccue jmccue is offline
Real Name: John McCue
Package Pilot
 
Join Date: Aug 2012
Location: here
Posts: 187
Default

A few suggestions:

Does the coffee shop require you to sign into a WEB application first (via firefox) ? Many around where I am does except for one.

Maybe try a library (as in where books are) to see if you can get it going.

Something dumb to try, I thought at one time, if I did not use quotes, I would have issues.
Code:
join "coffeeshop" wpakey "password"
Could not hurt.

Also in one place I need to append "mode 11g" to the line (no quotes). Check the manual and try "mode".

Last edited by jmccue; 19th June 2021 at 11:59 AM. Reason: adjusted
Reply With Quote
  #5   (View Single Post)  
Old 18th June 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,164
Default

You also could check in the man page of the wireless adapter, whether you need to load firmware. In my case, in a snapshot dated Apr 15 14:05:19 MDT 2021, I made sure I had the latest firmware for my urtwn adapter with:

Code:
# fw_update
urtwn-firmware-20180103p0: ok
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #6   (View Single Post)  
Old 18th June 2021
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

I went back to the coffe shop today and tried again going thru j65nko's suggestions. No good. I get link...lease accepted but still can't ping anything. I will try again tomorrow with the other suggestions offered by jmmcue and see what happens.
Thank you to both j65nko and jmccue for taking time with this.
Reply With Quote
  #7   (View Single Post)  
Old 18th June 2021
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,164
Default

We can only help you further if you paste the output of the ifconfig, netstat netstat -rn -f inet and netstat -in commands in a file and post that here.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 19th June 2021
jmccue jmccue is offline
Real Name: John McCue
Package Pilot
 
Join Date: Aug 2012
Location: here
Posts: 187
Default

Quote:
Originally Posted by stanl View Post
I get link...lease accepted but still can't ping anything.
This indicates that you are connected to the shop's network, but you are not signed in. Once connected, start firefox, ensuring javascript is active.

You should be presented with a WEB site asking you to accept terms & conditions in order to connect to the "outside".

John
Reply With Quote
  #9   (View Single Post)  
Old 19th June 2021
stanl stanl is offline
Real Name: Stan
Package Pilot
 
Join Date: Jun 2019
Location: New York
Posts: 163
Default

First, my thanks once again to j65nko and jmmcue for taking the time to advise me on this issue.

I tried jmmcue's suggestion to open firefox after getting "got link...lease acepted". Problem was firefox refused to open as did chrome. Dillo howver did open but when I tried to go to a website I got "DNS resolving host..." and it just sat there.

I may not know much but I figured this indicated my problem was with dns so I made a few changes. Not sure if all were necessary but now at least things are working and I can use the coffee shop's wifi when I want:

Edited /etc/dhclient which used to read:
Code:
ignore domain-name, domain-name-servers, domain-search;
to read:
Code:
#ignore domain-name, domain-name-servers, domain-search;
supersede domain-name-servers 1.1.1.1;
supersede domain-name-servers 1.0.0.1;
Edited /etc/resolv.conf which used to read
Code:
# Generated by iwn0 dhclient
nameserver 209.18.47.62
nameserver 209.18.47.61
lookup file bind
and now reads:
Code:
# Generated by iwn0 dhclient
search fios-router.home.
nameserver 1.0.0.1
lookup file bind

Last edited by J65nko; 19th June 2021 at 10:57 PM. Reason: Added [code] and [file] tags
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pf public wifi configuration for a laptop sunfish117 OpenBSD Security 4 1st March 2021 12:12 PM
Shell script I wrote for connecting to wifi bceverly OpenBSD General 0 6th April 2016 05:45 PM
Connecting to internet PapaParrot OpenBSD General 7 29th July 2015 01:58 AM
Public WiFi and accept screens phyro OpenBSD Installation and Upgrading 10 10th January 2013 09:36 PM
OS to run in a public computer? Sunnz Off-Topic 31 23rd May 2008 05:47 PM


All times are GMT. The time now is 11:53 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick