Network routes for interfaces
Network routes for interfaces
- Subject: Network routes for interfaces
- From: "Jamie Wood" <email@hidden>
- Date: Wed, 15 Dec 2004 13:57:35 -0800
Hi,
I've got a situation where I want to only route traffic to a specific host
through the primary interface. I want to route all other traffic to another
interface. On Mac OS X, it appears that the primary interface always has a
network route in the routing table that corresponds to the configuration of
the interface. For example, if my interface has IP 10.11.254.63 and netmask
255.255.0.0, netstat shows a route like this:
Destination Gateway Flags Refs Use Netif Expire
default 10.11.0.1 UGSc 27 4 en0
10.11/16 link#4 UCS 14 0 en0
I want to change this so that only traffic to a specific IP within the 10.11
network goes to en0. So, I tried deleting the above route and adding a host
route to en0 "route add -host 10.11.102.2 -interface en0". Now the above
routing table entry is gone, and I have this entry:
Destination Gateway Flags Refs Use Netif Expire
default 10.11.0.1 UGSc 27 4 en0
10.11.102.2 0:a:95:a5:57:b4 UHLS 0 2 en0
But this doesn't work. I can't ping 10.11.102.2. tcpdump shows that no
traffic is leaving the machine. If I add the original route back, it still
doesn't work. I have to remove the host route for 10.11.102.2 before I can
ping it again. Am I missing some important piece here?
It appears that I need a network route that matches the configuration of the
en0 interface for anything to be routed to/accepted by the interface. If
this is the case, why does this restriction exist, and is there any
workaround?
Any help would be greatly appreciated,
Jamie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden