Using NWConnection, can you choose a specific interface name to use?

When initializing a NWConnection I noticed in NWParameters you can require or prohibit types of interfaces such as wifi, cellular, or wiredEthernet. I want to explicitly use awdl0 and not en0. Both are wifi type interfaces. I noticed sometimes my device uses en0 and other times uses awdl0.

Post not yet marked as solved Up vote post of willeum43 Down vote post of willeum43
132 views

Replies

Using NWConnection, can you choose a specific interface name to use?

No. This is a very deliberate design choice, with the goal being to get folks away from hard wiring interface names and instead focusing on attributes of those interfaces.

I noticed sometimes my device uses en0 and other times uses awdl0.

OK. And that’s a problem because?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"