0

I am on a production in which I am placing my MacBook Pro running macOS 10.15.7 (Catalina) onto a local network via Ethernet (en8), whose IP addresses are 192.168.1.*. I also need to be on the Wi-Fi (en0), which is connected to the internet, which I need, who also uses the IP address range 192.168.1.*.

I only need to talk to one device on the Ethernet (IP address is static at 192.168.1.147 and the MAC address ends in A7:31:F9). Right now my solution is to make the Ethernet the highest item in the service order, establish my connection, and then move Wi-Fi to the highest, else it won't connect to the internet.

It looks like adding a route might be needed given the according to this Server Fault post, but it looks like they went a different route (no pun intended) since the IP blocks were different.

Probably for another discussion but if there was some way a device on the Wi-Fi network could talk to the same device mentioned above on the Ethernet? That would be even better but that is not as required.

2
  • hm, are these 'different' networks? In this case they shouldn't be sharing IP ranges
    – Journeyman Geek
    Oct 10, 2022 at 2:51
  • These are physically separate networks. 99.99% of the time the two networks nothing connecting the two, and the one on ETH normally has no way to interact with the Wi-Fi. I am just an oddball case that always is weird.
    – traisjames
    Oct 10, 2022 at 3:21

1 Answer 1

1

Leave Wi-Fi as your primary connection (so that the 192.168.1.0/24 route goes through the Wi-Fi interface), but create a more specific route for the devices you want to access via Ethernet, which will then take priority over the less-specific Wi-Fi /24.

For example, add a route using a /32 or 255.255.255.255 mask for a single IP address (I think in BSD you also need route add -host rather than -net).

Probably for another discussion but if there was some way a device on the Wi-Fi network could talk to the same device mentioned above on the Ethernet? That would be even better but that is not as required.

In theory possible, although I'm not sure how good macOS is at being a router.

When both sides use the same IP addressing (more specifically, when each side would consider addresses on the other side to be "local subnet"), they'll try to resolve the "local" addresses via ARP, so you could use proxy-ARP to make the gateway answer ARP requests on behalf of the distant devices.

5
  • And just to check, the command will be "route add -host myIP deviceIP -interface en0"?
    – traisjames
    Oct 10, 2022 at 6:32
  • Broadly the syntax looks okay (not very familiar with the BSD style 'route' command), but I'm not sure where you're taking the "myIP" from – routes typically specify only the destination, not the source. The example over at ServerFault is route add -host <destination> <via>, so only "deviceIP -interface en0" needs to be specified, but not myIP. (Similarly for network routes it would be route add -net <destn> <netmask> <via>, or perhaps route add -net <destn>/<prefixlen> <via>; FreeBSD accepts the more modern /prefixlen syntax but not sure if macOS does.) Oct 10, 2022 at 6:48
  • From the use of 2 ip addresses. I get <destination>, but not what <via> should be.
    – traisjames
    Oct 10, 2022 at 7:06
  • In your case the <via> is just -interface en0 (indicating a local destination), while in other situations it'd contain a gateway address (something like -gw GatewayIP in BSD syntax). Oct 10, 2022 at 7:47
  • So turns out the ethernet to the switch and device is en8, wifi is en0. Easy fix. When connected by changing service order natstat gives: 192.168.1.147 0:a0:de:a7:31:f9 UHLWIi en8 1196 but if I run sudo route add -host 192.168.1.147 -interface en8 192.168.1.147 0:e0:4c:68:20:1f UHLS en8 and it doesn't work. I know the device I am trying to go to is ...1.147 and the MAC address ends in 31:F9
    – traisjames
    Oct 10, 2022 at 19:16

You must log in to answer this question.

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