I am looking to configure the wifi (wlan0) as an access point / hotspot with the following behaviour.

The following works:

  1. Device creates a hotspot, broadcasts the SSID and starts up http server (node express server)
  2. User connects to hotspot
  3. User navigates to right ip and can see the server.

What I need help with:

  • How do I catch all URLs and redirect them to the right ip so they only see the server?
  • When I connect to the hotspot, I only see the server when I enter IP, not when I enter hostname.
  • How can I make the browser automatically open and navigate to right IP ?

I believe I need to configure the DNS settings, but I am not sure how? Do I need to use dnsmaq or can I use nmcli exclusively? When I wasn't using nmcli, I got it working with dnsmasq, but i'm not sure how to use nmcli with dnsmasq

interface=wlan0      # Use the require wireless interface - usually wlan0

For what is worth, I am using a Compute Module (Pi 3), running Raspbian

My current connection details:

connection.id:                          Hotspot
connection.uuid:                        0456fec2-f1e3-45f0-92d9-35cb9c0e5f64
connection.stable-id:                   --
connection.type:                        802-11-wireless
connection.interface-name:              wlan0
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   0
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
802-11-wireless.ssid:                   hydrogen
802-11-wireless.mode:                   ap
802-11-wireless.band:                   bg
802-11-wireless.channel:                0
802-11-wireless.bssid:                  --
802-11-wireless.rate:                   0
802-11-wireless.tx-power:               0
802-11-wireless.mac-address:            --
802-11-wireless.cloned-mac-address:     --
802-11-wireless.mac-address-blacklist:  --
802-11-wireless.mtu:                    auto
802-11-wireless.seen-bssids:            --
802-11-wireless.hidden:                 no
802-11-wireless.powersave:              0 (default)
802-11-wireless.wake-on-wlan:           0x1 (default)
ipv4.method:                            auto
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       ""
ipv4.dns-priority:                      0
ipv4.addresses:                         --
ipv4.gateway:                           --
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            auto
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       ""
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-duid:                         --
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.token:                             --
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --

2 Answers 2


To capture and redirect HTTP traffic, you would need to run some captive-portal software. NetworkManager doesn't include that. You could still use NetworkManager to run the hotspot for you. But you could also run hostap and dnsmasq yourself.

Usually, when you create an Wi-Fi access point with NetworkManager (802-11-wireless.mode ap), then you also want to run a DHCP and DNS server with IPv4 NAT (or use IPv6 prefix delegation). The Wi-Fi "ap" and the IP shared method are independent. For example, you can also configure "ipv4.method=shared" on an ethernet or bluetooth device.

If you configure ipv4.method shared, NetworkManager will run dnsmasq on the interface, which acts as a DHCP and DNS server. It will also add an iptables rule to enable masquerading (NAT). If you configure ipv6.method shared, NetworkManager will do IPv6 prefix delegation.


I appreciate the reply.

I was able to get so primitive routing by using the dnsmasq plugin.

  1. I set dns=dnsmasq in /etc/NetworkManager/NetworkManager.conf
  2. I set address=/test.com/ in /etc/NetworkManager/dnsmasq.d/redirect.conf

So to enable DHCP and DNS functionality on the Ethernet, all I have to do is set ipv4.method.shared in the ethernet profile?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .