Re: dsmasq required for AP/Hotspot



Hi,


On Thu, 2018-08-02 at 07:31 +0000, Craig A. Falls via networkmanager-
list wrote:
please be kind - first post!

[exec summary]
issues with AP in NetworkManager, won't start with out dnsmasq but
runs fie without it
don't know who or where to tell this story - starting here

[backstory]

I have been fooling around with hotspots on raspberry pi's using
hostapd, but to use hostapd it seemed I need to not have
NetworkManager and wpa_supplicant running.

I don't think that's true. To use hostapd directly you don't need
NetworkManager.

  Well, at least  I couldn't figure out how to create a wifi
interface without an ssid, which I am not sure if it was an issue or
not, but I could do that through network.service.


i previously went completely without networkmanaager and had
everything working fine (via hostapd).  On the new build I started
with NetowrkManager to learn more about it.

In looking to start the Hotspot again, I decided a split
configuration wasn't a good idea (why manage two interfaces two
different ways (i.e. NetworkManager and network.service)). In messing
about and googling I found the hotspot ability through networkmanage
and thought I would give it a go.

[the issue]

in setting it up - it would fail with:

Error: Connection activation failed: IP configuration could not be
reserved (no available address, timeout, etc.)

going through the logs it turns out having an AP/Hotspot seems to
require dnsmasq

Aug 02 00:03:14 host NetworkManager[240]: <error> [1533193394.9226]
device (wlan0): share: (wlan0) failed to start dnsmasq: Could not
find "dnsmasq" binary

yet - it isn't really required - the pi I am doing this on is running
named and dhcpd
so when the interface tries to start dnsmasq - it errors out with
this ...

When you set ipv4.method=shared (what you want to do for a hotspot),
NetworkManager spawns dnsmask as DHCP and DNS server. You need that.


Aug 01 23:39:13 host NetworkManager[240]: <info>  [1533191953.8456]
dnsmasq-manager: starting dnsmasq...
Aug 01 23:39:13 host NetworkManager[240]: dnsmasq: failed to create
listening socket for 192.168.99.1: Address already in use
Aug 01 23:39:13 host dnsmasq[405]: failed to create listening socket
for 192.168.99.1: Address already in use

Looks lik you already have a DNS server listening on UDP port 53.

Stop conflicting DNS servers.

Alternatively (better?), if your conflicting DNS server is dnsmasq too,
configure "bind-interfaces" in /etc/dnsmasq.conf.


Aug 01 23:39:13 host dnsmasq[405]: FAILED to start up
Aug 01 23:39:13 host NetworkManager[240]: <info>  [1533191953.9504]
device (wlan0): Activation: successful, device activated.
Aug 01 23:39:13 host NetworkManager[240]: <info>  [1533191953.9529]
manager: startup complete
Aug 01 23:39:13 host NetworkManager[240]: <warn>  [1533191953.9537]
dnsmasq-manager: dnsmasq exited with error: Network access problem
(address in use, permissions) (2)

[test/repeat]

<assuming we start in a working state>

# nmcli con down wlan0_ap
# nmcli con show
# dnf remove dnsmasq
# nmcli con up wlan0_ap
 -- get error
Error: Connection activation failed: IP configuration could not be
reserved (no available address, timeout, etc.)

# dnf install dnsmasq
# nmcli con up wlan0_ap
 -- starts - no error at command line
Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/15)

and hotspot works, access works.

system log/journalctl shows

Aug 02 00:18:09 host NetworkManager[240]: <info>  [1533194289.0032]
dnsmasq-manager: starting dnsmasq...
Aug 02 00:18:09 host NetworkManager[240]: dnsmasq: failed to create
listening socket for 192.168.99.1: Address already in use
Aug 02 00:18:09 host dnsmasq[1981]: failed to create listening socket
for 192.168.99.1: Address already in use
Aug 02 00:18:09 host NetworkManager[240]: <warn>  [1533194289.0374]
dnsmasq-manager: dnsmasq exited with error: Network access problem
(address in use, permissions) (2)
Aug 02 00:18:09 host dnsmasq[1981]: FAILED to start up

[fix]

probe to see what is needed?
I know this is difficult because i am gathering it is for a desktop
environment and you don't want users having to set this stuff up -
but silently requiring dnsmasq is a problem already (unless more
clever OS's automagically retrieve it), and erroring our but working
is, well, messy.

i think i am going to remove the dnsmasq package and create a dnsmasq
shell script that just returns 0, unless there is a better option?

thanks - if this isn't the right place for this let me know where to
go!

c


_______________________________________________
networkmanager-list mailing list
networkmanager-list gnome org
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]