{"id":5621,"date":"2021-06-10T15:54:11","date_gmt":"2021-06-10T13:54:11","guid":{"rendered":"https:\/\/nil.uniza.sk\/?p=5621"},"modified":"2021-11-23T12:52:30","modified_gmt":"2021-11-23T11:52:30","slug":"simple-statefull-nat64-configuration-example","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/simple-statefull-nat64-configuration-example\/","title":{"rendered":"Statefull NAT64 &#8211; simple configuration example on Cisco routers"},"content":{"rendered":"<p>The example shows a simplified configuration of a Statefull NAT64 demo, without DNS64. I instruct the stateful NAT64 router (CSR-1 &#8211; CSR100v) to translate IPv6 packets into IPv4 packets (and vice versa) using algorithmic mapping (defined by <a href=\"https:\/\/tools.ietf.org\/html\/rfc6052\">RFC 6052<\/a>) of  IPv4 addresses of IPv4 routers to and from IPv6 addresses by using manually defined IPv6 prefix 2001:db8::\/96).  In a similar manner, the IPv6 addresses of IPv6 routes are translated to and from IPv4 addresses.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Topology<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img alt=\"\" decoding=\"async\" src=\"https:\/\/nil.uniza.sk\/wp-content\/uploads\/2021\/04\/image.png\" class=\"wp-image-5622\" width=\"834\" height=\"140\" srcset=\"https:\/\/nil.uniza.sk\/wp-content\/uploads\/2021\/04\/image.png 627w, https:\/\/nil.uniza.sk\/wp-content\/uploads\/2021\/04\/image-300x50.png 300w\" sizes=\"(max-width: 834px) 100vw, 834px\" \/><\/figure>\n\n\n\n<p>R1\/R2 run 7200 IOS image., R1 is pure IPv4 router, on the other site, R2 is IPv6 only.<\/p>\n\n\n\n<p>CSR-1 is CSR1000v router running NAT64 (7200 IOS does not support NAT64).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Initial configuration<\/h2>\n\n\n\n<p>Initial configuration includes the setting of basic IP addressing, enabling the IPv6 routing, and specifying static routes.<\/p>\n\n\n\n<figure class=\"wp-block-table alignleft is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\">R1<\/td><td>CSR<\/td><td>R2<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">enable<br>conf t<br>hostname v4-Only<br>int fa 0\/0<br>  ip address 192.168.1.1 255.255.255.0<br>  no shut<br>  exit<br>ip route 0.0.0.0 0.0.0.0 fa0\/0 192.168.1.2<br>end<\/td><td>enable<br>conf t<br>hostname NAT64<br>ipv6 unicast-routing<br>int g1<br>  ip address 192.168.1.2 255.255.255.0<br>  no shut<br>int gi 2<br>  ipv6 add 2001:FEFE::2\/64<br>  ipv6 address FE80::2 link-local<br>  no shut<br>end<\/td><td>enable<br>conf t<br>hostname v6-Only<br>ipv6 unicast-routing<br>int fa0\/0<br>  ipv6 add 2001:FEFE::3\/64<br>  ipv6 address FE80::3 link-local<br>  no shut<br>  exit<br>ipv6 route ::\/0 fa0\/0 2001:FEFE::2<br>end<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configuration of NAT64<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Case 1) Address NAT64 translation with a pool of IPv4 addresses<\/h3>\n\n\n\n<p>In this example, we are using manually defined IPv6 prefix 2001:db8::\/96 and pool of IPv4 addresses &lt;158.193.1.1 158.193.1.10&gt;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img alt=\"\" decoding=\"async\" width=\"841\" height=\"311\" src=\"https:\/\/nil.uniza.sk\/wp-content\/uploads\/2021\/06\/Statefull64.png\" class=\"wp-image-5890\" srcset=\"https:\/\/nil.uniza.sk\/wp-content\/uploads\/2021\/06\/Statefull64.png 841w, https:\/\/nil.uniza.sk\/wp-content\/uploads\/2021\/06\/Statefull64-300x111.png 300w, https:\/\/nil.uniza.sk\/wp-content\/uploads\/2021\/06\/Statefull64-768x284.png 768w\" sizes=\"(max-width: 841px) 100vw, 841px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">!configuration of NAT64\/Port NAT64\n ena\n conf t\n int gi 1\n   ! Enables Stateful NAT64 translation\n   nat64 enable\n   exit\n int gi 2\n   ! Enables Stateful NAT64 translation\n   nat64 enable\n   exit\n !\n ! Defines an IPv6 access list, that controlls the translation\n ipv6 access-list NAT-64-ACL\n     permit ipv6 2001:FEFE::\/64 2001:db8::\/96\n !\n ! define IPv6 prefix used for NAT64 translation purposes\n nat64 prefix stateful 2001:db8::\/96\n!\n! define IPv4 address pool used for NAT64 translation purposes\nnat64 v4 pool NAT64-POOL 158.193.1.1 158.193.1.10\n ! \n ! NAT64 translation\n nat64 v6v4 list NAT-64-ACL pool NAT64-POOL<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verification <\/h4>\n\n\n\n<p>Simple ping from v6-Only router to 192.168.1.1 of v4-Only  router:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><span style=\"background-color:#fcb900\" class=\"background-color\">v6-Only#ping 2001:db8::192.168.1.1<\/span><\/strong>\nType escape sequence to abort.\nSending 5, 100-byte ICMP Echos to 2001:DB8<span style=\"color:#0693e3\" class=\"color\">::C0A8:101<\/span>, timeout is 2 seconds:\n!!!!!\nSuccess rate is 100 percent (5\/5), round-trip min\/avg\/max = 8\/8\/8 ms<\/pre>\n\n\n\n<p>and watch NAT64 translation table:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">NAT64(config)# do sh nat64 tranlation\n Proto  Original IPv4         Translated IPv4\n        Translated IPv6       Original IPv6\n illegal ---                   ---\n        158.193.1.1           2001:fefe::3\n icmp   192.168.1.1:609       [2001:db8::c0a8:101]:609\n        158.193.1.1:609       [2001:fefe::3]:609\n Total number of translations: 2<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Case 2) Port address NAT64 translation with a pool of IPv4 addresses<\/h3>\n\n\n\n<p>Just replace<\/p>\n\n\n\n<pre id=\"block-a37e0d4f-817a-42cf-868d-5efff27264f2\" class=\"wp-block-preformatted\"> ! NAT64 translation\n no nat64 v6v4 list NAT-64-ACL pool NAT64-POOL<\/pre>\n\n\n\n<p>with<\/p>\n\n\n\n<pre id=\"block-6f315e7c-9781-43c3-bd8d-7a9fe29356e5\" class=\"wp-block-preformatted\"> ! Port NAT64 translation\n nat64 v6v4 list NAT-64-ACL pool NAT64-POOL <span style=\"background-color:#8ed1fc\" class=\"background-color\">overload<\/span><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Case 3) Static address NAT64 translation<\/h3>\n\n\n\n<p>Configure NAT64 as mentioned previously and add a static NAT mapping. If the IPv4 pool is used, the IPv4 address used for mapping must be out of the pool.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nat64 v6v4 static 2001:FEFE::3 158.193.1.11<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verification<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">v6-Only#ping 2001:db8::192.168.1.2\n Type escape sequence to abort.\n Sending 5, 100-byte ICMP Echos to 2001:DB8::C0A8:102, timeout is 2 seconds:\n !!!!!\n Success rate is 100 percent (5\/5), round-trip min\/avg\/max = 4\/16\/44 ms<\/pre>\n\n\n\n<p>and <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">NAT64(config)#do sh nat64 tra\n Proto  Original IPv4         Translated IPv4\n        Translated IPv6       Original IPv6\n illegal ---                   ---\n\n icmp   192.168.1.2:736       [2001:db8::c0a8:102]:736\n        158.193.1.11:736      [2001:fefe::3]:736<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Case 4) Using Well Known Prefix<\/h3>\n\n\n\n<p>Cisco documentation claims that:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The Well Known Prefix 64:FF9B::\/96 is supported for Stateful NAT64. During a stateful translation, if no stateful prefix is configured (either on the interface or globally), the WKP prefix is used to translate the IPv4 host addresses.<\/p><\/blockquote>\n\n\n\n<p>But this use case does not work for me.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Other verification commands<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">show nat64 aliases [lower-address-range upper-address-range]\nshow nat64 logging\nshow nat64 prefix stateful {global | {interfaces | static-routes} [prefix ipv6-address\/prefix-length]}\nshow nat64 timeouts\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>The example shows a simplified configuration of a Statefull NAT64 demo, without DNS64. I instruct the stateful NAT64 router (CSR-1 &#8211; CSR100v) to translate IPv6 packets into IPv4 packets (and vice versa) using algorithmic mapping (defined by RFC 6052) of IPv4 addresses of IPv4 routers to and from IPv6 addresses by using manually defined IPv6&#8230;<\/p>","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[681,1465],"tags":[],"class_list":["post-5621","post","type-post","status-publish","format-standard","hentry","category-ipv6-en","category-practical_-_cisco-ipv6-ipv4_en"],"taxonomy_info":{"category":[{"value":681,"label":"IPv6"},{"value":1465,"label":"IPv6-IPv4"}]},"featured_image_src_large":false,"author_info":{"display_name":"palo73","author_link":"https:\/\/nil.uniza.sk\/en\/author\/palo73\/"},"comment_info":17,"category_info":[{"term_id":681,"name":"IPv6","slug":"ipv6-en","term_group":0,"term_taxonomy_id":679,"taxonomy":"category","description":"","parent":0,"count":4,"filter":"raw","cat_ID":681,"category_count":4,"category_description":"","cat_name":"IPv6","category_nicename":"ipv6-en","category_parent":0},{"term_id":1465,"name":"IPv6-IPv4","slug":"practical_-_cisco-ipv6-ipv4_en","term_group":0,"term_taxonomy_id":1463,"taxonomy":"category","description":"","parent":747,"count":1,"filter":"raw","cat_ID":1465,"category_count":1,"category_description":"","cat_name":"IPv6-IPv4","category_nicename":"practical_-_cisco-ipv6-ipv4_en","category_parent":747}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/5621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=5621"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/5621\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=5621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=5621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=5621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}