• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2132
  • Last Modified:

ifconfig - how to determine if IP address is static or dhcp?

In Windows an ipconfig /all shows a field that says DHCP Enabled = Yes/No
Is there a comparable linux command to determine if the IP address was assigned via DHCP or Static?  Also, is there a way to have ifconfig display its information one screen at a time?

3 Solutions
ipconfig /all in Windows does show whether it's enabled or not.
not sure about Linux, however, I think the command to display one screen at a time is ifconfig | more

Hope that works for you.
No, it does not tell you, you have to look in the configs, what is your distribution? redhat, debian, ubuntu?
By the command line, the only way to determine if an IP address is static or dynamically assigned is by viewing / editing the networking file (ex. in Ubuntu / Debian, /etc/network/interfaces).

ifconfig | more will limit the display of the information to the size of the current window, and allow you to progressively display the remainder of the data.


another way to look at it is if a:

ps afux | more

does not reveal a dhcp-client process you are pretty sure that you are not dhcp configured, but the best way is to check the configs

dkrautAuthor Commented:
thanks all, it's RHEL btw.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now