Configure the Source Address for Locally Generated TCP/IP Packets
By default, the source address included in locally generated TCP/IP packets, such as FTP traffic, and in UDP and IP packets, such as NTP requests, is chosen as the local address for the interface on which the traffic is transmitted. This means that the local address chosen for packets to a particular destination might change from connection to connection based on the interface that the routing protocol has chosen to reach the destination when the connection is established.
To configure the software to select a fixed address to use as the source for locally generated IP packets, include the
default-address-selectionstatement at the[edit system]hierarchy level:[edit system]default-address-selection;If you include the
default-address-selectionstatement in the configuration, the software chooses the system default address as the source for most locally generated IP packets. The default address is usually an address configured on thelo0loopback interface. For example, if you specified that ssh and telnet use a particular address, but you also havedefault-address selectionconfigured, the system default address is used. For more information about how the default address is chosen, see the JUNOS Internet Software Configuration Guide: Network Interfaces and Class of Service.For IP packets sent by IP routing protocols (including OSPF, RIP, RSVP, and the multicast protocols, but not including IS-IS), the local address selection is often constrained by the protocol specification so that the protocol operates correctly. When this constraint exists in the routing protocol, the packet's source address is unaffected by the presence of the
default-address-selectionstatement in the configuration. For protocols in which the local address is unconstrained by the protocol specification, for example, IBGP and multihop EBGP, if you do not configure a specific local address when configuring the protocol, the local address is chosen using the same method as other locally generated IP packets.