• [gentoo-user] Choose a wireless access point

    From William Kenworthy@21:1/5 to All on Mon Apr 4 07:40:02 2022
    Is there a way force openrc and wpa_supplicant to map a particular
    access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two
    wifi interfaces - unfortunately they are not equal so I want wlan0 to
    connect to only one particular AP, and wlan1 to the other ... reliably! 
    I can manually force it to connect but invariably at the first glitch
    they both end up connected to the same AP (usually the strongest which
    is often not what I want :(

    BillK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to William Kenworthy on Mon Apr 4 17:20:01 2022
    On 4/4/22 01:31, William Kenworthy wrote:
    Is there a way force openrc and wpa_supplicant to map a particular
    access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two
    wifi interfaces - unfortunately they are not equal so I want wlan0 to
    connect to only one particular AP, and wlan1 to the other ... reliably!
    I can manually force it to connect but invariably at the first glitch
    they both end up connected to the same AP (usually the strongest which
    is often not what I want :(

    BillK

    I don't know about wpa-supplicant, but I'm using open-rc and KDE, and
    KDE's systemsettings Network / Connections screen lets you restrict a
    network connection so a specific device.  Not sure if this helps you
    any, but it would indicate that what you want is possible.

    Jack

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Tue Apr 5 00:09:28 2022
    On Monday, 4 April 2022 16:12:53 BST Jack wrote:
    On 4/4/22 01:31, William Kenworthy wrote:
    Is there a way force openrc and wpa_supplicant to map a particular
    access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two
    wifi interfaces - unfortunately they are not equal so I want wlan0 to connect to only one particular AP, and wlan1 to the other ... reliably!
    I can manually force it to connect but invariably at the first glitch
    they both end up connected to the same AP (usually the strongest which
    is often not what I want :(

    BillK

    I don't know about wpa-supplicant, but I'm using open-rc and KDE, and
    KDE's systemsettings Network / Connections screen lets you restrict a
    network connection so a specific device. Not sure if this helps you
    any, but it would indicate that what you want is possible.

    Jack

    Look at the example provided in:

    /usr/share/doc/netifrc-0.7.3/net.example.bz2

    You can set a different ssid for each wireless NIC. The wpa_supplicant can be set with credentials for the two APs only.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmJLeqgACgkQseqq9sKV Zxmo4A/+Lt2uwXLEbAOMEqt9SbHVE7Ph0AJLDLT3v5wIkPMv/LKdkB7pCoYsalvA mDDLBXio/w04JHifizm7NFt/qzA6nRXBAGiBr5Naxyux6XPNrBBmTENI/DKgexHs 2ORwlhM7U4abrTf0QL8Rlfld4lne32bOXcYdn/heTDznwwJaAyceNFIiXo+4mvOS qouWApzf9hZw/75YBhsPpnokWgoSRBOYPHrKRs1unHKYuGdAbVdMZ7FJj7htYJ1F Mn5tI7JQghdDIXlJDi+T9gwnHE2kg0oxS979482RNCX74FKRDjZLp0PmqqFwcfQC oUrbAo8ETDzECc6hhnKefRq9smeBAS91pSfmV5rUMH9ZLPYBRpl6gv1hqWB3re6k 8yogq9lRhxVrMo9fw/MwD83zvjtBup8Iya9Mmb7H9K9zXhpJIeQUvk3O+txaHpRh dve0SfBcGz9qS3mcbnJOhtnEoxWmn+WAZvNVFEBIxgAJUdM7AokgHhATwB4QXYHQ lsdmz/JYcs3BwXdRAD3TXC3aMjUKWOkn8UEG8H9s0ArNbIHgssBfwlnrSiDbblOV F5N84/T9mcmn1y7wJza/Hi8UTiKYXfQwigEJq7tGhDBi4JHTGU0r49Cosmtmh86E p5YDV5bNT92pUEkMH3EVwztVW7Ey4Vlu1q7NOZ2UvRby1YwcjW8=
    =omxI
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Kenworthy@21:1/5 to Michael on Tue Apr 5 05:20:01 2022
    On 5/4/22 07:09, Michael wrote:
    On Monday, 4 April 2022 16:12:53 BST Jack wrote:
    On 4/4/22 01:31, William Kenworthy wrote:
    Is there a way force openrc and wpa_supplicant to map a particular
    access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two
    wifi interfaces - unfortunately they are not equal so I want wlan0 to
    connect to only one particular AP, and wlan1 to the other ... reliably!
    I can manually force it to connect but invariably at the first glitch
    they both end up connected to the same AP (usually the strongest which
    is often not what I want :(

    BillK
    I don't know about wpa-supplicant, but I'm using open-rc and KDE, and
    KDE's systemsettings Network / Connections screen lets you restrict a
    network connection so a specific device. Not sure if this helps you
    any, but it would indicate that what you want is possible.

    Jack
    Look at the example provided in:

    /usr/share/doc/netifrc-0.7.3/net.example.bz2

    You can set a different ssid for each wireless NIC. The wpa_supplicant can be
    set with credentials for the two APs only.

    Unfortunately, this does not work as I want ...wpa_supplicant's
    behaviour makes sense in that it provides a fallback if the allocated
    access point cant connect ... it will pick the next available one
    (seemingly based on signal strength) if it is in its conf file (and does
    not care that its another ssid) - so it does not fail.  As only one of
    the two networks has internet access the device often ends up not being
    able to be connected to (its headless so that's a problem!).

    I have fallen back to openrc for the main connection and will do the
    other manually - it would be nice to have everything properly controlled
    but its not working for me.

    BillK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From William Kenworthy@21:1/5 to Jack on Tue Apr 5 07:10:01 2022
    On 4/4/22 23:12, Jack wrote:
    On 4/4/22 01:31, William Kenworthy wrote:
    Is there a way force openrc and wpa_supplicant to map a particular
    access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two
    wifi interfaces - unfortunately they are not equal so I want wlan0 to
    connect to only one particular AP, and wlan1 to the other ... reliably!
    I can manually force it to connect but invariably at the first glitch
    they both end up connected to the same AP (usually the strongest which
    is often not what I want :(

    BillK

    I don't know about wpa-supplicant, but I'm using open-rc and KDE, and
    KDE's systemsettings Network / Connections screen lets you restrict a
    network connection so a specific device.  Not sure if this helps you
    any, but it would indicate that what you want is possible.

    Jack

    Hi Jack, unfortunately its a headless, wifi only system which is why
    getting openrc to behave is important!

    BillK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Tue Apr 5 09:05:39 2022
    On Tuesday, 5 April 2022 08:46:52 BST Neil Bothwick wrote:
    On Tue, 5 Apr 2022 11:16:10 +0800, William Kenworthy wrote:
    On 5/4/22 07:09, Michael wrote:
    On Monday, 4 April 2022 16:12:53 BST Jack wrote:
    On 4/4/22 01:31, William Kenworthy wrote:
    Is there a way force openrc and wpa_supplicant to map a particular
    access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two >>> wifi interfaces - unfortunately they are not equal so I want wlan0
    to connect to only one particular AP, and wlan1 to the other ...
    reliably! I can manually force it to connect but invariably at the
    first glitch they both end up connected to the same AP (usually the
    strongest which is often not what I want :(

    BillK

    I don't know about wpa-supplicant, but I'm using open-rc and KDE, and
    KDE's systemsettings Network / Connections screen lets you restrict a
    network connection so a specific device. Not sure if this helps you
    any, but it would indicate that what you want is possible.

    Jack

    Look at the example provided in:

    /usr/share/doc/netifrc-0.7.3/net.example.bz2

    You can set a different ssid for each wireless NIC. The
    wpa_supplicant can be set with credentials for the two APs only.

    Unfortunately, this does not work as I want ...wpa_supplicant's
    behaviour makes sense in that it provides a fallback if the allocated access point cant connect ... it will pick the next available one (seemingly based on signal strength) if it is in its conf file (and
    does not care that its another ssid) - so it does not fail. As only
    one of the two networks has internet access the device often ends up
    not being able to be connected to (its headless so that's a problem!).

    I have fallen back to openrc for the main connection and will do the
    other manually - it would be nice to have everything properly
    controlled but its not working for me.

    Could you run two instances of wpa_suplicant, each listening on a
    different interface and using a config with only the AP for that
    interface?

    As I recall wpa_cli can be launched by specifying a particular interface. Therefore two instances of wpa_cli launched by a script should be possible.

    However, isn't the purpose of /etc/conf.d/net to specify how individual interfaces are configured? I still think - but have not tried it - each wireless NIC can be configured via this file to use a particular access point/ channel and not go scanning for others, while the wpa_supplicant can be left
    to deal with the authentication mechanism after each NIC has found its specified ESSID.

    The section in the netifrc example file which starts as follows, merits reading:

    ###############################################
    # SETTINGS
    # Hard code an SSID to an interface - leave this unset if you wish the driver
    # to scan for available Access Points . . .

    Something like this ought to work:

    essid_wlan0="foo"

    essid_wlan1="bar"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmJL+FMACgkQseqq9sKV ZxkO7w/9EwE2AYYMg7U5hYFkrBWwSWztT6zZihu6SlCzoAByfZ1mspE+G42Xk3Tg 0upbOHIxpLjoBtweueI0vJ5QtAYPc6jZlXUjZSCHuj55ZrHLsV1URYqje5YH6SsA gtfF+et+Kez+pUrE+opl+yderW8L0eY+mPQhYJ03zgmr+iZnWVCJFkdywbEZJHhv h5YrDwlBo/RS4kNK5Z/tLPR3riuJif7lElh5l5WwuJy5KzJwCN8Z/8d0/hhSZCjh ThwtO63tCPVeUAh9KImljnaODgTqlZvxMKIuz8awM6gdWBUNETsczaM99KBdSZMM 8cIePqDBrOfUxDNjTO1glTAWQj+F/eoPsBpKngMZPYxCoERYnmawjJTlwxM5JjAx tQYCsSd5E6CSea9tZzzojQE166rRwkMqHFi26tuQSuUK40YqlnZtICLrjNAuam05 kmiCeIAFd36L9pVm85DrKfmkfPs9CvzhK0aw3gxY42THMJqEyAFUZS9b8r0NArN+ F7I9imy37/R4wnAh9x+8DRMLo3no/yGoMMKRDPZlo4ZOyVKYRj/OCa5NRCDLvI0m NVIMKf4CUz0SElZSlTvAGW75GJcdZ77ewPWyNIPXmasOU57+TXUT/93NC+Mp541N Ef4kYZAsNvAagTr2lgOUuiV5GXl9hSJe4nKFQRWdDUQSh7pvaKM=
    =C4Tj
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Neil Bothwick@21:1/5 to William Kenworthy on Tue Apr 5 09:50:01 2022
    On Tue, 5 Apr 2022 11:16:10 +0800, William Kenworthy wrote:

    On 5/4/22 07:09, Michael wrote:
    On Monday, 4 April 2022 16:12:53 BST Jack wrote:
    On 4/4/22 01:31, William Kenworthy wrote:
    Is there a way force openrc and wpa_supplicant to map a particular
    access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two
    wifi interfaces - unfortunately they are not equal so I want wlan0
    to connect to only one particular AP, and wlan1 to the other ...
    reliably! I can manually force it to connect but invariably at the
    first glitch they both end up connected to the same AP (usually the
    strongest which is often not what I want :(

    BillK
    I don't know about wpa-supplicant, but I'm using open-rc and KDE, and
    KDE's systemsettings Network / Connections screen lets you restrict a
    network connection so a specific device. Not sure if this helps you
    any, but it would indicate that what you want is possible.

    Jack
    Look at the example provided in:

    /usr/share/doc/netifrc-0.7.3/net.example.bz2

    You can set a different ssid for each wireless NIC. The
    wpa_supplicant can be set with credentials for the two APs only.

    Unfortunately, this does not work as I want ...wpa_supplicant's
    behaviour makes sense in that it provides a fallback if the allocated
    access point cant connect ... it will pick the next available one
    (seemingly based on signal strength) if it is in its conf file (and
    does not care that its another ssid) - so it does not fail.  As only
    one of the two networks has internet access the device often ends up
    not being able to be connected to (its headless so that's a problem!).

    I have fallen back to openrc for the main connection and will do the
    other manually - it would be nice to have everything properly
    controlled but its not working for me.

    Could you run two instances of wpa_suplicant, each listening on a
    different interface and using a config with only the AP for that
    interface?


    --
    Neil Bothwick

    Help a man when he is in trouble and he will remember you when he is in
    trouble again

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEE8k9T/rX16EJxEKG692eFu0QSMJgFAmJL8+wACgkQ92eFu0QS MJixwQ//e62k1a8aoyaMUzhllV9xp9o253PgQP434ogEm+darI2B1wjJW/Zgwtwr ZPC+M9uikPLhJOkUlGqTPP9NCyerFPZXED5MCKBUWiay+6TULZPMYS+c7JSxLI2+ tHi+8hzTIoYk2ogOFom0uzLuDeaei24ICcOedSNAcOWPExplg15tVdy5cBDLigJS YHYZRIrkE7SdedPoRnRRIcNOgPJnsD3QUAQU30JjQ0boq0YalKLLkyilpWLbjR+o FLTrzeNnHw06s9YW/89CslrSyy5DcNjdsR0cYHqoWUzkBKNs5X6noaFlOp3UCvOQ P/yImKCvxUFoVzUVO7CSPlIm2i5QTBew/d2qGGbmu38x9Hpw1BEyGJoH0WLvTfic ac0dscU9DlEfV2H4E91nrzcwzMmMG4E0qgAxavy9R4T03sTr9uYiOT1MmYs2XCTk 0a03dFzrEWfa5YUvGBm9UnI/E1tRcf4upI4NvWLpxg18MRbD8cWJciGXzu7uTUFY TvWoN0xQ2viV7ApQUeERfHQzfUZ+TFzdVsqrU9YkoE5GxwFcmaIOdDctYj34lzDN QL/6NMEOi4tSEtugTQS/4ZNMhtmLJrcI3VjP5EzIyfV8UMQ+ZUS21c2QB+0WrVs6 7EGu6Whlc6rbVvRaczvyf6JSiAA5j2RAnoFc3IunkdEn6Yv6lP0=
    =NFbR
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (2
  • From William Kenworthy@21:1/5 to Michael on Tue Apr 5 10:30:01 2022
    On 5/4/22 16:05, Michael wrote:
    On Tuesday, 5 April 2022 08:46:52 BST Neil Bothwick wrote:
    On Tue, 5 Apr 2022 11:16:10 +0800, William Kenworthy wrote:
    On 5/4/22 07:09, Michael wrote:
    On Monday, 4 April 2022 16:12:53 BST Jack wrote:
    On 4/4/22 01:31, William Kenworthy wrote:
    Is there a way force openrc and wpa_supplicant to map a particular >>>>>> access point to an interface or fail?

    I have two AP's (each on a different ssid) to connect to so have two >>>>>> wifi interfaces - unfortunately they are not equal so I want wlan0 >>>>>> to connect to only one particular AP, and wlan1 to the other ...
    reliably! I can manually force it to connect but invariably at the >>>>>> first glitch they both end up connected to the same AP (usually the >>>>>> strongest which is often not what I want :(

    BillK
    I don't know about wpa-supplicant, but I'm using open-rc and KDE, and >>>>> KDE's systemsettings Network / Connections screen lets you restrict a >>>>> network connection so a specific device. Not sure if this helps you >>>>> any, but it would indicate that what you want is possible.

    Jack
    Look at the example provided in:

    /usr/share/doc/netifrc-0.7.3/net.example.bz2

    You can set a different ssid for each wireless NIC. The
    wpa_supplicant can be set with credentials for the two APs only.
    Unfortunately, this does not work as I want ...wpa_supplicant's
    behaviour makes sense in that it provides a fallback if the allocated
    access point cant connect ... it will pick the next available one
    (seemingly based on signal strength) if it is in its conf file (and
    does not care that its another ssid) - so it does not fail. As only
    one of the two networks has internet access the device often ends up
    not being able to be connected to (its headless so that's a problem!).

    I have fallen back to openrc for the main connection and will do the
    other manually - it would be nice to have everything properly
    controlled but its not working for me.
    Could you run two instances of wpa_suplicant, each listening on a
    different interface and using a config with only the AP for that
    interface?
    As I recall wpa_cli can be launched by specifying a particular interface. Therefore two instances of wpa_cli launched by a script should be possible.

    However, isn't the purpose of /etc/conf.d/net to specify how individual interfaces are configured? I still think - but have not tried it - each wireless NIC can be configured via this file to use a particular access point/
    channel and not go scanning for others, while the wpa_supplicant can be left to deal with the authentication mechanism after each NIC has found its specified ESSID.

    The section in the netifrc example file which starts as follows, merits reading:

    ###############################################
    # SETTINGS
    # Hard code an SSID to an interface - leave this unset if you wish the driver # to scan for available Access Points . . .

    Something like this ought to work:

    essid_wlan0="foo"

    essid_wlan1="bar"

    Didnt work - what did work was setting up the main network using normal
    openrc and scripting the other interface after making it
    config_wlan1="null" in conf.d/net.  I am putting this part of the
    problem as solved.  Routing is still an issue but once I have a couple
    of diagnostic packages installed (compiling is slow on a pi!) I will be
    better able to see whats gone wrong.

    BillK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)