A quick touch on prefix lists.
They are for matching, similar to an access list or whatnot, but can match exact subnet mask lengths.
First you just have an IP with slash notation, and you are matching that EXACT prefix. For instance:
#ip prefix-list ListName permit 10.1.0.0/16
would match the first sixteen bits. This will not match 10.1.0.0/18. It must match the subnet length EXACTLY.
But say we are looking to match a bit more than that.
#ip prefix-list ListName permit 10.1.0.0/16 ge 24 le 24
So we need to match the prefix 10.1.0.0 exactly, but we only want to match /24 masks (remember, this is for matching routes, not hosts) So any /24 route that starts with 10.1. will be matched.
So you want a real life example. Say all my loopback addresses start with 10.99.x.x and I want to match them with a filter. Well I know all my loopbacks are a /32 mask, so I can put
#ip prefix-list LoopBackMatch permit 10.99.0.0/16 ge 32 le 32
I matched the 10.99 prefix, then look through those and only match /32 bit masks.
Last example
ge meaning greater than or equal to, le meaning less than or equal to, we can match a range of masks.
Say all my client routes are 10.x.x.x with /22 masks, and all my switch management, wireless APs, security, and other networks are /24 and /25 masks, and my router links are /30.
#ip prefix-list ClientMatchList permit 10.0.0.0/8 ge 22 le 22
#ip prefix-list ManageNetworksList permit 10.0.0.0/8 ge 24 le 25
#ip prefix-list RouterLinksList permit 10.0.0.0/8 ge 30 le 30
Here I matched the /22 in the first line for client networks.
Then I matched greater or equal to /24 and less than or equal to /25 to match the other networks
Lastly I matched /30 subnets for the router links.
As always, let me know if I got something wrong, I am learning!
Try a few examples!
Showing posts with label Routing. Show all posts
Showing posts with label Routing. Show all posts
Tuesday, June 14, 2011
Thursday, July 8, 2010
Local Area Mobility
So networking companies have been trying to sell us ways to extend layer 2 networks for many years now, back in the days with brouters, Shortest Path First Switching, and even new technologies just out in the last few months such as TRILL and OTV. Now I haven't looked into the new technologies enough to give a thumbs up or down, but since everything in the past has had so many problems I am skeptical.
Looking into it a little though I run into an old gem from the mid 90s (the whitepaper talks about how the new windows 95, with a DHCP client installed, can automatically get an IP address!). Local Area Mobility. Now this may not scale well, but for the problem of a few servers needing to be in the same subnet but a different physical location it works great. In fact it is so simple it blew my mind that I had never heard about or thought of such a thing.
The key is simply that routers use the longest prefix to determine a route. Solution - Host routes.
Local Area Mobility, when turned on, will listen and when a computer is turned on with a statically set IP address that doesn't match the interface's subnet, the router injects a host route (/32) into the routing table. It will also proxy arp requests so that clients in the same subnet (but different router) can still communicate. User attempts to connect to the server's IP, router looks up and finds the /32 hostroute preferred over the /24 or whatever and the packet is properly sent to the server.
I don't know why but that is still blowing my mind how simple it is.
http://www.cisco.com/en/US/products/ps6590/products_white_paper09186a00800a3ca5.shtml
Looking into it a little though I run into an old gem from the mid 90s (the whitepaper talks about how the new windows 95, with a DHCP client installed, can automatically get an IP address!). Local Area Mobility. Now this may not scale well, but for the problem of a few servers needing to be in the same subnet but a different physical location it works great. In fact it is so simple it blew my mind that I had never heard about or thought of such a thing.
The key is simply that routers use the longest prefix to determine a route. Solution - Host routes.
Local Area Mobility, when turned on, will listen and when a computer is turned on with a statically set IP address that doesn't match the interface's subnet, the router injects a host route (/32) into the routing table. It will also proxy arp requests so that clients in the same subnet (but different router) can still communicate. User attempts to connect to the server's IP, router looks up and finds the /32 hostroute preferred over the /24 or whatever and the packet is properly sent to the server.
I don't know why but that is still blowing my mind how simple it is.
http://www.cisco.com/en/US/products/ps6590/products_white_paper09186a00800a3ca5.shtml
Labels:
Cisco,
LAM,
Local Area Mobility,
Routing
Wednesday, June 23, 2010
OSPF area types Stub, Totally Stubby, Not so Stubby
I am starting with the pre-req that everyone understands basic OSPF, Areas, Area Border Routers (ABR), Autonomous Systems, and Autonomous System Border Routers (ASBR)
Alright, I know I'm jumping around a lot here, but things come up in real life, in forums, in books, and in all the blogs I follow that gets me headed off on another track, so today I am talking about OSPF stub area types.
First, what are the types of OSPF Link State Advertisements? These are how OSPF routers communicate routes and route changes etc.
Type1 - Router - router announcing itself and lists links to other routers with metrics in the same area
Type2 - Network - lists what routers are connected by the broadcast segment.
Type3 - Net Summary - An Area Border Router summarizes one area, and sends it to other areas
Type4 - ASBR Summary - An ASBR summarizes external routes that are injected from another routing protocol
Type5 - AS External - Full network routes imported from other routing protocols
Type6 - Group Membership - A multicast advertisement that is not used in OSPFv3
Type7 - NSSA External - Routers in a not so stubby area (NSSA) send external routing information to the ABR to be redistributed (as type 5s to other areas)
There are 11 types, but these are the ones that affect stub areas for this discussion.
First, why use stub areas? Stub areas greatly minimize the traffic and routing table sizes of routers in these stub areas, increasing performance. (And area 0 can't be a stub of any sort)
First we start out with a stub area. A stub area allows Type 2 and Type 3 LSAs. Type 5 LSAs are not passed into the area. A default route is also passed in from the ABR.
Now, what does that mean, Type 2 and Type 3 LSAs allow the area routers to get inter and intra area routes. Routes in the same area are seen as usual, and the routes on the other side of your ABR is visible. Routes that are injected from other protocols, like static or EIGRP, are not advertised. To get to these, the router must use the default route.
**Remember - Stub= No type 5 LSAs and default route
Next we'll look at a Totally Stubby network. Only Type 2 LSAs and a default route are passed into the area (although technically the default route is a type 3... but thats the only one).
This means the routes inside the area are advertised, but all other destinations will use the default route. In other words, to a router in a Totally Stubby area, the ABR is the end of the world and everything not in it's own little area gets passed to the ABR to deal with.
**Remember - Totally Stubby - ONLY Type 2 LSAs and default route
Next we have Not-So-Stubby Areas. NSSAs have Type 2, Type 3, and Type 7 LSAs.
Type 7 LSAs are ONLY found in NSSAs. A NSSA is when you want your area to have external routes and be able to pass them to other areas, but not have other area's external routes imported into this area. In other words, local external routes are allowed, but not external routes from other areas. The ABR changes the Type 7 into a Type 5 when it passes it to other areas.
Cisco says: "NSSAs are more flexible than stub areas in that an NSSA can import external routes into the OSPF routing domain, thereby providing transit service to small routing domains that are not part of the OSPF routing domain."
**Remember - NSSA - Type 2, 3, and 7 LSAs with default route
Finally, we get to Totally Not-So-Stubby Area or officially called Not-So-Stubby Totally Stubby Area (seriously). This combines the attributes of a Totally Stubby and a NSSA area. First you have the Totally Stubby in which Type 3 and 4 advertisements are not passed into the area (Everything outside of the area is found through a default gateway), but you can still connect an external route to the area by Type 7 LSA.
Why use this? Perhaps you have a remote site that you want to connect back by default route only, but it also has a backup DSL or Cable modem for local internet.
**Remember - Totally NSSA - Only Type 2 and 7 LSAs and default route.
Alright, I know I'm jumping around a lot here, but things come up in real life, in forums, in books, and in all the blogs I follow that gets me headed off on another track, so today I am talking about OSPF stub area types.
First, what are the types of OSPF Link State Advertisements? These are how OSPF routers communicate routes and route changes etc.
Type1 - Router - router announcing itself and lists links to other routers with metrics in the same area
Type2 - Network - lists what routers are connected by the broadcast segment.
Type3 - Net Summary - An Area Border Router summarizes one area, and sends it to other areas
Type4 - ASBR Summary - An ASBR summarizes external routes that are injected from another routing protocol
Type5 - AS External - Full network routes imported from other routing protocols
Type6 - Group Membership - A multicast advertisement that is not used in OSPFv3
Type7 - NSSA External - Routers in a not so stubby area (NSSA) send external routing information to the ABR to be redistributed (as type 5s to other areas)
There are 11 types, but these are the ones that affect stub areas for this discussion.
First, why use stub areas? Stub areas greatly minimize the traffic and routing table sizes of routers in these stub areas, increasing performance. (And area 0 can't be a stub of any sort)
First we start out with a stub area. A stub area allows Type 2 and Type 3 LSAs. Type 5 LSAs are not passed into the area. A default route is also passed in from the ABR.
Now, what does that mean, Type 2 and Type 3 LSAs allow the area routers to get inter and intra area routes. Routes in the same area are seen as usual, and the routes on the other side of your ABR is visible. Routes that are injected from other protocols, like static or EIGRP, are not advertised. To get to these, the router must use the default route.
**Remember - Stub= No type 5 LSAs and default route
Next we'll look at a Totally Stubby network. Only Type 2 LSAs and a default route are passed into the area (although technically the default route is a type 3... but thats the only one).
This means the routes inside the area are advertised, but all other destinations will use the default route. In other words, to a router in a Totally Stubby area, the ABR is the end of the world and everything not in it's own little area gets passed to the ABR to deal with.
**Remember - Totally Stubby - ONLY Type 2 LSAs and default route
Next we have Not-So-Stubby Areas. NSSAs have Type 2, Type 3, and Type 7 LSAs.
Type 7 LSAs are ONLY found in NSSAs. A NSSA is when you want your area to have external routes and be able to pass them to other areas, but not have other area's external routes imported into this area. In other words, local external routes are allowed, but not external routes from other areas. The ABR changes the Type 7 into a Type 5 when it passes it to other areas.
Cisco says: "NSSAs are more flexible than stub areas in that an NSSA can import external routes into the OSPF routing domain, thereby providing transit service to small routing domains that are not part of the OSPF routing domain."
**Remember - NSSA - Type 2, 3, and 7 LSAs with default route
Finally, we get to Totally Not-So-Stubby Area or officially called Not-So-Stubby Totally Stubby Area (seriously). This combines the attributes of a Totally Stubby and a NSSA area. First you have the Totally Stubby in which Type 3 and 4 advertisements are not passed into the area (Everything outside of the area is found through a default gateway), but you can still connect an external route to the area by Type 7 LSA.
Why use this? Perhaps you have a remote site that you want to connect back by default route only, but it also has a backup DSL or Cable modem for local internet.
**Remember - Totally NSSA - Only Type 2 and 7 LSAs and default route.
Labels:
NSSA,
OSPF,
Routing,
Stub area,
Totally NSSA,
Totally Stubby
Friday, June 18, 2010
EIGRP BASICS - Split Horizon/Route Poisoning
Split horizon, in EIGRP, affects the sending of update and query type packets.
Update packets contain route change information (sent reliably, needs ACK).
Query packets are sent when a router does not have a feasible successor which is a next hop router for a backup path (sent reliably, needs ACK).
Split Horizon is a way to prevent (minimize) routing loops. The logic is that if a router uses interface A to get to a destination, there is no reason to advertise that route out intA.
For example, if network 10.1.1.0/24's next hop router is located out fa0/0, then the router will not send update packets containing 10.1.1.0/24 out of fa0/0, only out fa0/1, fa0/2, etc.
If you think about it, if router A is your next hop to a network, why would you need to tell router A how to get to itself?
Split horizon is on by default on all interfaces.
If a router changes the interface it uses to get to a destination, it momentarily turns off split horizon and commits route poisoning. Route poisoning is when the router, in order to stop other routers from using its old route/cost that it just changed, floods out route unreachable packets. This causes other routers to flush that old route out of their routing tables so that the new route can now be successfully added.
Update packets contain route change information (sent reliably, needs ACK).
Query packets are sent when a router does not have a feasible successor which is a next hop router for a backup path (sent reliably, needs ACK).
Split Horizon is a way to prevent (minimize) routing loops. The logic is that if a router uses interface A to get to a destination, there is no reason to advertise that route out intA.
For example, if network 10.1.1.0/24's next hop router is located out fa0/0, then the router will not send update packets containing 10.1.1.0/24 out of fa0/0, only out fa0/1, fa0/2, etc.
If you think about it, if router A is your next hop to a network, why would you need to tell router A how to get to itself?
Split horizon is on by default on all interfaces.
If a router changes the interface it uses to get to a destination, it momentarily turns off split horizon and commits route poisoning. Route poisoning is when the router, in order to stop other routers from using its old route/cost that it just changed, floods out route unreachable packets. This causes other routers to flush that old route out of their routing tables so that the new route can now be successfully added.
Labels:
EIGRP,
Route Poisoning,
Routing,
Split Horizon
Thursday, June 17, 2010
EIGRP Basics - Hello Packets
Vocab:
IGRP: Interior Gateway Routing Protocol
EIGRP: Enhanced Interior Gateway Routing Protocol
AS: Autonomous System - a group of routers share an AS so they know they are part of a routing group or system and should share routes and form relationships within that group. A router can be a member of multiple AS's but must inject routes between them if the two groups wish to share common routes.
Cisco loves to ask questions on it's own proprietary protocols, so don't skip over something just because it isn't the most common protocol out there. (although it looks like IGRP is getting phased out)
EIGRP Hello Packets:
EIGRP sends hello packets to the multicast address 224.0.0.10 in order to create and maintain Neighbor relationships. These are not "reliable" packets and so do not expect an acknowledgement. When a router receives an EIGRP hello packet, it first checks three items. Assuming it is configured with:
1. The same AS
2. The Primary IP address is in the same subnet
3. The metric-calculation constants match (how it determines route cost/metrics)
Then a neighbor adjacency relationship will be established.
Over a fast link (greater than T1) Hello packets are sent every 5 seconds (default). Over a slow link (T1 or slower) Hello packets are sent every 60 seconds (default).
Hello packets include the hold time. This is the time a router waits, and if it doesn't receive any EIGRP packets from the neighbor switch, flushes the routes and attempts to re-converge deciding the neighbor is down. Hold time, by default is 3 times the hello interval. This means fast links have a hold time of 15 seconds, while slow links are 180 seconds. Remember that changing the hello time does NOT automatically change the hold time, you need to remember to change both.
Issue the command show ip eigrp neighbors to see if your hello packets have formed an adjacency.
IGRP: Interior Gateway Routing Protocol
EIGRP: Enhanced Interior Gateway Routing Protocol
AS: Autonomous System - a group of routers share an AS so they know they are part of a routing group or system and should share routes and form relationships within that group. A router can be a member of multiple AS's but must inject routes between them if the two groups wish to share common routes.
Cisco loves to ask questions on it's own proprietary protocols, so don't skip over something just because it isn't the most common protocol out there. (although it looks like IGRP is getting phased out)
EIGRP Hello Packets:
EIGRP sends hello packets to the multicast address 224.0.0.10 in order to create and maintain Neighbor relationships. These are not "reliable" packets and so do not expect an acknowledgement. When a router receives an EIGRP hello packet, it first checks three items. Assuming it is configured with:
1. The same AS
2. The Primary IP address is in the same subnet
3. The metric-calculation constants match (how it determines route cost/metrics)
Then a neighbor adjacency relationship will be established.
Over a fast link (greater than T1) Hello packets are sent every 5 seconds (default). Over a slow link (T1 or slower) Hello packets are sent every 60 seconds (default).
Hello packets include the hold time. This is the time a router waits, and if it doesn't receive any EIGRP packets from the neighbor switch, flushes the routes and attempts to re-converge deciding the neighbor is down. Hold time, by default is 3 times the hello interval. This means fast links have a hold time of 15 seconds, while slow links are 180 seconds. Remember that changing the hello time does NOT automatically change the hold time, you need to remember to change both.
Issue the command show ip eigrp neighbors to see if your hello packets have formed an adjacency.
Subscribe to:
Posts (Atom)
