Skip to content

The Solaris Cookbook

The Cookbook and reference for IT Admins

Primary Menu

The Solaris Cookbook

  • /dev/urandom The Blog
  • Useful Knowledge
  • Overview of the Support Lifecycle for a few selected Enterprise Linux Distributions
  • Home
  • Linux
  • Linux: Howto show the Servers IP address at the login console
  • Linux
  • RedHat / CentOS
  • Ubuntu / Debian
  • Virtualisation
  • VMWare

Linux: Howto show the Servers IP address at the login console

Andreas July 26, 2012 0
CD-small

Howto show the Servers IP address at the login console

I have a few test systems running as virtual guests and assign them IP Addresses from my DHCP. Ideally when I fire them up in the VM I see the console only and would like to ssh to them. I don’t see a point in login to the console first to get their IP address and the DNS Masq also sometimes doesn’t react well or the name is too long and cryptic.

Easiest for me was to create a login banner (welcome screen) to show my IP Address on the console.

Here we go.

1. Insert a command which will be executed at the start-up and inserts what we want into the /etc/issue file.

I do this in the /etc/rc.local (because I’m a bit lazy to mess around with several separate scripts)

# sudo vi /etc/rc.local

insert before "touch /var/lock/subsys/local" :

sed -i_bak -e '/Addres/d' /etc/issue
IPADD=`/sbin/ifconfig | sed '/Bcast/!d' | awk '{print $2}'| awk '{print $2}' FS=":"`
echo "The IP Addres is: $IPADD" >> /etc/issue

Explanantion:
sed removes any old (previous created) line with the IP address.
The the newly assigned IP address will be added to /etc/issues

2. That would do already the job but I also wanted to shape the issue file, so this is optional:

# sudo vi /etc/issue

insert at the end:

Today is d t @ n

or

echo "Today is d t @ n" >> /etc/issue

Update: I added as well the following to prevent the console to go blank after a while.

echo -ne "33[9;0]" >> /etc/issue

Explanation to /etc/issue:

b   Insert the baudrate of the current line.
d   Insert the current date.
s   Insert the system name, the name of the operating system.
l   Insert the name of the current tty line.
m   Insert the architecture identifier of the machine, e.g., i686.
n   Insert the nodename of the machine, also known as the hostname.
o   Insert the domainname of the machine.
r   Insert the release number of the kernel, e.g., 2.6.11.12.
t   Insert the current time.
u   Insert the number of current users logged in.
U   Insert the string “1 user” or “<n> users” where <n> is the
number of current users logged in.
v   Insert the version of the OS, e.g., the build-date etc.

 

3. Now its time for a reboot to see the result

Update:
added echo commands for fast copy and paste.

Share this:

  • Print
  • Email
  • LinkedIn
  • Facebook
  • Twitter
  • More
  • Reddit
  • Pocket
  • Tumblr
  • Pinterest

Like this:

Like Loading...

Related

Related posts:

  1. Linux / VMware: Howto Increase a / (Root) LVM partition on a single vmdk without adding another partition
  2. RedHat / Ubuntu / Solaris / Linux: Slow SSH logins (5 second delay)
  3. CentOS / Debian: detect a new disk / lun without rebooting linux
  4. CentOS / RedHat: Quick Network Bonding eth0 and eth1
  5. Centos / Debian / LVM: Add a new disk as a LVM volume
  6. Overview of the Support Lifecycle for a few selected Enterprise Linux Distributions

Post Navigation

Previous Linux / VMware: Howto Increase a / (Root) LVM partition on a single vmdk without adding another partition
Next Android / Linux: Dualboot entries in /boot/grub/menu.lst

More Stories

Pen-small
  • RedHat / CentOS
  • XCP-NG
  • XenServer

XCP-NG use powerbutton to shutdown Server

Andreas March 23, 2024 0
Pen-small
  • Linux
  • Ubuntu / Debian

Ubuntu 22.04 – Gnome Hacks – Remove Mounted Drives From the Dock

Andreas February 20, 2022 0
Pen-small
  • Linux
  • Ubuntu / Debian

Ubuntu 22.04 – Gnome Hacks – Minimize Apps on Click

Andreas February 6, 2022 0

Leave a Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Android (3)
  • Best Practices (3)
  • General (5)
  • Hardware (5)
  • Linux (79)
    • BTRFS (3)
    • RedHat / CentOS (37)
    • RHN Satellite (2)
    • Turnkey LInux (1)
    • Ubuntu / Debian (47)
  • Nagios (4)
  • Office (4)
    • Excel 2007 (2)
    • MS Project 2007 (1)
    • Office 2013 (1)
  • Open Source (2)
    • Owncloud (2)
  • Sharepoint (4)
    • Calculated Columns (3)
    • Sharepoint 2007 (4)
  • Solaris (25)
    • Disksuite (SDS) (2)
    • Solaris 11 (3)
    • ZFS (9)
    • Zones (1)
  • Things you don't expect in a Data-Center (1)
  • Urandom_Blog (1)
  • Veritas (1)
    • Netbackup (1)
  • Virtualisation (26)
    • Docker (2)
    • OpenVZ (3)
    • Proxmox (13)
    • VMWare (6)
    • XCP-NG (1)
    • XenServer (7)
  • Webhosting (9)
    • MySQL (1)
    • VPS (3)
    • Wordpress (4)
    • ZPanel (1)
  • Windows (7)

Related Posts

  1. Linux / VMware: Howto Increase a / (Root) LVM partition on a single vmdk without adding another partition
  2. RedHat / Ubuntu / Solaris / Linux: Slow SSH logins (5 second delay)
  3. CentOS / Debian: detect a new disk / lun without rebooting linux
  4. CentOS / RedHat: Quick Network Bonding eth0 and eth1
  5. Centos / Debian / LVM: Add a new disk as a LVM volume
  6. Overview of the Support Lifecycle for a few selected Enterprise Linux Distributions

Tags

Android apache apt-get btrfs Calculated Column CentOS change compression Debian hostname Howto IP Address Linux List LVM Mysql networking performance Proxmox RedHat / CentOS repository RHN Satellite SDS Sharepoint 2007 Solaris Solaris 10 Solaris 11 Spacewalk ssh Sun Ubuntu Ubuntu / Debian Unity update usefull commands Virtualisation VMWare VMWare Player VMWare Workstation Windows 10 XenServer yum ZFS zfs native zfs on linux

Categories

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

You may have missed

Pen-small
  • RedHat / CentOS
  • XCP-NG
  • XenServer

XCP-NG use powerbutton to shutdown Server

Andreas March 23, 2024 0
Pen-small
  • Linux
  • Ubuntu / Debian

Ubuntu 22.04 – Gnome Hacks – Remove Mounted Drives From the Dock

Andreas February 20, 2022 0
image-9
  • Best Practices
  • General

Virtual Business Cards via QR Code

Andreas February 15, 2022 0
Pen-small
  • Linux
  • Ubuntu / Debian

Ubuntu 22.04 – Gnome Hacks – Minimize Apps on Click

Andreas February 6, 2022 0
Pen-small
  • Linux
  • Ubuntu / Debian
  • Windows

Ubuntu 22.04 – Fix grub dual boot with windows

Andreas February 6, 2022 0
Copyright © All rights reserved. | CoverNews by AF themes.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT
%d