I am making a USB attached IoT device that follows the Matter approach to connectivity (IP/mDNS/DHCP). I am having conflicts with it as it appears to MacOS as an Ethernet adapter and this is causing it to be assigned as a "default" route, interfering with routing when my Mac is connected to NAT based WiFi.
I'd like to be able to hint to MacOS & iPadOS that this is not a routable private network, the subnet should be respected and a default route should not be assigned to it, otherwise the order of the device connection is used by the IP routing tables and I am concerned my non-routable private network will initialize before Wifi and block NAT based internet connectivity.
How can I hint to MacOS/iPadOS "this is not a routable private network, this is not a NAT, do not assign me a default route beyond the subnet I have provided you."
I have a bunch of backstory to this in Extra-ordinary Networking, and the various posts that hang off it.
If your accessory implements a DHCP server then it should not vend a gateway, that is, it should set the giaddr
field to all zeroes. If there’s no gateway then the interface can’t become the default route.
Honestly though, I’m a big fan of not implementing a DHCP server at all, and instead have the client find the accessory using Bonjour over IPv6. That combo is simple, and it always works.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"