Static leases

My netbook server stays put at home and uses a fixed ip address; however my chromebook bounces between the LAN and the outside world. A router can use a static lease to assign a computer a fixed IP address based on their hardware (MAC) address. This allows my chromebook the flexibility of using DHCP both at home to retrieve a known and consistent IP address (useful for ssh access and running backup scripts) and outside where an unknown range of IP addresses will be assigned at different locations and times.

To retrieve the hardware address on a Linux desktop using Network Manager, right-click on the network device icon and select Connection Information, or run the command ip -address in a console for more complete interface description.

For a router using OpenWrt, ssh into the device and create a static lease in /etc/config/dhcp.

Sample entry:

config host
        option name 'tyrell'
        option mac '01:2a:b3:4c:55:dd'
        option ip ''

Alternately, use the LuCI graphical config interface to create a static lease under Network->DHCP and DNS.

Link: DNS and DHCP configuration

Happy hacking!

More • openwrtlinuxnetwork