ip source-interface

Syntax

ip source-interface {sflow | tftp | radius | tacacs | ntp | syslog | ubt | dhcp-relay | simplivity | dns | all} {interface|} [vrf] no ip source-interface {sflow | tftp | radius | tacacs | ntp | syslog | ubt | dhcp-relay | simplivity | dns | all} [interface|] [vrf]

Description

Sets a single source IP address for a feature on the switch. This ensures that all traffic sent the feature has the same source IP address regardless of how it egresses the switch. You can define a single global address that applies to all supported features, or an individual address for each feature.

This command provides two ways to set the source IP addresses: either by specifying a static IP address, or by using the address assigned to a switch interface. If you define both options, then the static IP address takes precedence.

Thenoform of this command deletes the single source IP address for all supported services, or a specific service.

Command contexts

config

Parameters

sflow | tftp | radius | tacacs | ntp | syslog | ubt | dhcp-relay | simplivity | dns | all

Sets a single source IP address for a specific service. Thealloption sets a global address that applies to all protocols that do not have an address set. For DHCP relay, the address is used as both the source IP and GIADDR.

interface

Specifies the name of the interface from which the specified service obtains its source IP address. The interface must have a valid IP address assigned to it. If the interface has both a primary and secondary IP address, the primary IP address is used.

Specifies the source IP address to use for the specified service. The IP address must be defined on the switch, and it must exist on the specified VRF (which is thedefaultVRF, if thevrfoption is not used). Specify the address in IPv4 format (x.x.x.x), wherexis a decimal number from 0 to 255.

vrf

Specifies the name of a VRF.

Authority

Administrators or local user group members with execution rights for this command.

Examples

Setting the IPv4 address10.10.10.5as the global single source address:
switch#configswitch(config)#ip source-interface all 10.10.10.5

Setting the secondary IPv4 address10.10.10.5on interface1/1/1as the global single source address. (On the 6400 Switch Series, interface identification differs.)

switch#configswitch(config)#interface 1/1/1switch(config-if)#routingswitch(config-if)#ip address 10.10.10.1/24switch(config-if)#ip address 10.10.10.5/24 secondary开关(配置)#出口开关(配置)# ip source-interface all 10.10.10.5
Clearing the global single source IP address10.10.10.5:
switch(config)#no ip source-interface all 10.10.10.5