Assign IP's to certian mac addresses in dd-wrt

I have a Linksys WRT54G/GL/GS that I am running DD-WRT v24-sp2 (10/10/09) vpn - build 13064 on it and for the life of me I can not find a way to assign ip's based on Mac address. Basically I have a few laptops and Windows really has no decent way to have separate profiles for each network.


Solution 1:

Assigning IP addresses based on MAC addresses is generally done by the DHCP server; this is often referred to as "static leases".

Here's the DD-WRT tutorial on enabling Static DHCP. In the web administration GUI, you'll find this option on the Services tab, in the DHCP Server options.

If you're using the ssh commandline interface, use the following commands:

  • builds earlier than 13832:

    # X is the total number of static leases
    nvram set static_leasenum=X
    
    # note the space between the two example addresses
    nvram set static_leases="00:11:22:33:44:55=name1=IP-Address1 00:11:22:33:44:56=name2=IP-Address2"
    
  • build 13832 and later:

    # X is the total number of static leases
    nvram set static_leasenum=X
    
    # note the space between the two example addresses
    # the last field is new; lease time; leave empty for "indefinite"
    nvram set static_leases="00:11:22:33:44:55=name1=IP-Address1= 00:11:22:33:44:56=name2=IP-Address2=1440"
    

alt text