{"id":264,"date":"2020-08-23T17:32:36","date_gmt":"2020-08-23T16:32:36","guid":{"rendered":"http:\/\/www.labtinker.net\/?p=264"},"modified":"2020-08-23T17:32:36","modified_gmt":"2020-08-23T16:32:36","slug":"its-raining-lsas","status":"publish","type":"post","link":"http:\/\/18.135.13.153\/?p=264","title":{"rendered":"It&#8217;s raining LSAs."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I generally work with security devices and my knowledge on routing protocols gets rusty as I don&#8217;t do much with them. However, we\u2019re all supposed to be full-spectrum engineers these days which was brought home to me when I went to an interview a couple of years ago and was asked some questions in this arena&#8230;and ummed and arred. Anyways, long story short, to refresh my knowledge I did some dabbling with OSPF and BGP and came up with a lab to catch every(ish) type of OSPF LSA . <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every router that connects to a given OSPF area should learn the same topology  from multiple LSAs (Link State Advertisements) which are multicast from other routers. This information is then stored in a LSDB. (Link State Database). The LSAs come in different types roughly summarised as follows:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LSA Types<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Router\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/li>\n\n\n\n<li>Network\u00a0\u00a0\u00a0\u00a0\u00a0<\/li>\n\n\n\n<li>Net-Summary (ABRs \u2013 defines links and subnets)<\/li>\n\n\n\n<li>ASBR Summary \u2013 advertises host route to reach ASBR<\/li>\n\n\n\n<li>AS External<\/li>\n\n\n\n<li>Group Membership for MOSPF<\/li>\n\n\n\n<li>NSSA External<\/li>\n\n\n\n<li>Link LSAs<\/li>\n\n\n\n<li>Intra-Area prefix<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">This is the lab topology (running in GNS3) with mutliple routers running Cisco IOSv image. It was adapted to do other things as well as I recall so it\u2019s bigger (and smaller \u2013 more later) than it needs to be. Also the &#8216;BGP Areas&#8217; should really be labelled &#8216;BGP Autonomous Systems&#8217; &#8211; I only noticed this mistake after I&#8217;d torn the lab down. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"232\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-1.png\" alt=\"\" class=\"wp-image-265\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-1.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-1-300x116.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 1: LSA hunting ground.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">All the routers have loopbacks with ip addresses based on their name: R10 has 1.1.1.1, R20 has 2.2.2.2 etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The other interfaces are addressed: 192.168.&lt;area&gt;.&lt;loopback last octet&gt; &nbsp;so R10\u2019s Gi0\/0 interace is addressed 192.68.1.1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LSA Type 1-5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An LSA Type 1 is the router advertising itself. Let\u2019s choose a connection between any two routers running OSPF and capture the packets between them using Wireshark. (You can use \u2018<em>show ip ospf database<\/em>\u2019 on the router to get an idea of the LSA\u2019s received but I prefer to see them on the wire.)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"397\" height=\"112\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-2.png\" alt=\"\" class=\"wp-image-266\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-2.png 397w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-2-300x85.png 300w\" sizes=\"auto, (max-width: 397px) 100vw, 397px\" \/><figcaption class=\"wp-element-caption\">Figure 2: Out with the Wireshark magnifying glasss.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> At first, I just saw lots of OSPF hellos as this needy little protocol reassures its neighbours that it\u2019s still there:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"118\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-3.png\" alt=\"\" class=\"wp-image-267\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-3.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-3-300x59.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 2: Hello, is it me you&#8217;re looking for?<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So we probably need to prod something to trigger some updates&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"225\" height=\"46\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-4.png\" alt=\"\" class=\"wp-image-268\"\/><figcaption class=\"wp-element-caption\">Figure 3: Don&#8217;t prod in Prod.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Doing this generated a lot of interesting new traffic. Wireshark has some display filters which correspond to our LSA types by name,the first being <em>ospf.lsa.router<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"100\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-5.png\" alt=\"\" class=\"wp-image-269\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-5.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-5-300x50.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 4: Gotcha!<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We\u2019ve bagged an LSA type 1.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"197\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-6.png\" alt=\"\" class=\"wp-image-270\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-6.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-6-300x98.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 5: LSA Type 1<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I won\u2019t go overboard on detail on what all these LSA\u2019s do because this man has\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/www.firewall.cx\/networking-topics\/routing\/ospf-routing-protocol\/1178-ospf-lsa-types-explained.html\">http:\/\/www.firewall.cx\/networking-topics\/routing\/ospf-routing-protocol\/1178-ospf-lsa-types-explained.html<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2026but essentially the router is adverting its own interfaces\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Onwards and upwards, let&#8217;s try <em>ospf.lsa.network<\/em> in the Wireshark filter window&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"97\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-7.png\" alt=\"\" class=\"wp-image-271\" style=\"width:602px;height:97px\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-7.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-7-300x48.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 6: R30 sending out an OSPF LS Update<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Got one. In fact, this LS Update contains multiple LSA Types. It has a LSA Type-1 and also&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"96\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-8.png\" alt=\"\" class=\"wp-image-272\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-8.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-8-300x48.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 7: Two down.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;which is generated by the designated router for the Area (R30 &#8211; OSPF id 3.3.3.3)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"88\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-9.png\" alt=\"\" class=\"wp-image-273\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-9.png 456w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-9-300x58.png 300w\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" \/><figcaption class=\"wp-element-caption\">Figure 8: R30 is the DR<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;and also tucked away in there is&#8230;. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"126\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-10.png\" alt=\"\" class=\"wp-image-274\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-10.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-10-300x63.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 9: The LS Update that keeps on giving.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">LSA Type 3s are generated by ABRs which straddle two  OSPF areas and as R30 straddles Area 1 and  Area 0 that makes sense. But we&#8217;re not finished yet&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"171\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-11.png\" alt=\"\" class=\"wp-image-275\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-11.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-11-300x85.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 10: Type 4<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">LSA Type 4s advertise the presence of as ASBR (Autonomous System Border Router) which covers R50 and R60 as they&#8217;re re-distributing BGP. And is there more&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"178\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-12.png\" alt=\"\" class=\"wp-image-276\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-12.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-12-300x89.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><figcaption class=\"wp-element-caption\">Figure 11: Type 5<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Again from the ASBRs advertising externally re-disributed routes. (Seriously, read the link above as I know my explanations are sketchy)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OK let\u2019s excuse ourselves from looking for Type 6s as these are for multicast OSPF, not widely used, nor apparently supported by Cisco.  Which just leaves us Type 7s (there are more types but they&#8217;re for more abstruse purposes and beyond the scope of this post)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LSA Type 7s<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now these are a rarer beast \u2013 and the lab will need a little jerry-rigging to catch one<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LSA Type 7s are created by ASBRs to inject into an NSSA (Not-So Stubby Areas). Our current ASBRs are on the edge of Area 0 \u2013 and as  Area 0 rules and connects to all other areas it cannot be an NSSA. So we\u2019re going to have to latch a new area on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now as I was doing this it occurred to me I was also a little shaky on the difference between stubby and NSSA. One google search took me here:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/community.cisco.com\/t5\/switching\/difference-between-ospf-stub-and-nssa-area\/td-p\/945048\">https:\/\/community.cisco.com\/t5\/switching\/difference-between-ospf-stub-and-nssa-area\/td-p\/945048<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Essentially, it&#8217;s a a stub as far as OSPF is concerned but is allowed to connect to the outside world. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"294\" height=\"286\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-15.png\" alt=\"\" class=\"wp-image-279\"\/><figcaption class=\"wp-element-caption\">Figure 12: OSPF NSSA Area 3<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I updated the OPSF config as follows on R60. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>router-id 6.6.6.6<br><strong>area 3 nssa default-information-originate<\/strong><br>network 6.6.6.0 0.0.0.255 area 0<br>network 192.168.0.0 0.0.0.255 area 0<strong><br>network 192.168.3.0 0.0.0.255 area 3<\/strong><br>default-information originate<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And on R90 it was all new<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>router ospf 1<br>router-id 9.9.9.9<br>area 3 nssa<br>network 9.9.9.0 0.0.0.255 area 3<br>network 192.168.3.0 0.0.0.255 area 3<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And then re-setting the ospf process as above&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"177\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-16.png\" alt=\"\" class=\"wp-image-280\" srcset=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-16.png 602w, http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/image-16-300x88.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here are the configs if you&#8217;re interested.  Apologies, my WordPress console won&#8217;t allow zips:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R10.txt\">R10<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R10.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R20.txt\">R20<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R20.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R30.txt\">R30<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R30.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R40.txt\">R40<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R40.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R50.txt\">R50<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R50.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R60.txt\">R60<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R60.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R70.txt\">R70<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R70.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R80.txt\">R80<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R80.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n\n\n\n<div class=\"wp-block-file\"><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R90.txt\">R90<\/a><a href=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2020\/08\/R90.txt\" class=\"wp-block-file__button wp-element-button\" download>Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I generally work with security devices and my knowledge on routing protocols gets rusty as I don&#8217;t do much with them. However, we\u2019re all supposed to be full-spectrum engineers these days which was brought home to me when I went to an interview a couple of years ago and was asked some questions in this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-networking"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264"}],"version-history":[{"count":0,"href":"http:\/\/18.135.13.153\/index.php?rest_route=\/wp\/v2\/posts\/264\/revisions"}],"wp:attachment":[{"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/18.135.13.153\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}