3Facets
The fusion of technology, finance and personal growth
Sunday, January 30, 2011
The Junos 'generated route'
As an example, picture the two routers below connected by a point-to-point link:
CUST: AS65421
fxp0.0 10.12.0.0/31
lo0.0 1.1.1.1
ISP: AS503
fxp0.0 10.12.0.1/31
lo0.0 2.2.2.2
BGP is set up between the two nodes as follows:
1. ISP advertises only lo0 to CUST
policy-statement BGP-CUST-EXPORT {
from interface lo0.0;
then accept;
}
2. ISP accepts only AS65421 originated prefixes:
policy-statement BGP-CUST-IMPORT {
from as-path AS65421-ORIGIN;
then accept;
}
as-path AS65421-ORIGIN "^65421$";
3. CUST sends all direct routes to ISP and does not filter any inbound prefixes:
policy-statement BGP-EXPORT {
from protocol direct;
then accept;
}
Here we have full connectivity between the two nodes, however the CUST AS has no external routes:
root@CUST> show route terse | match /
* 1.1.1.1/32 D 0 >lo0.0
* 2.2.2.2/32 B 170 100 >10.12.0.1 503 I
* 10.12.0.0/31 D 0 >fxp0.0
* 10.12.0.0/32 L 0 Local
We can verify that by checking for a route to Google DNS:
root@CUST> show route 8.8.8.8
root@CUST>
CUST is planning on adding a second upstream ISP for failover and is planing on offering upstream connectivity to future downstream peers. To facilitate these business goals CUST decides to generate a default route based on connectivity to ISP's lo0 address (2.2.2.2/32). The decide to create a 0/0 generated route as follows:
routing-options {
generate {
route 0.0.0.0/0;
}
autonomous-system 65421;
}
Once this change has been committed their routing table looks like this:
root@CUST> show route terse | match /
* 0.0.0.0/0 A 130 >10.12.0.1
* 1.1.1.1/32 D 0 >lo0.0
* 2.2.2.2/32 B 170 100 >10.12.0.1 503 I
* 10.12.0.0/31 D 0 >fxp0.0
* 10.12.0.0/32 L 0 Local
Note the aggregate route for 0/0. Further scrutiny shows that the BGP prefix 2.2.2.2/32 from ISP is the contributing route:
root@CUST> show route 0.0.0.0/0 exact extensive
inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden)
0.0.0.0/0 (1 entry, 1 announced)
TSI:
KRT in-kernel 0.0.0.0/0 -> {10.12.0.1}
*Aggregate Preference: 130
Next hop type: Router, Next hop index: 541
Next-hop reference count: 4
Next hop: 10.12.0.1 via fxp0.0, selected
State: <Active Int Ext>
Local AS: 65421
Age: 8:53
Task: Aggregate
Announcement bits (1): 0-KRT
AS path: I
Flags: Generate Depth: 0 Active
Contributing Routes (1):
2.2.2.2/32 proto BGP
When the BGP advertisements from ISP are withdrawn, CUST loses their default route:
root@CUST> show route terse | match /
* 1.1.1.1/32 D 0 >lo0.0
* 10.12.0.0/31 D 0 >fxp0.0
* 10.12.0.0/32 L 0 Local
For now this meets the requirements of CUST, however here are some points to think on:
1. What happens if ISP loses their upstream connectivity?
2. When CUST adds another upstream connection how will they handle egress traffic?
Tuesday, December 14, 2010
Usernames, Passwords and AAA - The IOS Dilema
Tribbles(config)#username fuzzy privilege 15 ?
[snip]
password Specify the password for the user
privilege Set user privilege level
secret Specify the secret for the user
[snip]
What the heck is a secret? Perhaps an alternate rendering of this context sensitive help would be useful:
Cisco 7 hashing is easily reversible, and discouraged by Cisco.
Note: If you have a spare moment, decipher the Cisco 7 string on their KB page above to see what they really think of us :)
Now you are thinking "This is all well and good, and surprisingly well-written and entertaining, but I use a RADIUS/TACACS server. I don't need to worry about this...right?"
Cisco does recommend the use of Radius/TACACS+. Just make sure that you read the docs when creating the AAA policy (put the network authentication source before 'local').
Tribbles(config)#aaa authentication login test tacacs+ local
It is crucial to understand how IOS processes authentication attempts:
- With a network service listed before local, IOS attempts to locate the authentication server
- If successful, credentials are processed. If the user is found (regardless of correct credentials) the process will not continue to lower priority methods.
- If the user is not found, or if the network resource is unavailable IOS will continue down the list of aaa authentication.
Based on my (brief) testing it appears IOS 12.4 does add MD5 salt to the secrets, this may create some problems when auditing configurations:
Tribbles(config)#username salt secret pepper
Tribbles(config)#username seasalt secret pepper
Tribbles(config)#do sh run | i username
username salt secret 5 $1$L8kO$d0ZWXWnTOzcJ5Q43OqR2x1
username seasalt secret 5 $1$LZEf$RSfqWT3OZtb1xW.oXsNiA.
In closing:
- be sure to regularly rotate your passwords. Especially your local 'rescue' passwords
- check that your AAA authentication order is correct
- replace all Cisco 7 hashes with secrets (and change the passwords)
Monday, December 13, 2010
BGP Confederations, or “The private AS”
A BGP confederation is a group of iBGP speakers that acts as a disparate sub-AS within an organization.
- sub-optimal routing decisions, or
- overly complicated route manipulation.
5 Easy Ways to Stay Healthy and Productive
This is the first and foremost most important way to stay productive and happy. If you find yourself exploring thoughts or challenges that developed at work (in a healthy manner, not akin to always bringing home work) then you are doing well.
Over the years I have been able to easily single out people who:
- lack enthusiasm for what they are trying to accomplish, or
- consistently underperform their expectations and stagnate their careers.
This has become strikingly apparent among former coworkers of mine, who were working only for their paycheck. Perhaps you have seen this yourself at your local coffee shop or big box retail store; associates who clearly do not enjoy what they are doing. Sometimes you have to find enjoyment in the menial, yet necessary tasks of daily work.
2. Find a way to challenge yourself
Analogous to enjoyment, challenges are what define a career path instead of ‘just a job’. This can be better said as:
‘If you aren’t learning, why even bother coming to work?’
By challenging yourself at work you are helping yourself in many ways:
- helping with your enjoyment. Studies have correlated 'challenging' work environments with promoting better performance, and often better paid positions
- demonstrating to management that you are a candidate for advancement, as well as strengthening an argument for a pay raise
- finding enjoyment in what you do
3. Exercise
30 minutes a day, 4 days a week. When you think about this you have 168 hours in a week, and spending 2 of them exercising is around 1.2% of your time. This is probably less time than you spend commuting to work
Personally I prefer to ride a stationary cycle with my headphones and ebook reader.
There are some non-conventional in-home exercise techniques that have generated a lot of internet buzz:
Exercise can also be as simple as a walk around the block, it does not have to be striving to meet Tony Horton's level of fitness.
Please talk to your doctor before spontaneously beginning a rigorous exercise program.
4. Wake up early
The internet is awash with suggestions on how to wake up early:
- get a pet
- do yoga
- become more spiritual
- consume less caffeine
I do not have such lofty expectations.
For me, the easiest way to wake up early is to put an alarm clock in another room which forces me to turn on the light when it goes off. This also helps to keep me from jumping right back in bed.
I highly recommend "Clocky" as an effective alarm clock. (Note: It is really loud and sounds as described by one owner "R2D2 on crack")
Rising early won't work 100% of the time, some lapses are to be expected. Stick with it and you will have an extra hour or two in the morning to exercise or get into work early :)
5. Smaller, healthier meals
Aim for a balanced meal most of the time. Personally, I enjoy a good In-N-Out burger every once in a while and am a sucker for good pizza. The US government provides dietary guidelines in more than one place but it is easy to get lost in the mountainous texts.
I try to adhere to a few guidelines:
- more vegetables, less sauce
- whole grain whenever possible
- less red meat
- only a little cheese
- fruits, fruits, fruits
- cut back on sodas
From US Dietary Guidelines: "Beverages also contribute substantially to overall dietary and energy intake. Although they provide needed fluid, beverages often add calories to the diet without providing nutrient"
Do what you can, and remember you may even live longer :)
Sunday, December 12, 2010
Juniper: BGP Route Reflectors

