To serve DHCP, NetworkManager will simply spawn a standalone instance of dnsmasq which you can configure.
You can drop dnsmasq configuration in /etc/NetworkManager/dnsmasq-shared.d/ - like /etc/NetworkManager/dnsmasq-shared.d/50-no-gateway.conf (the "shared" in the path is the same as in "method=shared" in your NetworkManager config)
If you want to send no default route, simply add the following to the dnsmasq config: (to understand why that works, see https://github.com/imp/dnsmasq/blob/mas ... nf.example )
You might also want to avoid sending a DNS resolver, simply by adding yet another line:or even disable DNS entirely with:You might need to do a connection reload / restart NetworkManager for it to take effect (and if unsure, reboot).
That said, I wouldn't be surprised if your phone still didn't work the way you want after that. The phone OS might make the assumption that a wifi connection should always offer a default route, and may be really confused if it doesn't.
You can drop dnsmasq configuration in /etc/NetworkManager/dnsmasq-shared.d/ - like /etc/NetworkManager/dnsmasq-shared.d/50-no-gateway.conf (the "shared" in the path is the same as in "method=shared" in your NetworkManager config)
If you want to send no default route, simply add the following to the dnsmasq config:
Code:
dhcp-option=3You might also want to avoid sending a DNS resolver, simply by adding yet another line:
Code:
dhcp-option=6Code:
port=0That said, I wouldn't be surprised if your phone still didn't work the way you want after that. The phone OS might make the assumption that a wifi connection should always offer a default route, and may be really confused if it doesn't.
Statistics: Posted by vikmik — Tue Apr 29, 2025 6:22 pm