Contribute  :  Advanced Search  :  Directory  :  Forum  :  FAQ's  :  My Downloads  :  Links  :  Polls  
AFP548 Changing the world one server at a time.
Welcome to AFP548
Thursday, July 29 2010 @ 09:34 am MDT
   

Source Based Routing Quietly Finds Its Way Into Snow Leopard

Articles

On Mac OS X 10.5, if you connect two different ports on a host to two different networks and assign them with two different IP schemes then only one can act as the default gateway.  This means that any incoming packets will all, by default, get responded to over the default gateway; despite which interface the packets came in on.  You can customize your routing table using the route command but this can be tedious and doesn't always necessarily net the desired results.

Read on for a bit more...



To show this, run the command netstat -rn on a Mac OS X 10.5 host with two NICs installed, each with its own gateway, and you'll noticethat only one entry is listed as the default.

Internet:

Destination        Gateway            Flags        Refs      Use   Netif Expire

default            192.168.210.1      UGSc           11        039     en0

 

In Snow Leopard we now have Source Based Routing, or Source Routing, according to how you feel like referencing it and the type of traffic that you are referencing.  Connect two NICs, again, each with its own gateway, and you'll notice that both can have an entry as the default when you run that same netstat -rn command:

Internet:

Destination        Gateway            Flags        Refs      Use   Netif Expire

default            192.168.210.1      UGSc           58        0     en0

default            192.168.55.1        UGScI           0        0     en1

 

This is because the source of a packet has specified the route that the packet will use, basically meaning that they're going to dance with the one that brought them and the response will be on the same network that the packet came in on.  The long and short of it means that if you take an Xserve, connect one port the the outside of your network, or a second network and the second port directly to your production network and it will work fairly easily, without a lot of command line jockeying.  Best of all, it's the default behavior, so you won't have to do a thing to use it.

Story Options

Advertising

Source Based Routing Quietly Finds Its Way Into Snow Leopard | 5 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Load-Balancing?
Authored by: Anonymous on Wednesday, September 02 2009 @ 02:24 am MDT
This is really neat. It makes me wonder about outbound packets. With two default gateways, where will the server send them? Might there even be a way to load-balance the two ports? I imagine that would make it possible to operate two DSL lines, providing not only protection from line failure but also doubling the bandwidth?