1

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

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

2 Answers 2

0

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 10.0.0.0/24 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.

1

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 10.0.0.1). 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 10.0.0.11).


You need to setup a static routes:

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

  • for 10.0.0.0 (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.

6
  • 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 0.0.0.0 0.0.0.0 route: writing to routing socket: Can't assign requested address add net 0.0.0.0: gateway 0.0.0.0: 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. 10.0.0.0 is the router for the "whole local network" meaning for each host that belongs to the subnet. For 10.0.0.0/24 it would be 10.0.0.1 until 10.0.0.254.
    – Albin
    Oct 17, 2020 at 0:49
  • @Sputnik7623 0.0.0.0 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 0.0.0.0 is not 0.0.0.0 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.