Linux : How to show interface IP address at boot on the console with CentOS/RHEL7?

By | March 23, 2017

Particularly useful when building appliances or when you ship pre-build systems to a remote location where technical knowledge of people at the remote site is limited, you can easily make the system “print” the IP acquired by DHCP or even the static assigned one to the system console login.

You will need to create two scripts in order to have this working.

1. Create the script that will get the information from the “ifconfig” output :

2. Append the following (this example assume that the interface is eth0) :

3. Change the permissions :

4. Create the second script that will invoque the first one and then send the information to the “issue” file :

5. Append the following :

6. Change the permissions :

You can now reboot your system, it should print the IP below the system information.

Be Sociable, Share!