[CentOS] Simple routing question

Thu Sep 6 18:09:10 UTC 2012
James B. Byrne <byrnejb at harte-lyne.ca>

Per: Les Mikesell lesmikesell at gmail.com
Thu Sep 6 13:55:05 EDT 2012

> A 'route -n' should show you where any destination will head
> on the next hop.  On host C, what is the line with the
> smallest matching destination/mask?  Likewise, on the gateway
> host where you think it is being forwarded the wrong way?


$ /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref   
Use Iface
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0       
0 virbr0
aaa.bbb.ccc.0    0.0.0.0        255.255.255.0   U     0      0       
0 bridge0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0       
0 bridge0
0.0.0.0         aaa.1bbb.ccc.1  0.0.0.0         UG    0      0       
0 bridge0


$ traceroute 192.168.209.43
traceroute to 192.168.209.43 (192.168.209.43), 30 hops max, 40 byte
packets
 1  gway01 (aaa.bbb.ccc.1)  0.321 ms  0.298 ms  0.283 ms
 2  ISPlink (aaa.bbb.ddd.53)  1.000 ms  0.993 ms  1.450 ms
 3  * * *
 4  * * *
 5  * * *
. . .

This seems to say that 192.168.209.43 is being routed out to the
Internet as aaa.bbb.ddd.53 is our external gateway address on the
router.

This is the routing table on the router:

[root at gway01 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref   
Use Iface
aaa.bbb.ddd.52  0.0.0.0         255.255.255.252 U     0      0       
0 eth0
aaa.bbb.ccc.0   0.0.0.0         255.255.255.0   U     0      0       
0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0       
0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0       
0 eth1
0.0.0.0         aaa.bbb.ddd.53  0.0.0.0         UG    0      0       
0 eth0


-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3