{"id":10084,"date":"2022-05-09T15:36:00","date_gmt":"2022-05-09T18:36:00","guid":{"rendered":"http:\/\/made4it.com.br\/how-to-configure-blackhole-in-cisco-ios-xe\/"},"modified":"2023-02-13T11:39:42","modified_gmt":"2023-02-13T14:39:42","slug":"how-to-configure-blackhole-in-cisco-ios-xe","status":"publish","type":"post","link":"https:\/\/made4it.com.br\/en\/how-to-configure-blackhole-in-cisco-ios-xe\/","title":{"rendered":"How to Configure Blackhole on Cisco IOS-XE"},"content":{"rendered":"\n<p>Now that you know what a <strong>BGP<\/strong> <strong>Blackhole<\/strong> is <a href=\"https:\/\/www.made4it.com.br\/rtbh-blackhole-o-que-e\/\">(if you still don&#8217;t know, check out our article on RTBH \u2013 Blackhole).<\/a> Now it&#8217;s time to configure it and be able to protect yourself from DDoS attacks.<\/p>\n\n<p>To summarize the Blackhole, <strong>it is a technique of sending a route to the \u201cblack hole\u201d or simply making the router discard packets directed to that IP.<\/strong> With Blackhole you can also announce these attacked IPs to your suppliers\/upstreams and thus stop the attacks.<\/p>\n\n<p>Now that I know what it is, now comes the question, how to blackhole my router? In today&#8217;s article we will show you <strong>how to configure Blackhole on Cisco routers<\/strong><\/p>\n\n<p>\n          <strong>To do the Blackhole manually we have some steps that are:<\/strong>\n        <\/p>\n\n<ol class=\"wp-block-list\"><li>Identify the attacked IP;<\/li><li>Create the route to blackhole;<\/li><li>Advertise this blackhole route via BGP to your carriers\/upstreams.<\/li><\/ol>\n\n<p>You can automate all of this with <a href=\"https:\/\/www.made4it.com.br\/made4flow-analisador-de-netflow\/\">Made4Flow<\/a>, already closing a direct session and not having to do manual work.<\/p>\n\n<p>Let&#8217;s go to the settings then<\/p>\n\n<p>\n          <strong>1 \u2013 Identify the attacked IP<\/strong>\n        <\/p>\n\n<p>You can do this through Netflow analysis, as in Made4Flow, through the graphs and identify through the Raw Data Report, which IP has the most traffic and possibly being the victim of the attack.<\/p>\n\n<p>Within Made4Flow, access, for example, the Interface Graph by Application, then, by clicking on the most used port, you can identify which IP is being attacked, or through Made4Flow, simply by accessing the Anti-DDoS module -&gt; Active Anomalies.<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"940\" height=\"381\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image.png\" alt=\"\" class=\"wp-image-2121\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image.png 940w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-300x122.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-768x311.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n<p>The attacked IP was: 200.189.56.55 (Example)<\/p>\n\n<p><strong><strong>2) Create a route to Blackhole or Null0<\/strong><\/strong><\/p>\n\n<p>After identifying the attacked IP via Made4Flow, now it&#8217;s time to create the route on your Cisco Router to effectively throw the IP to Blackhole or Null0.<\/p>\n\n<p>Let&#8217;s assume that the attacked IP is 200.200.200.1, let&#8217;s create the route as follows<\/p>\n\n<p>Commands applied:<\/p>\n\n<pre class=\"wp-block-preformatted\">enable<br\/>configure terminal<br\/>ip route 200.200.200.1 255.255.255.255 Null0<\/pre>\n\n<p>After applying the route pointing to Null0 this IP will <strong>STOP WORKING!<\/strong><\/p>\n\n<p>You can check the route using the show command:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-1.png\"><img decoding=\"async\" width=\"608\" height=\"163\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-1.png\" alt=\"\" class=\"wp-image-2122\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-1.png 608w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-1-300x80.png 300w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/a><\/figure>\n\n<p>If the route is showing as Null0 then you are already sending it to Blackhole.<\/p>\n\n<p>\n          <strong>3 \u2013 Advertise the IP in blackhole via BGP to your operators\/upstreams<\/strong>\n        <\/p>\n\n<p>After identifying and blackhole the route, you need to advertise via BGP to your carriers\/upstreams.<\/p>\n\n<p>Note: Before setting up, it is always recommended to talk to your Operator\/Upstream to find out which Blackhole BGP community is.<\/p>\n\n<p>The BGP session with your carrier needs to be established.<\/p>\n\n<p>For this we have a few steps:<\/p>\n\n<p>\n          <strong>Configure your Carrier\/Upstream Blackhole Community<\/strong>\n        <\/p>\n\n<p>To configure the blackhole community to be used later, we need to run the following command:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-2.png\"><img decoding=\"async\" width=\"617\" height=\"141\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-2.png\" alt=\"\" class=\"wp-image-2123\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-2.png 617w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-2-300x69.png 300w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/a><\/figure>\n\n<p>Commands:<\/p>\n\n<pre class=\"wp-block-preformatted\">ip prefix-list BLACKHOLE permit 200.200.200.1\/32<br\/>route-map BLACKHOLE permit<br\/>match ip address prefix-list BLACKHOLE<br\/>set community 666:666<\/pre>\n\n<p> set community 666:666<\/p>\n\n<p>In case it is necessary to add more communities, apply the same command changing the community name and number.<\/p>\n\n<p>\n          <strong>Tip: Talk to your operator to find out which BGP blackhole community they use.<\/strong>\n        <\/p>\n\n<p>Announce the attacked IP with the BlackHole community for Upstream<\/p>\n\n<p>To carry out the advertisement of the attacked IP with the blackhole community, it is necessary to carry out the following steps;<\/p>\n\n<p>Enter the Cisco router&#8217;s BGP configuration<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"31\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-3.png\" alt=\"\" class=\"wp-image-2124\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-3.png 681w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-3-300x14.png 300w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/><\/a><\/figure>\n\n<p>After that, we announce the attacked IP to our Upstream, using the command below;<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"31\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-4.png\" alt=\"\" class=\"wp-image-2125\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-4.png 875w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-4-300x11.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-4-768x27.png 768w\" sizes=\"(max-width: 875px) 100vw, 875px\" \/><\/a><\/figure>\n\n<p>Commands:<\/p>\n\n<pre class=\"wp-block-preformatted\">router bgp 65000<br\/>neighbor 192.168.100.1 as 64700<br\/>neighbor 192.168.100.1 route-map BLACKHOLE out<\/pre>\n\n<p class=\"has-text-align-center\">\n          <strong>Automating with Made4Flow<\/strong>\n        <\/p>\n\n<p>With Made4Flow, it is possible to automate the blackhole announcement process of attacked IPs.<\/p>\n\n<p>For that we need:<\/p>\n\n<ol class=\"wp-block-list\"><li>Configure the BGP session between the Edge Router and Made4Flow;<\/li><\/ol>\n\n<p>To configure the BGP session between the Router and Made4Flow, you need to create a route-map and then the BGP session.<\/p>\n\n<p>To configure the route-map:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"58\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-5.png\" alt=\"\" class=\"wp-image-2126\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-5.png 406w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-5-300x43.png 300w\" sizes=\"(max-width: 406px) 100vw, 406px\" \/><\/a><\/figure>\n\n<p>Comando: route-map MADE4FLOW-IN permit 1000<\/p>\n\n<p>\n          <strong>             <\/strong>\n          <strong>set ip nex-hop 192.168.66.66<\/strong>\n        <\/p>\n\n<p>In this case it is necessary to add Next-hop manually on the router.<\/p>\n\n<p>Within Made4Flow, you can already advertise with the BGP community and the correct Next-hop if you prefer.<\/p>\n\n<p>\n          <strong>Configure Made4Flow to send via Actions<\/strong>\n        <\/p>\n\n<p>Within the Anti-DDoS Module, you can access the menu: Actions and Responses and configure the response to send the Blackhole with the correct BGP community:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"454\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-6.png\" alt=\"\" class=\"wp-image-2127\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-6.png 940w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-6-300x145.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-6-768x371.png 768w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><\/figure>\n\n<p>\n          <strong>Configure the Router to Send to Carriers<\/strong>\n        <\/p>\n\n<p>To configure to send to operators\/upstreams you need to configure so that the BGP community is identified in the outbound Route-map match.<\/p>\n\n<p>For this we need to configure an ip community-filter<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"28\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-7.png\" alt=\"\" class=\"wp-image-2128\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-7.png 608w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-7-300x14.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-7-600x28.png 600w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/a><\/figure>\n\n<p>The next step is to configure the Route-map of your operator\/upstream, as in sending the blackhole, but now matching the community in the match, as in our configuration:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"469\" height=\"52\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-8.png\" alt=\"\" class=\"wp-image-2129\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-8.png 469w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-8-300x33.png 300w\" sizes=\"(max-width: 469px) 100vw, 469px\" \/><\/a><\/figure>\n\n<p>Check if you receive from Made4Flow<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-9.png\"><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"303\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-9.png\" alt=\"\" class=\"wp-image-2130\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-9.png 902w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-9-300x101.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-9-768x258.png 768w\" sizes=\"(max-width: 902px) 100vw, 902px\" \/><\/a><\/figure>\n\n<p>Command: <\/p>\n\n<pre class=\"wp-block-preformatted\">show bgp ipv4 unicast neighbors 192.168.120.2 routes<\/pre>\n\n<p>And if you are sending to the operator:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-10.png\"><img loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"313\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2022\/05\/image-10.png\" alt=\"\" class=\"wp-image-2131\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-10.png 897w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-10-300x105.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2022\/05\/image-10-768x268.png 768w\" sizes=\"(max-width: 897px) 100vw, 897px\" \/><\/a><\/figure>\n\n<p>Command:<\/p>\n\n<p>show bgp ipv4 unicast neighbors 192.168.1.1 advertised-routes<\/p>\n\n<p>Having made these settings, the automation of Made4Flow is ready. Upon receiving an attack, Made4Flow can now send this route to Blackhole.<\/p>\n\n<p>We have other content on how to configure <a href=\"https:\/\/www.made4it.com.br\/blackhole-bgp-mikrotik\/\" class=\"rank-math-link\">Blackhole<\/a> that you can find on our blog and any questions you still have, please contact our team of experts <br\/><br\/><strong>Leonardo Nascimento | Made4it consultant<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that you know what a BGP Blackhole is (if you still don&#8217;t know, check out our article on RTBH \u2013 Blackhole). Now it&#8217;s time to configure it and be able to protect yourself from DDoS attacks. To summarize the Blackhole, it is a technique of sending a route to the \u201cblack hole\u201d or simply [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":9032,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"postBodyCss":"","postBodyMargin":[],"postBodyPadding":[],"postBodyBackground":{"backgroundType":"classic","gradient":""},"footnotes":""},"categories":[352],"tags":[],"class_list":["post-10084","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized-en"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/posts\/10084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/comments?post=10084"}],"version-history":[{"count":0,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/posts\/10084\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/media\/9032"}],"wp:attachment":[{"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/media?parent=10084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/categories?post=10084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/tags?post=10084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}