1

Firstly, parsing configuration files isn't really correct. And not nearly distro-independent either.

My first idea was to search for running dhclient processes, but each distribution uses a different esoteric command line. Even the binary name itself varies. In Fedora, it's dhclient. In Ubuntu, it's dhclient3.

Is there something in /proc or /sys that indicates that an IP is dynamic?

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
JCCyC
  • 680
  • 3
  • 13
  • 24

2 Answers2

4

Have you grepped around in /var/lib/dhcp*/dh*lease* ?

On my Ubuntu system, as an example, /var/lib/dhcp3/dhclient-eth0.lease contains information about the current and recent leases.

Dennis Williamson
  • 62,149
  • 16
  • 116
  • 151
0

Check the DHCP server for a lease that matches the MAC address of the network card

Mark Henderson
  • 68,823
  • 31
  • 180
  • 259