Section 11.5. Routing


11.5. Routing

To see the routing table used by the system, you can use the Netstat tab of the Network Utility application, click the Display routing table information radio button, and then hit the Netstat button, as shown in Figure 11-7. This outputs the same routing table information as the netstat -r command, shown in Example 11-5.

Example 11-5. The routing table as displayed by netstat -r
 $ netstat -r Routing tables Internet: Destination        Gateway            Flags    Refs      Use  Netif Expire default            192.168.79.1       UGSc       19       13    en0 192.168.79         link#4             UCS         6        0    en0 192.168.79.1       0:0:d1:f0:67:9     UHLW        5        0    en0   1178 192.168.79.9       127.0.0.1          UHS         0        0    lo0 127                127.0.0.1          UCS         0        0    lo0 127.0.0.1          127.0.0.1          UH         13   259841    lo0 169.254            link#4             UCS         0        0    en0 Internet6: Destination        Gateway            Flags      Netif Expire ::1                link#1             UHL          lo0 fe80::%lo0/64      fe80::1%lo0        Uc           lo0 fe80::1%lo0        link#1             UHL          lo0 ff01::/32          ::1                U            lo0 ff02::/32          ::1                UC           lo0

Figure 11-7. Using Network Utility to examine routing information


There are two parts to the routing table: the first is the Internet table for routing packets to IPv4-based networks; the second is the Internet6 table for routing packets to IPv6-based networks. Each part contains a set of entries. Here's what the first few entries in the Internet table mean:

  • The first line indicates that the default destination for all packets is 192.168.79.1, a router to the Internet. The packets should be sent via the en0 interface.

  • The second line indicates that packets for the 192.168.79 network should use the en0 interface.

  • The third line indicates that packets to 192.168.79.1 (the address of the router) should be sent to the device with the MAC address 0:0:d1:f0:67:9 using the en0 interface.

  • The fourth line indicates that packets to 192.168.79.9 (in this case, the local machine) should be sent to the localhost on the lo0 interface. The system puts this route into place so that any packets for the local machine that use the external IP address aren't sent to the network.

The Internet6 table, shown in Example 11-5, contains the same sort of information but with IPv6 instead of IPv4 addresses.

The most useful entry in these tables is the default route. When you are having problems connecting to the network, you can quickly check to see whether the system has a default route. Example 11-6 shows the output of netstat -r when all the network connections on a machine are down. As you can see, the only machine that packets can get to is localhost. You can also see that when the network interfaces are all down, there is no default route, as traffic is not able to leave the machine.

Example 11-6. The routing table with no external routes
 $ netstat -r Routing tables Internet: Destination        Gateway            Flags    Refs      Use  Netif Expire 127                127.0.0.1          UCS         0        0    lo0 127.0.0.1          127.0.0.1          UH         16   259946    lo0 224.0.0/4          127.0.0.1          UCS         2        0    lo0 224.0.0.2          127.0.0.1          UHW         1        1    lo0 224.0.0.251        127.0.0.1          UHW         1        7    lo0 Internet6: Destination        Gateway            Flags      Netif Expire ::1                link#1             UHL          lo0 fe80::%lo0/64      fe80::1%lo0        Uc           lo0 fe80::1%lo0        link#1             UHL          lo0 ff01::/32          ::1                U            lo0 ff02::/32          ::1                UC           lo0




Running Mac OS X Tiger
Running Mac OS X Tiger: A No-Compromise Power Users Guide to the Mac (Animal Guide)
ISBN: 0596009135
EAN: 2147483647
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net