Sort is precautionary. Nit picking what you can do with *nix is like saying
there is only one way to do something when really there is always a plethora
of ways to do things.
But yes. My purpose of sort is to get the prefixes in a direct order.
Here for example:
C 192.1.63.0/24 is directly connected, FastEthernet0/1.63
16.0.0.0/24 is subnetted, 1 subnets
D 16.16.16.0 [90/27010560] via 45.45.6.4, 5d17h, Tunnel456
B 192.1.73.0/24 [20/0] via 192.1.63.3, 5d17h
B 192.1.13.0/24 [20/0] via 192.1.63.3, 5d17h
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0 [110/2] via 6.6.62.2, 5d17h, FastEthernet0/1.62
4.0.0.0/24 is subnetted, 2 subnets
D 4.4.4.0 [90/27008000] via 45.45.6.4, 5d17h, Tunnel456
D 4.4.44.0 [90/26882560] via 45.45.6.4, 5d17h, Tunnel456
5.0.0.0/24 is subnetted, 4 subnets
D 5.5.5.0 [90/27008000] via 45.45.6.5, 5d17h, Tunnel456
D 5.5.22.0 [90/27010560] via 45.45.6.5, 5d17h, Tunnel456
D 5.8.22.0 [90/27010560] via 45.45.6.5, 5d17h, Tunnel456
D 5.5.52.0 [90/26882560] via 45.45.6.5, 5d17h, Tunnel456
6.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
B 6.7.7.0/24 [20/0] via 192.1.63.3, 5d17h
C 6.6.6.0/24 is directly connected, Loopback0
C 6.6.45.0/24 is directly connected, Serial0/1/0
C 6.6.62.0/24 is directly connected, FastEthernet0/1.62
C 6.6.67.0/24 is directly connected, FastEthernet0/1.67
C 6.6.68.0/24 is directly connected, FastEthernet0/1.68
S 6.6.6.156/32 [1/0] via 0.0.0.0, Virtual-Access2
172.23.0.0/24 is subnetted, 2 subnets
O E1 172.23.22.0 [110/21] via 6.6.67.7, 5d17h, FastEthernet0/1.67
O E1 172.23.14.0 [110/21] via 6.6.67.7, 5d17h, FastEthernet0/1.67
7.0.0.0/24 is subnetted, 2 subnets
O 7.7.7.0 [110/2] via 6.6.67.7, 5d17h, FastEthernet0/1.67
O 7.7.17.0 [110/2] via 6.6.67.7, 5d17h, FastEthernet0/1.67
8.0.0.0/24 is subnetted, 1 subnets
O 8.8.8.0 [110/2] via 6.6.68.8, 5d17h, FastEthernet0/1.68
9.0.0.0/24 is subnetted, 3 subnets
O 9.9.9.0 [110/33] via 9.9.69.9, 5d17h, Multilink69
C 9.9.69.0 is directly connected, Multilink69
O 9.9.93.0 [110/33] via 9.9.69.9, 5d17h, Multilink69
B 192.1.23.0/24 [20/0] via 192.1.63.3, 5d17h
10.0.0.0/24 is subnetted, 2 subnets
C 10.6.6.0 is directly connected, FastEthernet0/1.6
O 10.1.1.0 [110/2] via 6.6.62.2, 5d17h, FastEthernet0/1.62
B 192.1.103.0/24 [20/0] via 192.1.63.3, 5d17h
S 192.1.49.0/24 [1/0] via 0.0.0.0, Virtual-Access2
45.0.0.0/24 is subnetted, 1 subnets
C 45.45.6.0 is directly connected, Tunnel456
15.0.0.0/24 is subnetted, 1 subnets
O 15.15.15.0 [110/34] via 9.9.69.9, 5d17h, Multilink69
O E1 192.168.10.0/23 [110/21] via 6.6.67.7, 5d17h, FastEthernet0/1.67
By simply organizing the routes towards the protocol I am getting them from
it makes it much easier. But you can clearly see the routes are not
organized by prefix length, class or who they are received from. Just in
case you haven't seen a routing table before ;)
Regards,
Tyson Scott - CCIE #13513 R&S, Security, and SP
Technical Instructor - IPexpert, Inc.
Mailto: tscott_at_ipexpert.com
Telephone: +1.810.326.1444, ext. 208
Live Assistance, Please visit: www.ipexpert.com/chat
eFax: +1.810.454.0130
-----Original Message-----
From: Ryan West [mailto:rwest_at_zyedge.com]
Sent: Monday, May 10, 2010 10:05 AM
To: Tyson Scott
Cc: ocsic_at_hotmail.co.uk; Ccieyarub; Cisco certification
Subject: RE: Comparing two IP routing table
Tyson,
>
> On Sun, May 9, 2010 at 5:27 PM, Tyson Scott <tscott_at_ipexpert.com> wrote:
>
> > Build two files
> > cat a.txt | sort > aa.txt
> > cat b.txt | sort > bb.txt
> > diff aa.txt bb.txt
> >
> > This is basic Unix.
> >
> > You could probably generate a shell script but the above should do.
Not to nitpick, but are there examples when the routing table is not already
sorted? If you've already got the files on a *nix box, I might try:
diff -y --supp tableA tableB | grep \|
C 10.0.2.0/24 is directly connected, Vlan2 | C
10.0.2.0/24 is directly connected, Vlan20
C 10.0.3.0/24 is directly connected, Vlan3 | C
10.0.3.0/24 is directly connected, Vlan30
This should show only changes for the same networks and help you track down
dups.
-ryan
Blogs and organic groups at http://www.ccie.net
Received on Mon May 10 2010 - 10:20:14 ART
This archive was generated by hypermail 2.2.0 : Tue Jun 01 2010 - 07:09:52 ART