-   Linux - Newbie (
-   -   Which is the correct DHCP server's IP address? (

fanoflq 04-28-2017 05:48 PM

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?

AwesomeMachine 04-28-2017 05:56 PM 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.

All times are GMT -5. The time now is 10:13 PM.