Releasing DHCP lease on the Yun

This question is closely related to my previous question in this forum. I am writing a script to install software packages on 150 devices.

Since the Arduino Yun uses DHCP for obstaining an IP, I am trying to return the DHCP lease at the end of my installation script:

 killall -USR2 udhcpc && halt

I am expecting any new device that is connected to the network to reuse the IP address released by the other device. Instead, any new device that is connected seems to make use of a new IP address.

Am I releasing the DHCP leases correctly? I don't want to end up using leases for 150 devices.

yamanoorsai_15: ::::SNIP:::: Am I releasing the DHCP leases correctly? I don't want to end up using leases for 150 devices.

@yamanoorsai_15, It is good to know that YunOS is based on OpenWrt, which is based on Linux.

Google: openwrt client release dhcp lease

This is what you are looking for: How can I renew or release a Dynamic IP address in Linux? http://www.computerhope.com/issues/ch001078.htm

Jesse

Plan B:

DHCP assigns an IP to a MAC address based on the lease time you have assigned in your router. If the lease time is, say, 1 min, that IP is assigned to the specific MAC for 1 min, whether the Yun is on or off.

Reduce DHCP lease time from default 3600 ( 6 hours) to 60 ( 1 min).

Plan C:

Private IP address arrange:

10.0.0.0 – 10.255.255.255 (Total Addresses: 16,777,216) 169.254.0.0 through 169.254.255.255 (APIPA - Automatic Private IP Addressing) 172.16.0.0 – 172.31.255.255 (Total Addresses: 1,048,576) 192.168.0.0 – 192.168.255.255 (Total Addresses: 65,536)

Unless you have more than 16,777,216 Yuns, You should never face run out of IP address and just by use correct IP and subnet at DHCP server setting.

@sonnyyu Thanks for the suggestion. I took the route of the private IPs. I installed a 3rd party Windows DHCP server tool to run it on the ethernet interface of my laptop. This way I am able to control the lease timings etc.

The only issue is that I am not able to share internet connection from the wireless interface to the ethernet interface where the Yuns are connected. Currently, copying them via scp

yamanoorsai_15: ... The only issue is that I am not able to share internet connection from the wireless interface to the ethernet interface where the Yuns are connected. Currently, copying them via scp

Microsoft has a functionality called Internet Connection Sharing (ICS) that is made just for extend your laptop WiFi Internet to another device (Yun) via ethernet cable.

http://www.countrymilewifi.com/how-to-share-computers-wifi-with-ethernet-devices.aspx

For some reason, I am not able to use of the Internet connection sharing feature when I am running a third party DHCP server. I am enabling it but some setting seems to be incorrect. I am not able to ping any external server.

Use Microsoft ICS build in DHCP service

How to Change the IP Range for the Internet Connection Sharing DHCP service

https://support.microsoft.com/en-us/kb/230148

I found Connectify. It seems to solve my problem in entirety.