All IP traffic that is sourced from the router includes a source address in the IP header. The address chosen for packets depends on the interface that is used to reach the destination when the connection is established. You want to configure the router to used a fixed address.
Use the following
command to always uses
lo0 loopback address as the source address in IP packets:
set system default-address-selection
When selecting an address to include in the source address field of IP packets, the JUNOS software chooses from among the addresses configured on the router. The first candidate to use is the first non-
127.0.0.1 address configured on the
lo0 interface. However, this means that the software usually, but not always, chooses the loopback address. To ensure that the software always uses the router's IP address, use the
set system default-address-selection command. Including this command is considered good practice so that when other systems on the network receive traffic from the local router, the packets always have the same address in the IP packet's source address field. This command forces the router to use one specific address, the
lo0 address, for most of the traffic that originates from the router. The source address never affects traffic that is forwarded by the router, only packets that are sourced from the router. If multiple addresses are configured for
lo0, the software chooses ...