Configuring Junos OS to Select a Fixed Source Address for Locally Generated TCP/IP Packets

 

Locally generated IP packets are the packets that are produced by applications running on the Routing Engine. Junos OS chooses a source address for these packets so that the application peers can respond. It also enables you to specify the source address on a per application basis. To serve this purpose, the Telnet CLI command contains the source-address argument.

This section introduces the default-address-selection statement:

If you specifically choose the source address, as in the case of Telnet, default-address-selection does not influence the source address selection. The source address becomes the one that is specified with the source-address argument (provided the address is a valid address specified on the interface of a router). If the source address is not specified or if the specified address is invalid, default-address-selection influences the default source address selection.

If the source address is not explicitly specified as in the case of Telnet, then by default (when default-address-selection is not specified) the source address chosen for locally generated IP packets is the IP address of the outgoing interface. This indicates that depending on the chosen outgoing interface, the source address might be different for different invocations of a given application.

If the interface is unnumbered (no IP address is specified on an interface), Junos OS uses a predictable algorithm to determine the default source address. If default-address-selection is specified, Junos OS uses the algorithm to choose the source address irrespective of whether the outgoing interface is numbered. This indicates that with default-address-selection, you can influence Junos OS to provide the same source address in locally generated IP packets regardless of the outgoing interface.

The behavior of source address selection by Junos OS can be summed up as shown in the following table:

Table 1: Source Address Selection

Outgoing Interface

When default-address-selection Is Specified

When default-address-selection Is Not Specified

Unnumbered

Use default-address-selection

Use default-address-selection

Numbered

Use default-address-selection

Use IP address of outgoing interface

See Configuring Default, Primary, and Preferred Addresses and Interfaces for more information about the default address source selection algorithm.

Note

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-selection statement 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.