Previous section   Next section

Recipe 3.18 Setting the Source Address for Telnet

3.18.1 Problem

You want to force your router to use a particular IP source address when making outbound Telnet connections.

3.18.2 Solution

To configure a single common IP source address for all outbound Telnet sessions, use the following configuration command:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ip telnet source-interface loopback0
Router1(config)#end
Router1#

You can also set the IP source address for individual outbound Telnet sessions on the command line:

Router1#telnet 172.25.1.5 /source-interface loopback0

3.18.3 Discussion

By default, the router uses the IP address of the closest interface to the destination as the source address when it makes an outbound Telnet session. However, network administrators frequently want to use an address other than the one closest to the destination. For instance, access lists or route filters may block packets with the default source address. Selecting a particular source IP address for a Telnet session can also help in troubleshooting network problems.

Cisco provides two methods for setting the source IP address of Telnet sessions: global and session-specific. The global configuration example forces all Telnet sessions to use the IP address of the configured interface as the source address. However, if the configured interface has no IP address, or is operationally down, the router will resort to its default behavior of using the closest interface IP address.

The session-specific method allows the administrator to manually select an appropriate IP source address on a per-session basis. Again, if the configured interface has no IP address or is operationally down, the router will resort to its default behavior. Note that the individual method of setting the Telnet source address supersedes the global setting.


  Previous section   Next section
Top