<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
	<channel>
<title>Oliver Lagni&#x27;s Study blog</title><link>http://www.lagni.com/index.html</link><description>Oliver Lagni&#x27;s Study blog</description><dc:language>it</dc:language><dc:creator>oliver@lagni.com</dc:creator><dc:rights>Copyright 2008 Oliver Lagni</dc:rights><dc:date>2008-12-19T07:23:13+01:00</dc:date><admin:generatorAgent rdf:resource="http://www.realmacsoftware.com/" />
<admin:errorReportsTo rdf:resource="mailto:oliver@lagni.com" /><sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<lastBuildDate>Fri, 19 Dec 2008 07:27:31 +0100</lastBuildDate><item><title>lab 003 - BGP - Multiple ASs with Multiple Providers.jpg</title><dc:creator>oliver@lagni.com</dc:creator><category>BGP</category><dc:date>2008-12-19T07:23:13+01:00</dc:date><link>http://www.lagni.com/studyblog/files/b298f4b864e0a3b53179fe93dd9ec205-2.html#unique-entry-id-2</link><guid isPermaLink="true">http://www.lagni.com/studyblog/files/b298f4b864e0a3b53179fe93dd9ec205-2.html#unique-entry-id-2</guid><content:encoded><![CDATA[<span style="font:12px Times, Georgia, Courier, serif; "><br /></span><img class="imageStyle" alt="lab003 - BGP - Multiple ASs with Multiple Providers" src="http://www.lagni.com/studyblog/files/page5_blog_entry2_1.jpg" width="600" height="377"/><br /><br /><br /> 1 &ndash; This is the default BGP behavior. Just turn on BGP, configure it correctly and everything is ok. No really worries about this.<br /><br />2 &ndash; Same for this point, this is the default BGP behavior. <br /><br />3 &ndash; For the first part: this is the default BGP behavior. (hey this lab seems too easy!). For the second part: we don&rsquo;t want AS4 to go to AS2 via AS1 unless link between AS4 and AS3 is down. We can reach this target using local preference. But anyway we also want to use the community attribute for simplify the policy for adding new customers. <br /><br />So let&rsquo;s do this conf in RTC: <br /><br />router bgp 1<br />network 192.68.11.0<br />neighbor 172.16.20.2 remote-as 4<br />neighbor 172.16.20.2 send-community<br />neighbor 172.16.20.2 route-map setcommunity out<br />neighbor 192.68.6.1 remote-as 2<br />no auto-summary<br /><br />route-map setcommunity permit 10<br />set community 4:40<br /><br />Let&rsquo;s start with the route map setcommunity: we are just going to set a community, nothing more.<br /><br />The same mirrored configuration should be applied to RTD. <br /><br />Now let&rsquo;s go to configure some actions if we are going to see this community coming to our AS4. <br /><br />This is what we should do to into RTA:<br /><br />router bgp 4<br />network 172.16.220.0 mask 255.255.255.0<br />neighbor 172.16.1.2 remote-as 3<br />neighbor 172.16.1.2 route-map CHECK_COMMUNITY in<br />neighbor 172.16.20.1 remote-as 1<br />neighbor 172.16.20.1 route-map CHECK_COMMUNITY in<br />no auto-summary<br />ip community-list 2 permit 4:40<br />ip community-list 3 permit 4:60<br />route-map CHECK_COMMUNITY permit 10<br />match community 2<br />set local-preference 40<br />route-map CHECK_COMMUNITY permit 20<br />match community 3<br />set local-preference 60<br />route-map CHECK_COMMUNITY permit 30<br />set local-preference 100<br /><br />With the commands above we are just checking if from our neighbors in RTA we are receiving some routes with the community attributes. If so we do set<br /><br />-	a local preference of 40 if community is 4:40<br />-	a local preference of 60 if community is 4:60<br />-	a local preference of 100 by default<br /><br /><br />Then we will proceed setting up the RTF router: <br /><br />router bgp 3<br />network 172.16.10.0 mask 255.255.255.0<br />network 172.16.65.0 mask 255.255.255.192<br />neighbor 172.16.1.1 remote-as 4<br />neighbor 172.16.1.1 send-community<br />neighbor 172.16.1.1 route-map setcommunity out<br />neighbor 192.68.5.2 remote-as 2<br />no auto-summary<br />route-map setcommunity permit 10<br />set community 4:60<br /><br />In a nutshell all the routes from RTF are tagged with community 4:60 and they are going to have a preference of 60 in RTA.<br /><br />Let&rsquo;s check what is the result of this configuration:<br /><br />RTA#sh ip bgp <br />BGP table version is 11, local router ID is 172.16.2.254<br />Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,<br />              r RIB-failure, S Stale<br />Origin codes: i - IGP, e - EGP, ? - incomplete<br /><br />   Network          Next Hop            Metric LocPrf Weight Path<br />*  172.16.1.0/24    172.16.1.2               0     60      0 3 i<br />*> 				0.0.0.0                  0         32768 i<br />*> 172.16.2.0/24    0.0.0.0                  0         32768 i<br />*  172.16.10.0/24   172.16.20.1                    40      0 1 2 3 i<br />*>                  		172.16.1.2               0     60      0 3 i<br />*  172.16.20.0/24   172.16.20.1              0     40      0 1 i<br />*>                  		0.0.0.0                  0         32768 i<br />*  172.16.65.0/24   172.16.20.1                    40      0 1 2 3 i<br />*>                  		172.16.1.2               0     60      0 3 i<br />*> 172.16.220.0/24  0.0.0.0                  0         32768 i<br />*  192.68.5.0       172.16.20.1                    40      0 1 2 i<br />*>                  	172.16.1.2               0     60      0 3 i<br />*  192.68.6.0       172.16.20.1                    40      0 1 2 i<br />*>                  	172.16.1.2                     60      0 3 2 i<br />*  192.68.10.0      172.16.20.1                    40      0 1 2 i<br />*>                  	172.16.1.2                     60      0 3 2 i<br />*> 192.68.11.0      172.16.1.2                     60      0 3 2 1 i<br />   Network          Next Hop            Metric LocPrf Weight Path<br />*                   	172.16.20.1              0     40      0 1 i<br /><br /><br />From this show ip bgp I can see: <br /><br />172.16.10.0 and 172.16.10.65 with two paths and we don&rsquo;t want this. We don&rsquo;t want AS4 able to reach AS3 via AS1 and AS2.  Anyway we can observe that one route has a preference of 40 and the other of 60. <br /><br />Same for 192.68.10.0: one route has 60 and the other 40. The best path is through AS3 and we want this. <br /><br />Next step is going to be work with path filtering.<br /><br />4 &ndash; AS AS4 should not be able to reach AS3 via AS1 and AS2. <br /><br />For reaching this target we are going to use the ip as-path access lists:<br /><br />ip as-path access-list 2 permit _2_<br />ip as-path access-list 10 permit ^$<br />ip as-path access-list 10 permit ^2$<br /><br />Ther first one, the number 2, is going to match all the routes with 2 in the AS path. <br />The as-path access list 10 is going to match local routes and routes with 2 as per last AS in the path. <br /><br />Then we have to apply a filter list that matches this conditions: <br /><br />Router bgp 1<br />neighbor 172.16.20.2 filter-list 10 out<br /><br />and then let&rsquo;s go to apply the community 4:40 only for the matches in ip as-path access-list 2: <br /><br />route-map setcommunity permit 10<br /> match as-path 2<br /> set community 4:40     <br />route-map setcommunity permit 20<br /><br />The same configuration, but mirrored, has to be applied on RTD.<br /><br />After a clear ip bgp * we can see the final result: <br /><br />RTA#sh ip bgp <br />BGP table version is 13, local router ID is 172.16.2.254<br />Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,<br />              r RIB-failure, S Stale<br />Origin codes: i - IGP, e - EGP, ? - incomplete<br /><br />   Network          Next Hop            Metric LocPrf Weight Path<br />*> 172.16.1.0/24    0.0.0.0                  0         32768 i<br />*                   	172.16.1.2               0     60      0 3 i<br />*> 172.16.2.0/24    0.0.0.0                  0         32768 i<br />*> 172.16.10.0/24   172.16.1.2               0     60      0 3 i<br />*  172.16.20.0/24   172.16.20.1              0    100      0 1 i<br />*>                  	0.0.0.0                  0         32768 i<br />*> 172.16.65.0/24   172.16.1.2               0     60      0 3 i<br />*> 172.16.220.0/24  0.0.0.0                  0         32768 i<br />*  192.68.5.0       172.16.20.1                    40      0 1 2 i<br />*>                 	 172.16.1.2               0     60      0 3 i<br />*  192.68.6.0       172.16.20.1                    40      0 1 2 i<br />*>                  	172.16.1.2                     60      0 3 2 i<br />*  192.68.10.0      172.16.20.1                    40      0 1 2 i<br />*>                 	 172.16.1.2                     60      0 3 2 i<br />*> 192.68.11.0      172.16.20.1              0    100      0 1 i<br /><br />So: <br /><br />172.16.10.0 and 172.16.65.0 are reachable only via RTF with a preference of 60<br />192.68.10.0 is reachable via two ways but with highest preference via AS3<br />AS4 cannot reach AS3 via customer&rsquo;s ASs. <br /><br />If you are doing this lab and you need some info don&rsquo;t hesitate to leave a comment.<br /><br />Net file for GNS3:<br /><br /><a href="http://www.lagni.com/studyblog/files/page5_blog_entry2_2.net">lab003 - BGP - Multiple ASs with Multiple Providers</a><br /><br />Config files:<br /><br /><a href="http://www.lagni.com/studyblog/files/page5_blog_entry2_3.cfg">RTF</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry2_4.cfg">RTA</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry2_5.cfg">RTC</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry2_6.cfg">RTD</a><br /><br />]]></content:encoded></item><item><title>lab 001 - BGP - Multiple_Providers-Default_Primary_and_Backup_FullPartial</title><dc:creator>oliver@lagni.com</dc:creator><category>BGP</category><dc:date>2008-12-14T18:20:54+01:00</dc:date><link>http://www.lagni.com/studyblog/files/8c086ffc8f4ce17449ef949cecca0162-1.html#unique-entry-id-1</link><guid isPermaLink="true">http://www.lagni.com/studyblog/files/8c086ffc8f4ce17449ef949cecca0162-1.html#unique-entry-id-1</guid><content:encoded><![CDATA[<img class="imageStyle" alt="Multiple_Providers-Default_Primary_and_Backup_FullPartial" src="http://www.lagni.com/studyblog/files/page5_blog_entry1_1.jpg" width="776" height="664"/><br /><br />As you can see from the title this is a lab where AS3 is our AS, then there are AS1 and AS2 that are our providers and then some other ASs.<br />Target of this lab is:<br /><br />1 - having the network 172.16.10.0 and 172.16.65.0 reachable from NY link (path preferred)<br />2 - having the network 172.16.220.0 reachable from the SF link (path preferred)<br />3 - having AS3 not a transit network for AS1 and AS2<br />4 - having AS3 from the SF link that allows only AS1 and directly AS1 attached AS's routes (AS3 SF link accepts only AS1 and AS7 routes)<br /><br />1: having the network 172.16.10.0 and 172.16.65.0 reachable from NY link (path preferred)<br /><br />RTA:<br />Create an access list that permits the traffic we need 172.16.10.0/24 and 172.16.65.0/24  <br /><br />access-list 1 permit 172.16.10.0 0.0.0.255<br />access-list 1 permit 172.16.65.0 0.0.0.255<br /><br />then create a route-map that matches this traffic and prepends 3 3 3 3 (one 3 of course is enough, I used 4 just for having a better visibility in the show commands)<br /><br />route-map PREPEND_PATH permit 10<br /> match ip address 1<br /> set as-path prepend 3 3 3 3<br />route-map PREPEND_PATH permit 20<br /><br />then apply the route-map into the BGP router process<br /><br />router bgp 3<br /> neighbor 172.16.20.1 route-map PREPEND_PATH out<br /><br /><br />2: having the network 172.16.220.0 reachable from the SF link (path preferred)<br /><br />RTF:<br />Same story here but creating an access list for the ip <br /><br />access-list 1 permit 172.16.220.0 0.0.0.255<br /><br /><br />3:  having AS3 not a transit network for AS1 and AS2<br /><br />Quite easy to reach using the regular expressions. We just need to create an ip as-path access list and match it using a route-map<br /><br />ip as-path access-list 2 permit ^$<br /><br />Regular expression ^$ allows only local routes.<br /><br />Then we can match this rule in the previously created route-map:<br /><br />route-map PREPEND_PATH permit 20<br /> match as-path 2<br /><br />We have to do the same in RTF<br /><br />4:  having AS3 from the SF link that allows only AS1 and directly AS1 attached AS's routes (AS3 SF link accepts only AS1 and AS7 routes)<br /><br />We can reach this target using another regular expression:<br /><br />ip as-path access-list 1 permit ^1 ?[0-9]*$<br /><br />and then<br /><br />route-map ACCEPT_LOCAL permit 10<br /> match as-path 1<br /><br />and then<br /><br />router bgp 3<br /> neighbor 172.16.20.1 route-map ACCEPT_LOCAL in<br /><br />Regular expression ^1 ?[0-9]*$ means:<br /><br />^1	--> a list of ASs that starts with number 1<br />?   	--> means that it can matches zero or one occurrences of the pattern<br />[0-9] 	--> designates a range of single-character patterns<br />* 	--> matches zero or more sequences of the pattern<br />$ 	--> matches the end of the input string<br /><br />You can easily verify what a reg exp matches using the command show ip bgp regexp ^1 ?[0-9]*$<br /><br />Pay attention that '?' is reproducible with a CTRL-V pressed before the question mark.<br /><br />I would omit the show command results. Target are well described. If you are doing this lab and you need info don't hesitate to leave a comment.<br /><br /><br />net file for GNS3: <a href="http://www.lagni.com/studyblog/files/page5_blog_entry1_2.net">Multiple_Providers-Default_Primary_and_Backup_FullPartial</a><br />Config files:<br /><br /><a href="http://www.lagni.com/studyblog/files/page5_blog_entry1_3.cfg">RTA</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry1_4.cfg">RTF</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry1_5.cfg">RTD</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry1_6.cfg">RTC</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry1_7.cfg">RTH</a> <a href="http://www.lagni.com/studyblog/files/page5_blog_entry1_8.cfg">RTG</a>]]></content:encoded></item><item><title>Hello (Cisco) World</title><dc:creator>oliver@lagni.com</dc:creator><dc:subject>Study Blog</dc:subject><dc:date>2008-12-14T10:12:15+01:00</dc:date><link>http://www.lagni.com/studyblog/files/db1752b0cf93fe2651ae24f440369fc0-0.html#unique-entry-id-0</link><guid isPermaLink="true">http://www.lagni.com/studyblog/files/db1752b0cf93fe2651ae24f440369fc0-0.html#unique-entry-id-0</guid><content:encoded><![CDATA[Hello Cisco guys! <br />This blog is not for you but mainly it's for me! <br />I'd like to use this blog as a study tool. <a href="http://ardenpackeer.com/study-tips/study-tip-ccieblog-blogging-as-a-study-tool/" rel="external">Someone</a> says that this is a very uself way for improving the skills so let's try it!.<br />First of all, my English is not perfect and it is not my intent to have a perfect English in this blog. I am pretty sure I will have to sacrifice my sleeping hours as well as my lunch breaks for maintain this blog, and I won't spend to much time for having a perfect blog. Please consider it as a draft. On the other side I will try to do my best for having quite clear configurations and samples of Cisco excerices I am going to do. This is the scope of this blog, blogging my excercise, this will help mainly me for understanding what I am doing.<br />Thi s blog is purely technical, if you are not a Cisco guy don't expect to understand!<br />Just for a short presentation: I am CCNA/CCNP certified and at the present I am studying BGP. Then I will move to MPLS and finally to QoS for reaching the CCIP certification. All the labs are done with <a href="http://www.gns3.net" rel="external">GNS3</a><br />Any comment and remark is very welcome!<br />Let's start!<br /><br />]]></content:encoded></item></channel>
</rss>