Arun Khan
2017-Oct-02 20:03 UTC
[CentOS] Display IP addresses on the system console *before* the login prompt.
I have a bunch of VBox Linux VMs (CentOS 6/7, Debian7/8/9, Ubuntu (14.0/16.04, Alpine) that get dynamic IPs. To get their respecitive IP addresses I have to login and run 'ip addr' I would like such info to be displayed on the VM console *before* the login prompt. Ideally an ASCII log + info (see below sig line). Thus, I can get the info from the VM console without having to login. I read up on /etc/issue but adding "\4{eth0}" to the existing string does not work. TIA for solutions/pointers -- Arun Khan <console display> _ _ | |__ ___ ___| |_ _ __ __ _ _ __ ___ ___ | '_ \ / _ \/ __| __| '_ \ / _` | '_ ` _ \ / _ \ | | | | (_) \__ \ |_| | | | (_| | | | | | | __/ |_| |_|\___/|___/\__|_| |_|\__,_|_| |_| |_|\___| lo: 127.0.0.1 eth0: 10.1.1.122 kernel: 4.10.0-33-generic x86_64 login: </console display>
Leroy Tennison
2017-Oct-02 20:31 UTC
[CentOS] Display IP addresses on the system console *before* the login prompt.
What does 'man agetty' (or whatever you're using) on the OS in question say? Ubuntu 14.04 doesn't list "\4{<nic>}" as an option and it doesn't work, 16.04 does and it does appear there (might have to press Enter to get a screen refresh). If the OS doesn't support it then you'll have to get creative (send 'ip addr' output to /etc/issue at boot or periodically) to get what you want. ----- Original Message ----- From: "Arun Khan" <knura9 at gmail.com> To: "centos" <centos at centos.org> Sent: Monday, October 2, 2017 3:03:00 PM Subject: [CentOS] Display IP addresses on the system console *before* the????????login prompt. I have a bunch of VBox Linux VMs (CentOS 6/7, Debian7/8/9, Ubuntu (14.0/16.04, Alpine) that get dynamic IPs. ?To get their respecitive IP addresses I have to login and run 'ip addr' I would like such info to be displayed on the VM console *before* the login prompt. ?Ideally an ASCII log + info (see below sig line). Thus, I can get the info from the VM console without having to login. I read up on /etc/issue but adding "\4{eth0}" to the existing string does not work. TIA for solutions/pointers -- Arun Khan <console display> ?_ ? ? ? ? ? ? ? _ | |__ ? ___ ?___| |_ _ __ ? __ _ _ __ ___ ? ___ | '_ \ / _ \/ __| __| '_ \ / _` | '_ ` _ \ / _ \ | | | | (_) \__ \ |_| | | | (_| | | | | | | ?__/ |_| |_|\___/|___/\__|_| |_|\__,_|_| |_| |_|\___| lo: 127.0.0.1 eth0: 10.1.1.122 kernel: 4.10.0-33-generic x86_64 login: </console display> _______________________________________________ CentOS mailing list CentOS at centos.org https://lists.centos.org/mailman/listinfo/centos
Jose Maria Terry Jimenez
2017-Oct-02 20:59 UTC
[CentOS] Display IP addresses on the system console *before* the login prompt.
El 2/10/17 a las 22:03, Arun Khan escribi?:> I read up on /etc/issue but adding "\4{eth0}" to the existing string > does not work. > >This works for me in CentOS 7 (in /etc/issue) System IPv4: \4{ens33} You must replace {ens33} with the nic name you want to show. Get it with ifconfig
Arun Khan
2017-Oct-02 21:04 UTC
[CentOS] Display IP addresses on the system console *before* the login prompt.
On Mon, Oct 2, 2017 at 1:31 PM, Leroy Tennison <leroy at datavoiceint.com> wrote:> What does 'man agetty' (or whatever you're using) on the OS in question say? > > Ubuntu 14.04 doesn't list "\4{<nic>}" as an option and it doesn't work, 16.04 does and it does appear there (might have to press Enter to get a screen refresh). > > If the OS doesn't support it then you'll have to get creative (send 'ip addr' output to /etc/issue at boot or periodically) to get what you want. >You are right, Ubuntu 14.04 does not support it and that's where it does *not* work. I read the getty man page in CentOS 7/Ubuntu 16.04 and implemented in Ubuntu 14.04 duh. -- Arun Khan
m.roth at 5-cent.us
2017-Oct-02 21:11 UTC
[CentOS] Display IP addresses on the system console *before* the login prompt.
Jose Maria Terry Jimenez wrote:> El 2/10/17 a las 22:03, Arun Khan escribi?: > >> I read up on /etc/issue but adding "\4{eth0}" to the existing string >> does not work. >> >> > This works for me in CentOS 7 (in /etc/issue) > > System IPv4: \4{ens33} > > You must replace {ens33} with the nic name you want to show. Get it with > ifconfig >That would be ip a mark