Loopback interface made down in RE shell is getting auto up after commit in 23.x releases
Lo0 comes auto up after commit as in below
user@DUT/var/home/labroot # ifconfig lo0 down
user@DUT> show interfaces terse lo0
Interface Admin Link Proto Local Remote
lo0 down up
lo0.16384 up down inet 127.0.0.1 --> 0/0
lo0.16385 up down inet
[edit]
user@DUT# set system host-name TEST
user@DUT# commit
commit complete
user@DUT# run show interfaces terse lo0
lo0 up up
lo0.16384 up up inet 127.0.0.1 --> 0/0
lo0.16385 up up inet
This is expected behavior and not a bug. The behavior was corrected starting from Junos version 21.4, which is why this behaviour is seen in 23.x releases.
When the lo0 interface is manually brought down using ifconfig, it directly updates the kernel state, causing the interface to show as down.
The system’s internal process (DCD) receives an asynchronous notification about this change.
During the next CLI commit, DCD checks the configuration and sees that lo0 is still configured as up.
DCD then sends an update to the kernel to bring the interface back up, which is the expected behavior.
Recommendation:
It is strongly advised not to use ifconfig for changing interface states.
Always use the CLI configuration commands to manage interface states. This ensures consistency across system components and helps avoid unexpected behavior.