site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Chase writes:
On Jun 28, 2005, at 7:13 PM, Justin C. Walker wrote:
Can you describe your goals?
the goal is simply to get a router address for a given interface.
i have a list of interfaces. some have ip addresses. some don't. for those that do, i need the gateway address that they are connected to.
As others have pointed out, an interface may not have any router associated with it. Alternatively, an interface may have more than one router associated with it. Take en0 from my configuration for an example of an interface with multiple routers: It is configured with: inet 172.31.130.133 netmask 0xffff0000 broadcast 172.31.255.255 Interesting routes are: default 172.31.128.254 172.31.192/19 172.31.128.254 This means that it *should* be able to talk to all hosts from 172.31.0.1 -> 172.31.254.254 directly. For IP addresses outside that range, it will use the default router. However, we started adding remote office VPNs in the range 172.31.{192,193,194, etc}. So we need to add an explicit route through the VPN gateway to be able to talk to hosts on those subnets. This is what the 172.31.192/19 route is for. It happens that the VPN gateway is the same as our router, but this is a coincidence, not a requirement. Take en1 from my configuration for an example of an interface with no routers: It is configured with inet: 10.0.130.133 netmask 0xffff0000 broadcast 10.0.255.255 There are no interesting routes. Eg: netstat -rn | grep en1 10/16 link#6 UCS 3 0 en1 10.0.130.108 0:60:dd:49:93:ee UHLW 0 1 en1 1000 10.0.130.109 0:60:dd:49:95:ef UHLW 0 2 en1 1003 10.0.130.134 0:60:dd:48:f9:f0 UHLW 2 867834 en1 941 It intentionally has no routes added, because this is a private test LAN for my company's network adaptors and there are no routes out of it. Drew _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Andrew Gallatin