How to setup Mac server to use two gateways

gatewayipmac-osx-servernetworkingrouting

I recently asked this question: How to set Mac server to use different Gateway for internet bound traffic

The answer given works but has presented me with another issue that I didnt make clear in that question.

Here is my network layout as it stands:
http://www.philosophydesign.com/downloads/officenetwork2.png

At the moment outside staff members use some services on the existing internet 1 link. Those services are hosted by the Mac server. If I change the gateway of the Mac server to the second modem those outside staff lose visabilty on those services.

Now I dont know how to go about solving this issue. I want the second link to be used when the Mac server goes to rsync data offsite but everything else use link one. How do I do this?

Thanks

Scott

EDIT: This has been resolved by setting the default gateway on the Mac server to 192.168.1.254 Thus leaving everything on the network as it was before. but to get the Mac server to use the other link for rsync I've added a route to the Mac server to route traffic to the rsync server through the second gateway.

sudo route add -net {server IP's}/{Netmask} 192.168.1.1

I've awarded the answer to gravyface for pointing me to a post on how to make this route persistant in Mac

Best Answer

Instead of setting a rule on your Mac Server, set a static Route on your Main-Router (.254) to send packets for specific IP-Adresses to your Router No. 2 (.1)