{"id":10349,"date":"2021-10-14T10:33:16","date_gmt":"2021-10-14T13:33:16","guid":{"rendered":"http:\/\/made4it.com.br\/how-to-configure-cgnat\/"},"modified":"2023-02-15T16:28:35","modified_gmt":"2023-02-15T19:28:35","slug":"how-to-configure-cgnat","status":"publish","type":"post","link":"https:\/\/made4it.com.br\/en\/how-to-configure-cgnat\/","title":{"rendered":"How to configure CGNAT"},"content":{"rendered":"\n<p>Hello everything is fine? My name is Kevin Wauters, I&#8217;m from the Made4it team of consultants and today I&#8217;m going to show you how to configure CGNAT using the script created by the Made4it team.<\/p>\n\n<p>Script creates deterministic type CGNAT, to better understand and have more information about CGNAT types you can read our <a href=\"https:\/\/www.made4it.com.br\/o-que-e-cgnat\/\" class=\"rank-math-link\">previous article<\/a><\/p>\n\n<p>To create the script, first we need to access the page <a class=\"rank-math-link\" href=\"https:\/\/www.made4it.com.br\/cgnat\/\">https:\/\/www.made4it.com.br\/cgnat<\/a>\/, when accessing we have the page:<br\/><\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT1.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1440\" height=\"708\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT1.png\" alt=\"\" class=\"wp-image-1930\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT1.png 1440w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT1-300x148.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT1-1024x503.png 1024w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT1-768x378.png 768w\" sizes=\"(max-width: 1440px) 100vw, 1440px\" \/><\/a><\/figure>\n\n<p>On this page we have some fields to be filled, namely:<\/p>\n\n<ul class=\"wp-block-list\"><li>Public network address \u2013 Public IP address, which will be used to NAT private IPs. For an example, let&#8217;s use 200.0.0.0 <\/li><li>Netmask \u2013 Full netmask of the public IP. For an example, let&#8217;s use 255.255.255.252.<\/li><li>Initial internal IP \u2013 Private IP used by clients. For an example, we will use 100.64.0.0<\/li><li>Ports per client \u2013 Number of public IP ports that each private IP can use. For an example, let&#8217;s use the value of 4000.<\/li><li>Start of Jump \u2013 Number of the jump rule, if it is a new CGNAT, keep it at 0, change it only in cases of adding more rules in a CGNAT in production. For an example, we will set it up as a new<\/li><\/ul>\n\n<p>Filling in the information we will have the page:<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT2.tif.png\"><img decoding=\"async\" width=\"1440\" height=\"706\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT2.tif.png\" alt=\"\" class=\"wp-image-1932\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT2.tif.png 1440w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT2.tif-300x147.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT2.tif-1024x502.png 1024w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT2.tif-768x377.png 768w\" sizes=\"(max-width: 1440px) 100vw, 1440px\" \/><\/a><\/figure>\n\n          \n\n          <p>Now just click on the button to generate the CGNAT script and we will have<\/p>\n          \n\n        \n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT3.png\"><img decoding=\"async\" width=\"1426\" height=\"707\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT3.png\" alt=\"\" class=\"wp-image-1929\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT3.png 1426w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT3-300x149.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT3-1024x508.png 1024w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT3-768x381.png 768w\" sizes=\"(max-width: 1426px) 100vw, 1426px\" \/><\/a><\/figure>\n\n<p>On this page we will have information that we put in to create CGNAT and also information about the rules created by the script.<br\/><br\/>Now we need to transfer this script to a file by copying the rules below the part indicated with \u201c==== COPY FROM HERE ====\u201d until the end of the page. When pasting in the file, just save it as a .rsc file, for example cgnat.rsc.<br\/><br\/>Next, we need to UPLOAD this file on the Mikrotik, which will be the equipment used to perform the NAT. To do this, just go to FILES as soon as you log in via WINBOX.<\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1810\" height=\"966\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT4.png\" alt=\"\" class=\"wp-image-1933\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT4.png 1810w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT4-300x160.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT4-1024x547.png 1024w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT4-768x410.png 768w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT4-1536x820.png 1536w\" sizes=\"(max-width: 1810px) 100vw, 1810px\" \/><\/a><\/figure>\n\n          \n\n          <p>With the file in the Mikrotik, we can already read it, so that the mikrotik creates the rules. Just open the terminal and type the command \u201cimport file-name=cgnat.rsc\u201d (change where cgnat.rsc is to the name of the file you placed) and press enter for Mikrotik to create the rules.<br><br><\/p>\n          \n\n        \n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2556\" height=\"1270\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5.png\" alt=\"\" class=\"wp-image-1934\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5.png 2556w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5-300x149.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5-1024x509.png 1024w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5-768x382.png 768w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5-1536x763.png 1536w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT5-2048x1018.png 2048w\" sizes=\"(max-width: 2556px) 100vw, 2556px\" \/><\/a><\/figure>\n\n<p>It will look as if it were loading, wait for the message \u201cScript file loaded and executed successfully\u201d, this indicates that the script was completely read and the rules were created successfully. Opening in IP, Firewall, NAT we will have the rules.<br\/><\/p>\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1924\" height=\"972\" src=\"https:\/\/www.made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT6.png\" alt=\"\" class=\"wp-image-1935\" srcset=\"https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT6.png 1924w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT6-300x152.png 300w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT6-1024x517.png 1024w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT6-768x388.png 768w, https:\/\/made4it.com.br\/wp-content\/uploads\/2021\/10\/CGNAT6-1536x776.png 1536w\" sizes=\"(max-width: 1924px) 100vw, 1924px\" \/><\/a><\/figure>\n\n<p>After importing the rules and completing the other CGNAT adjustments, such as adjusting the time of stabilized connections, creating Blackhole routes for the public blocks used in this CGNAT to prevent loops and adjusting the routing, so that the CGNAT box has the necessary routes and the network knows the blocks that are in the CGNAT, then just redirect clients with 100.64.0.0 to 100.64.0.63 to that CGNAT and disable rule number 0, this will make them start browsing.<br\/><br\/><strong>And so, completing these steps we will have a functional CGNAT configured.<\/strong><\/p>\n\n<p>If you prefer, you can also watch this step-by-step video on our youtube channel.<\/p>\n\n          \n\n          <figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\">\n            <div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Como configurar CGNAT\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/PSbdAL0zrAo?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>\n<\/div>\n          <\/figure>\n          \n\n        \n\n<p>If you need help creating your CGNAT, you can contact our team via email <a href=\"mailto:contato@made4it.com.br\">contato@made4it.com.br<\/a> or by phone (43) 3047-8340 or (43) 9 8485-4013.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A step-by-step guide on how to configure a CGNAT<\/p>\n","protected":false},"author":13,"featured_media":8882,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"postBodyCss":"","postBodyMargin":[],"postBodyPadding":[],"postBodyBackground":{"backgroundType":"classic","gradient":""},"footnotes":""},"categories":[352],"tags":[433,434],"class_list":["post-10349","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized-en","tag-cgnat-en","tag-how-to-configure-cgnat"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/posts\/10349","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=10349"}],"version-history":[{"count":0,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/posts\/10349\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/media\/8882"}],"wp:attachment":[{"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/media?parent=10349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/categories?post=10349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/made4it.com.br\/en\/wp-json\/wp\/v2\/tags?post=10349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}