{"id":1288,"date":"2018-09-06T13:50:17","date_gmt":"2018-09-06T06:50:17","guid":{"rendered":"https:\/\/lagonet.vn\/?p=1288"},"modified":"2018-09-06T13:50:17","modified_gmt":"2018-09-06T06:50:17","slug":"ddns-how-to-manage-a-device-with-a-dynamic-public-ip","status":"publish","type":"post","link":"https:\/\/kb.lagonet.vn\/?p=1288","title":{"rendered":"DDNS: How to manage a device with a dynamic public IP"},"content":{"rendered":"<p>The\u00a0<strong>DDNS<\/strong>\u00a0aka Dynamic DNS is an\u00a0<strong>old feature<\/strong>\u00a0that several routers (non only Cisco devices) have implemented and, in some\u00a0circumstances, it is very\u00a0<strong>useful<\/strong>.<\/p>\n<p><strong>DDNS<\/strong>\u00a0is a method of automatically\u00a0<strong>updating<\/strong>\u00a0a\u00a0<strong>name server<\/strong>\u00a0in the Domain Name System (DNS), often in real time, with the active DDNS configuration of its configured hostnames, addresses or other information. It provides two mechanisms to generate or perform DDNS: the IETF standard as defined by RFC 2136 and a generic HTTP using various DNS services.<\/p>\n<p>In a nutshell, when this feature can\u00a0<strong>simplify<\/strong>\u00a0our lifes?\u00a0<strong>When we haven\u2019t a static IP<\/strong>public address (ADSL or other technologies\u2026)!<\/p>\n<p>Suppose that we would manage our router around the world but we have only a dynamic public ip address; how can we do that? The answer is DDNS \ud83d\ude42<span id=\"more-1553\"><\/span><\/p>\n<p>It is very simple implement this feature in Cisco devices:<\/p>\n<p>1. Register to a DDNS services; there are several alternatives. In this article I use the\u00a0<a href=\"http:\/\/www.noip.com\/free\" target=\"_blank\" rel=\"noopener\">no-ip<\/a>\u00a0services (it is free!).<\/p>\n<p>2. Configure Cisco devices.<\/p>\n<p>2a.\u00a0<strong>Configure<\/strong>\u00a0the\u00a0<strong>DDNS<\/strong>\u00a0credentials:<\/p>\n<pre>ip ddns update method myupdate\n HTTP\n   add http:\/\/username:password@dynupdate.no-ip.com\/nic\/update?hostname=&lt;h&gt;&amp;myip=&lt;a&gt;\n   remove http:\/\/username:password@dynupdate.no-ip.com\/nic\/update?hostname=&lt;h&gt;&amp;myip=&lt;a&gt;\n   interval maximum 0 0 5 0\n<\/pre>\n<p>Where username and password are our credentials and the \u201cinterval maximum 0 0 5 0\u201d defines how often update the dns entry.<\/p>\n<p><strong>Remember<\/strong>: The question mark \u201c?\u201d is a special character, so you need to\u00a0<a href=\"http:\/\/www.ciscozine.com\/cisco-ios-keyboard-shortcuts\/\">escape<\/a>\u00a0it! To do it press \u201cCTRL + V\u201d, then \u201c?\u201d.<br \/>\n<strong>Note<\/strong>: As you can see, the https link has two special tag: &lt;h&gt; and &lt;a&gt;. These variables are dynamically substituted with the hostname and the ip address of the interface, during the HTTP query!<\/p>\n<p>2b.\u00a0<strong>Apply<\/strong>\u00a0the\u00a0<strong>DDNS<\/strong>\u00a0template to the interface (in this case the Dialer1):<\/p>\n<pre>Interface Dialer1\n   ip ddns update hostname ciscozine.ddns.net\n   ip ddns update myupdate\n<\/pre>\n<p>The first entry defines the hostname, while the second entry link the template defined in the point \u201c2a\u201d to the interface.<\/p>\n<p>To better understand how the DDNS works, below the\u00a0<strong>log<\/strong>\u00a0messages after enabling the \u201c<strong>debug ip ddns<\/strong>\u201c.<\/p>\n<pre>Nov 23 21:05:21.688: DYNDNSUPD: Adding DNS mapping for ciscozine.ddns.net &lt;=&gt; 199.95.19.255\nNov 23 21:05:21.688: HTTPDNS: Update add called for ciscozine.ddns.net &lt;=&gt; 199.95.19.255\nNov 23 21:05:21.688: HTTPDNSUPD: Session ID = 0x4C\nNov 23 21:05:21.688: HTTPDNSUPD: URL = 'http:\/\/ciscozine:ciscozinepwd@dynupdate.no-ip.com\/nic\/update?hostname=ciscozine.ddns.net&amp;myip=199.95.19.255'\nNov 23 21:05:21.688: HTTPDNSUPD: Sending request\nNov 23 21:05:22.444: HTTPDNSUPD: Response for update ciscozine.ddns.net &lt;=&gt; 199.95.19.255\n\nNov 23 21:05:22.444: HTTPDNSUPD: DATA START\nnochg 151.65.149.255\n\nNov 23 21:05:22.448: HTTPDNSUPD: DATA END, Status is Response data recieved, successfully\nNov 23 21:05:22.448: HTTPDNSUPD: Call returned SUCCESS, update of ciscozine.ddns.net &lt;=&gt; 199.95.19.255 succeeded\nNov 23 21:05:22.448: DYNDNSUPD: Another update completed (outstanding=0, total=0)\nNov 23 21:05:22.448: HTTPDNSUPD: Clearing all session 76 info\n<\/pre>\n<p>Now\u00a0<strong>it is enough remember the hostname<\/strong>\u00a0\u201cciscozine.ddns.net\u201d to log in the router (via SSH, HTTPS, \u2026).<\/p>\n<p><strong>References<\/strong>:\u00a0<a href=\"http:\/\/www.cisco.com\/c\/en\/us\/td\/docs\/ios-xml\/ios\/ipaddr_dns\/configuration\/15-mt\/dns-15-mt-book\/dns-dyn-dns-supp-ios.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.cisco.com\/\u2026\/dns-dyn-dns-supp-ios.html<\/a><\/p>\n<p>Details:\u00a0<a href=\"http:\/\/www.ciscozine.com\/ddns-manage-dynamic-public-ip\/\">http:\/\/www.ciscozine.com\/ddns-manage-dynamic-public-ip\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0DDNS\u00a0aka Dynamic DNS is an\u00a0old feature\u00a0that several routers (non only Cisco devices) have implemented and, in some\u00a0circumstances, it is very\u00a0useful. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[29,30,31,25,16,19,6],"tags":[],"class_list":["post-1288","post","type-post","status-publish","format-standard","hentry","category-ccie-rs","category-ccna","category-ccnp-route","category-cisco","category-courses","category-issues","category-networking"],"_links":{"self":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/posts\/1288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1288"}],"version-history":[{"count":0,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=\/wp\/v2\/posts\/1288\/revisions"}],"wp:attachment":[{"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.lagonet.vn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}