BGP Route Reflectors, or “Disabling BGP split horizon”
One of the most dreaded stipulations of the Border Gateway Patrol, as taken directly from RFC4271:
“When a BGP speaker receives an UPDATE message from an internal peer,
the receiving BGP speaker SHALL NOT re-distribute the routing
information contained in that UPDATE message to other internal peers”
This presents quite a problem in organizations where the iBGP speakers are not all fully meshed, as seen below:
Imagine if this organization had 30 routers, or 230 routers--this would be impossible to setup and maintain.
There are two possible remedies. One is BGP confederations, the other is Route Reflectors (Henceforth referred to as RRs). A RR effectively disables the split-horizon mechanisms of BGP by allowing an iBGP speaker to advertise iBGP learner routes to other internal speakers. Documented in RFC2796, Route Reflectors are formally defined as “[a method of] alleviate the the need for "full mesh" IBGP” through “a BGP speaker advertising an IBGP learned route to another IBGP peer”
The effective use of RRs reduce the topology above to this:
This is an effective reduction in connections from (n2 - n) / 2 to n - 1, where n equals the number of iBGP speakers. For example, in the networks mentioned above with 30 and 230 speakers, they would be reduced from 435 to 29 connection and from 26335 to 229. The comparative graph of meshed connections to RRs is:
Now that the need for RRs is understood, the theory is quite simple:
1. A RR is peered with other iBGP speakers normally
2. The RR has a configuration option set to designate the downstream iBGP peers as RR clients
3. Non-client iBGP speakers peering with an RR is still subject to the non-transitive nature of iBGP to iBGP route advertisements
The term is self explanatory--The RR bounces routes down to the client speakers. The format of the advertisement is very similar to a standard BGP update:
As seen above the standard BGP update (with default attribute settings) contains the three well known mandatory attributes and two optionals: LOCAL_PREF and MED.
With the RR update, the inclusion of CLUSTER_LIST and ORIGINATOR. Not only do these signal the downstream router to add the route to its table, ignoring the iBGP rules. These attributes provide RR clusters with loop prevention.
Loop prevention in an RR topology is provided via:
1. The CLUSTER_ID BGP attribute. Each RR adds its cluster ID, which is by default the router ID (RID) of the RR, to route updates that are reflected to its downstream peers. This way routes do no become re-reflected into the cluster by way of redundant connections or multiple cluster RRs
2. ORIGINATOR_ID is labeled as the first iBGP speaker to advertise a prefix in a given AS. I a BGP speaker receives an advertisement with its own RID in said field, it discards the prefix.
3. Just as through normal operation of BGP, only the best routes are advertised to neighbors.
Configuration:
Easy as pie! All that needs to change is the addition of one statement per downstream peer in relation to the RR ‘server’. Here is the topology:
One of the spoke routers is advertising the network 33.3.3.3/29 into AS 503 via iBGP. Here is the BGP table on the RR server:
LolaBoat#sh ip bgp
BGP table version is 7, local router ID is 1.3.3.7
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.3.3.7/32 0.0.0.0 0 32768 i
*> 10.1.12.0/24 0.0.0.0 0 32768 i
*> 10.1.13.0/24 0.0.0.0 0 32768 i
*>i33.3.3.0/29 10.1.13.3 0 100 0 i
And the BGP table on the far spoke:
R2#sh ip bgp
BGP table version is 18, local router ID is 10.1.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.3.3.7/32 10.1.12.1 0 100 0 i
r>i10.1.12.0/24 10.1.12.1 0 100 0 i
*>i10.1.13.0/24 10.1.12.1 0 100 0 i
Note that the 33.3.3.0/29 prefix is missing. This is due to the hub router not advertising an iBGP learned route to another iBGP peer. We can see the hub is not advertising this route
LolaBoat#show ip bgp neighbors 10.1.12.2 advertised-routes
BGP table version is 9, local router ID is 1.3.3.7
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.3.3.7/32 0.0.0.0 0 32768 i
*> 10.1.12.0/24 0.0.0.0 0 32768 i
*> 10.1.13.0/24 0.0.0.0 0 32768 i
To fix this, the hub router is made into an RR. Please note this will drop any active BGP sessions:
LolaBoat(config)#router bgp 503
LolaBoat(config-router)#neighbor 10.1.12.2 route-reflector-client
*Mar 1 00:07:01.295: %BGP-5-ADJCHANGE: neighbor 10.1.12.2 Down RR client config change
*Mar 1 00:07:03.327: %BGP-5-ADJCHANGE: neighbor 10.1.12.2 Up
LolaBoat(config-router)#neighbor 10.1.13.3 route-reflector-client
LolaBoat(config-router)#
*Mar 1 00:07:16.467: %BGP-5-ADJCHANGE: neighbor 10.1.13.3 Down RR client config change
LolaBoat(config-router)#
*Mar 1 00:07:18.611: %BGP-5-ADJCHANGE: neighbor 10.1.13.3 Up
Now the RR (formerly referred to as the hub) will advertise the 33.3.3.0/29 prefix to the far spoke router:
LolaBoat#show ip bgp neighbors 10.1.12.2 advertised-routes
BGP table version is 11, local router ID is 1.3.3.7
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.3.3.7/32 0.0.0.0 0 32768 i
*> 10.1.12.0/24 0.0.0.0 0 32768 i
*> 10.1.13.0/24 0.0.0.0 0 32768 i
*>i33.3.3.0/29 10.1.13.3 0 100 0 i
And on the far spoke, success!
R2#sh ip bgp
BGP table version is 26, local router ID is 10.1.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.3.3.7/32 10.1.12.1 0 100 0 i
r>i10.1.12.0/24 10.1.12.1 0 100 0 i
*>i10.1.13.0/24 10.1.12.1 0 100 0 i
*>i33.3.3.0/29 10.1.13.3 0 100 0 i
You can see that the 33.3.3.0/29 prefix was reflected by closer inspection. The cluster list is present and is equal to the Loopback0 of the RR:
R2#sh ip bgp 33.3.3.0
BGP routing table entry for 33.3.3.0/29, version 26
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
Local
10.1.13.3 from 10.1.12.1 (1.3.3.7)
Origin IGP, metric 0, localpref 100, valid, internal, best
Originator: 10.1.13.3, Cluster list: 1.3.3.7
This can be changed on the RR simply (remember the decimal value will be converted to binary):
LolaBoat(config)#router bgp 503
LolaBoat(config-router)#bgp cluster-id 8675309
R2#sh ip bgp 33.3.3.0 | i Cluster
Originator: 10.1.13.3, Cluster list: 0.132.95.237
That is all for now. Stay tuned for a post detailing this in Junos as opposed to Cisco IOS :)
Introduction
3Facets? My professional skills lie in the realms of system administration and network engineering, with continuing growth in the networking realm. I have an interest in finance and social economics (Especially after reading Freakonomics and Super Freakonomics). These 3Facets will be manifested in further posts in an attempt to better not only myself, but also my readers /m |