Community discussions

MikroTik App
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Dhcp schedule release and renew script

Sat Sep 19, 2009 2:36 am

Hello, I need help, I don't know anything about scripting and I don't even know where to look. I don't know if any script will work in Mikrotik 3.x or if it is all the same.

I need to release and renew a dhcp client in the Public interface every day at 3am, so I don't have to reboot the routerboard. How can I do this?

The problem is that my wisp gives me DHCP but people in my network sometimes need to register a few hotmail accounts and they can't because I have the same IP address.

Thanks in advance for any help given.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Dhcp schedule release and renew script

Sat Sep 19, 2009 3:20 am

/ip dhcp-client release [/ip dhcp-client find interface="name_of_outside_interface"]
Put that into a script and run it via the scheduler.

If your provider caches leases and assigns the same IP every time (possibly even over reboots), you can manually set a different MAC address on the interface, but that's a fairly ugly hack.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Dhcp schedule release and renew script

Sat Sep 19, 2009 3:26 pm

Thank you very much, I'll try it this afternoon.
 
User avatar
tamahome
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 87
Joined: Thu Jun 28, 2007 11:25 pm
Location: Buenos Aires
Contact:

Re: Dhcp schedule release and renew script

Mon Sep 21, 2009 4:39 pm

You were right, the ISP always give me the same Public IP Address. Althogh I am allow to work with 3 Public IPs that they gave me.

I see if it is possible to create a DHCP who works only for the public MAC address interface and give IP address from a Public DHCP-pool. The problem would be getting the same IP from my server for having the same MAC when I renew it.
 
User avatar
JHOELIT
just joined
Posts: 12
Joined: Sun Sep 03, 2017 1:12 pm
Location: Perú
Contact:

Re: Dhcp schedule release and renew script

Mon Dec 04, 2017 5:20 am

I share these useful examples

/ ip dhcp-client release 0
/ ip dhcp-client release [find interface =ether1]

It is valid for (release) or (renew)

God bless you

Who is online

Users browsing this forum: VirtualEvan and 44 guests