Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-28-2017, 05:48 PM   #1
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
Which is the correct DHCP server's IP address?

For linux Mint.
Method 1:
 $ locate dhclient | less
   # find file with *lease
 $ locate dhclient | grep -i lease

>ls -al /var/lib/NetworkManager
-rw-r--r--  1 root root   982 Apr 18 20:01
-rw-r--r--  1 root root  1118 Apr 26 14:28

 /var/lib/NetworkManager $ tail
  option dhcp-server-identifier;
  option dhcp-renewal-time 302400;
  option broadcast-address;
  option dhcp-rebinding-time 529200;
  option host-name "HP";
  option domain-name "";
  renew 6 2017/04/29 12:30:41;
  rebind 2 2017/05/02 23:28:33;
  expire 3 2017/05/03 20:28:33;
So method 1's the DHCP server's IP address is from this:
option dhcp-server-identifier;

Method 2:
 $ sudo grep -R "DHCPOFFER" /var/log/*
[sudo] password for foffb: 
( OR this works too: $ sudo grep -Ri "offer" /var/log/* )
/var/log/auth.log:Apr 28 16:16:09 HP sudo:    foffb : TTY=pts/1 ; PWD=/home/foffb ; USER=root ; COMMAND=/bin/grep -R DHCPOFFER /var/log/alternatives.log /var/log/alternatives.log.1 /var/log/alternatives.log.2.gz /var/log/alternatives.log.3.gz /var/log/alternatives.log.4.gz 
/var/log/fontconfig.log /var/log/fsck /var/log/gateone /var/log/gpu-manager.log
/var/log/syslog:Apr 28 15:38:34 HP dhclient[6430]: DHCPOFFER of from

# IP address of DHCP offered correlates to wireless IP address:  
>ip addr
3: wlp2s0b1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether e0:2a:82:3c:29:b6 brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic wlp2s0b1
In method 2, the DHCP server's IP address is

So why two different results?
Is the DHCP server's IP address incorrect?

Is there a better method to get DHCP's IP address?
Old 04-28-2017, 05:56 PM   #2
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015 is the private class A address space. Unless you have a massive network, you're probably using, which is the private class C address space. Why the lease file says I have no idea.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcp-helper (cannot bind DHCP server socket: Address already in use) smeezekitty Linux - Networking 2 02-16-2015 06:57 PM
Single DHCP server ,to provide the ip address to a MAC address in two different subne alix123 Linux - Software 5 05-08-2007 11:16 PM
How To know if a host configured with DHCP has obtained IP address from DHCP server? Prassanta SUSE / openSUSE 1 06-29-2006 09:48 AM
do not recieve correct ip address from dhcp server BCarey Linux - Wireless Networking 2 06-09-2006 02:27 PM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration