Print | Rate this content

HP ProCurve 3500/3500yl/6200yl Switches - Using the ping Command to Specify Different Source IP Addresses

Information

The ping command by default will use the IP address of the VLAN configured for the outgoing interface as the "source address" for the IP packet. Using the command qualifier "Source" with the ping command allows for different source IP addresses.

Details

In the example, two ProCurve switches are connected with a FastEthernet interface. The VLAN configured with the interfaces has an IP subnet address of 192.168.1.0/24.

Debugging for IP packets has been enabled on Switch_2 for testing purposes. The ping command is executed using the four possible qualifiers for the source IP address.

Enable debug for IP packets on Switch_2:


Switch_2# debug ip packet
Switch_2# configure
Switch_2(config)# debug destination session

Using the outgoing interface as the source IP address:


Switch_1# ping 192.168.1.2
192.168.1.2 is alive, time = 1 ms

Switch_2#
0043:11:59:11.66 IP mIpPktRecv:s=192.168.1.1(vl1) d=192.168.1.2 recv
0043:11:59:11.74 IP mIpPktRecv:s=192.168.1.2 d=192.168.1.1(vl1) xmit

Using VLAN 2 as the source IP address:


Switch_1# ping 192.168.1.2 source 2
192.168.1.2 is alive, time = 2 ms

Switch_2#
0043:11:59:22.89 IP mIpPktRecv:s=192.168.2.1(vl1) d=192.168.1.2 recv
0043:11:59:22.97 IP mIpPktRecv:s=192.168.1.2 d=192.168.2.1(vl1) g=192.168.1.1

Using the IP address 192.168.2.1 as the source IP address:


Switch_1# ping 192.168.1.2 source 192.168.2.1
192.168.1.2 is alive, time = 1 ms

Switch_2#
0043:11:59:22.89 IP mIpPktRecv:s=192.168.2.1(vl1) d=192.168.1.2 recv
0043:11:59:22.97 IP mIpPktRecv:s=192.168.1.2 d=192.168.2.1(vl1) g=192.168.1.1

Using the Loopback IP address as the source IP address:


Switch_1# ping 192.168.1.2 source loopback 0
192.168.1.2 is alive, time = 1 ms

Switch_2#
0043:11:59:54.62 IP mIpPktRecv:s=10.10.10.10(vl1) d=192.168.1.2 recv
0043:11:59:54.70 IP mIpPktRecv:s=192.168.1.2 d=10.10.10.10(vl1) g=192.168.1.1

Switch configuration script:


Switch_2# show running-config

hostname "Switch_2"

ip default-gateway 192.168.1.1
vlan 1
name "DEFAULT_VLAN"
untagged 1-24
ip address 192.168.1.2 255.255.255.0

Switch_1# show running-config

vlan 1
name "DEFAULT_VLAN"
untagged 1,3-48,A1-A4
ip address 192.168.1.1 255.255.255.0

vlan 2
name "VLAN2"
untagged 2
ip address 192.168.2.1 255.255.255.0

interface loopback 0
ip address 10.10.10.10

Legal Disclaimer: Products sold prior to the November 1, 2015 separation of Hewlett-Packard Company into Hewlett Packard Enterprise Company and HP Inc. may have older product names and model numbers that differ from current models.

Provide feedback

Please rate the information on this page to help us improve our content. Thank you!
Document title: HP ProCurve 3500/3500yl/6200yl Switches - Using the ping Command to Specify Different Source IP Addresses
Document ID: emr_na-c02920971-1
How helpful was this document?
How can we improve this document?
Note: Only English language comments can be accepted at this time.
Please wait while we process your request.