This article is about SNMP V3 Engine-ID behaviour when management interface is disabled or down
Physical interface: re0:mgmt-0, Enabled, Physical link is Down
The recommendation from Juniper is to set primary IP address if device has multiple RE or use MAC address alternatively, as mentioned in below document.
https://www.juniper.net/documentation/us/en/software/junos/network-mgmt/topics/topic-map/configure-the-local-engine-id.html
By default, the local engine ID uses the default IP address of the router. The local engine ID is the administratively unique identifier for the SNMPv3 engine.
From Doc:
For the engine ID, we recommend using the primary IP address of the device if the device has multiple routing engines and has the primary IP address configured. Alternatively, you can use the MAC address of the management port if the device has only one Routing Engine.
If nothing is set by config, it takes the the default IP address of the router, which is the management interface IP.
But if the management interface is also down, then suffix part of engine ID remain all zeros (00 00 00 00).
show snmp v3 | match "engine ID"
Local engine ID: 80 00 0a 4c 01 00 00 00 00
Engine ID: local
In case management interface IP was set earlier & then later removed or disabled, it may take old ID again.
+++++++++++++++++++++
labroot@jtac-acx7024-r2021> show interfaces terse re*
Interface Admin Link Proto Local Remote
re0:mgmt-0 up up
re0:mgmt-0.0 up up inet 10.219.37.225/26
root@jtac-acx7024-r2021# set interfaces re0:mgmt-0 disable
[edit]
root@jtac-acx7024-r2021# commit
commit complete
root@jtac-acx7024-r2021> show snmp v3 | grep "engine ID"
Local engine ID: 80 00 0a 4c 01 0a db 25 e1
This will change once you set mac-address for engine-id.
root@jtac-acx7024-r2021# set snmp engine-id use-mac-address
root@jtac-acx7024-r2021# commit and-quit
Exiting configuration mode
Local engine ID: 80 00 0a 4c 03 d0 48 a1 34 4d 1f
Hence, in summary, if you are not using management interface then its better to add mac-address.
set snmp engine-id use-mac-address