How to request a specific IP address from DHCP server?

8,647

Preferred DHCP addresses are usually configured on the DHCP server side.

You will need to add an entry in your DHCP server's address table for your device's MAC address and assign it to an IP address. DHCP servers can vary. If this is a small network your DHCP server may be your router or gateway. The address can fall in the range of DHCP addresses but it will be reserved for the device with the MAC address that you entered.

I usually use reserved DHCP addressing for devices like printers that seem to always be able to ignore what ever you want them to do and just try to make you life miserable. Most of these default to DHCP addressing when the lose their minds, so reserved DHCP works well there.

However like @terdon mentioned, you may want a static address. On most distros just edit /etc/network/interfaces and change the address on the interface (eth0 etc.) to what you want. Just make sure that you choose a static address out side of the DHCP range so your DHCP server doesn't accidentally give the address to another device sometime.

Share:
8,647

Related videos on Youtube

dempap
Author by

dempap

Updated on September 18, 2022

Comments

  • dempap
    dempap almost 2 years

    I'm running Angstrom Linux on an embedded device (BeagleBoard-xM). I managed wireless connection via a Wi-Fi adapter.

    When I load its driver using modprobe, BB-xM requests an IP address from router running DHCP server. The IP address assignment varies from 192.168.1.100-192.168.1.200.

    Can BB-xM request a specific IP address?

    Attention:

    The solutions I found, are referring to settings on the router. However, I'm looking if this is possible on the BB-xM side.

    Any ideas?

    wpa_supplicant.conf

    ctrl_interface=/var/run/wpa_supplicant
    eapol_version=1
    network={
            ssid="SSID"
            scan_ssid=1
            proto=RSN
            pairwise=CCMP TKIP
            key_mgmt=WPA-PSK
            psk="password"
    }
    
    • terdon
      terdon about 10 years
      Do you need to "request a specific address from the DHCP server" or do you just need your BeagleBoard to have a static IP?
    • dempap
      dempap about 10 years
      I 'm newbie on networking and I don't really know. If static IP works as well, please let me know in order to edit my question about static IP.
    • Graeme
      Graeme about 10 years
      Static IP sound like what you want. Nice tutorial here elinux.org/…. Just be sure to make the subnet mask match that of router and choose IP inside of subnet mask but outside of router DHCP pool (192.168.1.201 looks like a good choice from your Q).
    • Graeme
      Graeme about 10 years
      Also if you only want to do this for ssh logins, remember you should just be able to use the hostname instead of the IP address when logging in.
    • terdon
      terdon about 10 years
      Have a look at this guide for setting up a static IP on a BeagleBoard, please let us know if it solves your problem.
    • dempap
      dempap about 10 years
      Static IP did the job. I just edited /etc/network/interfaces. On wlan0 interface I changed dhcp to static and added preferred address, netmask and gateway. Thank's for the advice.