Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Networking > How to route traffic to a specific server via one of two network ports?

How to route traffic to a specific server via one of two network ports?
Thread Tools
OreoCookie
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Aug 31, 2016, 02:26 AM
 
I have a Mac Pro which is connected to the internet in two ways (using wired ethernet), and I need both for different purposes. Connection 1 is a “normal” connection where I am connected to the internet via a router, and I sit behind a firewall. I need this connection to print. Then I have Connection 2 which is a direct, unfettered connection to the internet (fixed IP, etc.). I need this connection to connect to a VPN server. Is there a way to tell OS X to only use Connection 2 if I want to connect to the VPN server?

PS I know that it would be easier to just change the settings in the firewall which protects Connection 1. Unfortunately, I can't, and this was the only viable solution offered to me. And yes, very soon I will put a dedicated firewall in between the wild internet and my Mac Pro.
I don't suffer from insanity, I enjoy every minute of it.
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Aug 31, 2016, 03:46 AM
 
Sounds like you need to add a static route. The command to do that is:

sudo route -n add -net IP_of_network_segment IP_of_gateway

So if the router at Connection 2 is called 12.34.12.34, and the VPN server is called 5.6.7.8, you'd type

sudo route -n add -net 5.6.7.8 12.34.12.34

This does not persist across reboots, so you'd need to make this an autostart object if you want it to stick.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
OreoCookie  (op)
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Aug 31, 2016, 06:10 AM
 
Ah, thanks a lot, that does what I want.
I don't suffer from insanity, I enjoy every minute of it.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:12 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,