Page 1 of 1

How to use DHCP to Dynamically Configure Router IP Addresses?

Posted: Tue Feb 26, 2019 12:08 am
by vineethp7
Hi guys!

I always wondered how datacenters and ISPs have dynamic addresses for their internal routers. I assume they use DHCP to assign IPs for their routers internally.
traceroute www.google.com
traceroute to www.google.com (216.58.194.36), 64 hops max, 52 byte packets
 1  csvcs-rcl01-vrfdata-rtr.network.sow.com (10.106.55.254)  40.245 ms  32.383 ms  51.452 ms
 2  cr01-vrfdata-rtr.network.sow.com (172.16.2.154)  9.771 ms  9.074 ms  8.456 ms
 3  brdr-ncpk-098-vrfdata-rtr.network.sow.com (172.16.0.194)  5.710 ms  3.817 ms  3.954 ms
 4  ex01-vrfinet-rtr.network.sow.com (172.16.96.198)  5.609 ms  7.787 ms  5.509 ms
 5  umicn-ro-te0-0-0-2-303.um.sow.com (150.199.4.77)  5.724 ms  5.581 ms  5.997 ms
 6  umicn-kc-te0-0-0-1-100.um.sow.com (150.199.4.46)  15.588 ms  15.061 ms  18.021 ms
 7  ks-96-xe-1-1-0-731.sow.com (164.113.254.237)  14.673 ms  14.287 ms  16.528 ms
 8  et-2-0-2.492.rtsw.sow.com(64.57.21.253)  13.556 ms  13.452 ms  13.578 ms
 9  lo-0.8.rtsw.dall.sow.com (64.57.20.114)  25.208 ms  40.541 ms  25.332 ms
10  162.252.69.177 (162.252.69.177)  23.296 ms *  30.615 ms
11  108.170.240.193 (108.170.240.193)  23.486 ms  23.199 ms  21.986 ms
12  209.85.242.55 (209.85.242.55)  23.041 ms
    209.85.242.53 (209.85.242.53)  24.990 ms
    209.85.242.55 (209.85.242.55)  23.704 ms
13  dfw25s12-in-f36.1e100.net (216.58.194.36)  37.400 ms  38.749 ms  37.118 ms
For example here from ID "2" the routers have dynamically allocated IPs.

Do we have some feature like this in Mikrotik where we can assign the router IP dynamically using a central DHCP server?

In Cisco iOS the interface IP can be allocated dynamically like this:
Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#interface FastEthernet0/1
Router1(config-if)#ip address dhcp 
Router1(config-if)#end
Router1#
Interface FastEthernet0/1 assigned DHCP address 172.25.1.57, mask 255.255.255.0
Router1#

Re: How to use DHCP to Dynamically Configure Router IP Addresses?

Posted: Tue Feb 26, 2019 12:41 am
by kokaKorina
I think if the router is attached to the main(dhcp server) and we can set up a client is not the both things same?or I am missing something here?

Re: How to use DHCP to Dynamically Configure Router IP Addresses?

Posted: Tue Feb 26, 2019 1:22 am
by vineethp7
I think if the router is attached to the main(dhcp server) and we can set up a client is not the both things same?or I am missing something here?
Here Router IP address means "Gateway" IP. I have Winbox and it asks to setup a static "Gateway IP" in the initial setup. What I need is a dynamic gateway IP.

Re: How to use DHCP to Dynamically Configure Router IP Addresses?

Posted: Wed Feb 27, 2019 6:08 am
by nbctcp
You can set eth1 ip using dhcp-server like this right
/ip dhcp-client
set dhcp-options=hostname,clientid disabled=no interface=ether1