The intention of this article is to assist you in identifying the Routing Engine that you are currently logged into.
Option 1 : The practice of adding Routing Engine (RE) information to hostnames can be quite beneficial in identifying the routing engine that we are currently logged into.
{master}labroot@labrouter-RE0> show chassis hardware | match routing Routing Engine 0 REV 11 740-041821 90XXXXXX26 RE-S-1800x4Routing Engine 1 REV 12 740-041821 90XXXXXX04 RE-S-1800x4
{master}labroot@labrouter-RE0> show configuration groups re0 |display set set groups re0 system host-name labrouter-RE0
{master}labroot@labrouter-RE0> show configuration groups re1 |display set set groups re1 system host-name labrouter-RE1
{master}labroot@labrouter-RE0> show configuration apply-groups |display set set apply-groups re0set apply-groups re1
{master}labroot@labrouter-RE0> request routing-engine login other-routing-engine Last login: Mon Dec 30 04:28:38 from re0
--- JUNOS 21.2R3-S7.7 Kernel 64-bit JNPR-12.1-20231013.2183cac_buil...
{backup}labroot@labrouter-RE1>
Option 2 : Running the command below can help identify the routing engine you are currently logged into
{master}labroot@labrouter-RE0> start shell command "sysctl -a kern.junos_hostname" kern.junos_hostname: re0
{master}labroot@labrouter-RE0> request routing-engine login other-routing-engine
{backup}labroot@labrouter-RE1> start shell command "sysctl -a kern.junos_hostname" kern.junos_hostname: re1