Looking for a steer on network configuration.

I have a local production switch and want to route all local traffic for 10.0.0.x from my mac pro to this switch. I have another switch in front of my internet router (because I am sharing the internet connection with my laptop) and am connecting to it from the mac pro on a separate ethernet port. I want all internet traffic - non-10.0.0.x - to go via this route.

The local switch has static IPs set for all the hosts (see diagram). The internet facing switch is just passing through DHCP - as I understand it.

I have no idea where to start to look to set this up. When I try and plug both in, the mac just picks the production switch for all traffic and so I have no internet connection. Can anyone point me in the right direction on this?

For clarity - I need to set the mac up to use one port for internet traffic and one port for local network.

I've attached a diagram of my setup in the hope that it provides more clarity on the problem.

enter image description here

EDIT: I think I have added a static permanent route now for the local network (using advice from http://networknucleus.com/2018/06/07/persistent-static-routes-in-macos/) but am struggling to add a route for internet traffic. Here is my routing table:

Routing tables

Destination        Gateway            Flags        Netif Expire
default             UGSc           en0     
default          UGScI          en8      
10/24              link#4             UCS            en0      !        link#4             UCS            en0      !           bc:a5:11:26:e5:3f  UHLWIir        en0    834       link#4             UCS            en0      !         d4:e0:8e:6:30:77   UHLWIi         en0    835         dc:ed:84:b0:12:8b  UHLWI          en0   1193         ff:ff:ff:ff:ff:ff  UHLWbI         en0      !
127                UCS            lo0          UH             lo0       
169.254            link#4             UCS            en0      !
169.254            link#20            UCSI           en8      !
192.168.1          link#20            UCS            en8      !     link#20            UCS            en8      !        78:d2:94:57:67:dd  UHLWIir        en8   1196        4:db:56:e8:82:83   UHLWIi         en8    845        88:19:8:b:33:a6    UHLWIi         en8    888       d4:61:9d:7c:d7:78  UHLWI          en8    881       8:66:98:c0:e3:18   UHLWI          en8   1117       48:65:ee:16:42:c2  UHLWIi         en8   1185    link#20            UCS            en8      !       2:f:b5:45:d4:80    UHLWI          en8    834      2:f:b5:d9:fa:4f    UHLWI          en8    835      ff:ff:ff:ff:ff:ff  UHLWbI         en8      !
224.0.0/4          link#4             UmCS           en0      !
224.0.0/4          link#20            UmCSI          en8      !        1:0:5e:0:0:fb      UHmLWI         en8    1:0:5e:7f:ff:fa    UHmLWI         en0    1:0:5e:7f:ff:fb    UHmLWI         en0 link#4             UCS            en0      !    ff:ff:ff:ff:ff:ff  UHLWbI         en0      ! link#20            UCSI           en8      !

2 Answers 2


There is no additional setup required for this kind of setup. By setting an IP address and a subnet mask (or prefix length) on a network adapter, all operating systems automatically add a route to this network via this network adapter.

You have one incorrect setting: You have added a default gateway on your network, even though it isn’t really one. Remove the default gateway (maybe called “Router” on macOS) from your network settings and you’re done.


Update: I didn't realize your internet router is on a different subnet then your production network. In this case you can just delete the first route (default on gateway It might be easier just to delete the "router" entry in your GUI network configuration for the network adapter connected to the "internet switch" (with the IP

You need to setup a static routes:

  • for default (or your should be going through the network adapter connected to the "internet switch"

  • for (including the subnetmask you are using for your LAN) going through the network adapter connected to the "LAN switch"

With netstat -nr you can view your current routes, not sure how to add routes on a MAC but if you search for something like "add or delete static routes MAC" you'll get tons of results, just pick your favourite one. Make sure to add persistent routes that will be still there after a reboot.

  • Thanks for your help. Do I do this locally on the mac or do I have to do anything on the switches? And do I have to add a route in my routing table for every host/device on the 10.0.0.x switch? Oct 17, 2020 at 0:35
  • I did this but got an error : 'sudo route -n add route: writing to routing socket: Can't assign requested address add net gateway Can't assign requested address' Oct 17, 2020 at 0:45
  • @Sputnik7623 No, the switches operate on Layer 2 usually there is no configuration necessary, so just locally on the mac. is the router for the "whole local network" meaning for each host that belongs to the subnet. For it would be until
    – Albin
    Oct 17, 2020 at 0:49
  • @Sputnik7623 is the configuration for the default gateway in Windows, sorry I assumed it's the same thing for MAC. I don't have a test machine to try it myself, but it should be fairly easy to find the corresponding mac notation. Maybe you could post your current route table, then I can have a look. And the gateway for is not it must be the LAN IP from your internet router.
    – Albin
    Oct 17, 2020 at 0:51
  • I have added my route table above. I should clarify that I do move from site to site with my mac so the internet router itself could possibly change - but the switches will travel with me. Oct 17, 2020 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.