Tips for using the Cisco IOS extended ping command

Source: Internet
Author: User

When performing a Cisco decomposition experiment, such as routing, ACL, and route-map, you can use the extended ping command to specify the source address for testing if you only use a vro without adding a PC, by default, the extended ping command is interactive. If you have used it, you only need to press a lot of keys, today, I know for the first time that CCIE does not know that the extended ping command can be used directly with parameters...

Command: ping x. x source x. x repeat x

A Brief Introduction to common applications is only applicable to popular science. The following figure shows the topology. R1 configures two loopback interfaces as the test source, R2 configures one loopback interface as the test destination, and the routing protocol selects OSPF (because of fast convergence ), all IP addresses except 1.1.1.1/32 are advertised to the OSPF process.

R1 Configuration:

!
Interface Loopback0
Ip address 1.1.1.1 255.255.255.255
!
Interface Loopback2
Ip address 3.3.3.3 255.255.255.255
!
Interface FastEthernet0/0
Ip address 192.168.1.1 255.255.255.0
!
Router VPN 1
Network 3.3.3.3 0.0.0.0
Network 192.168.1.0
No auto-summary
!

R2 main configuration

!
Interface Loopback0
Ip address 2.2.2.2 255.255.255.255
!
Interface FastEthernet0/0
Ip address 192.168.1.2 255.255.255.0
!
Router VPN 1
Network 2.2.2.2 0.0.0.0
Network 192.168.1.0
No auto-summary
!

R1 route table:

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
D 2.2.2.2 [90/156160] via 192.168.1.2, 00:24:19, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback2
C 192.168.1.0/24 is directly connected, FastEthernet0/0

R2 route table:

2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
D 3.3.3.3 [90/156160] via 192.168.1.1, 00:24:42, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0

Extended ping normal test (re 1 is to save time, only one packet is sent ):

R1 # ping 2.2.2.2 re 1
Sending 1, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Success rate is 100 percent (1/1), round-trip min/avg/max = 24/24/24 MS

R1 # ping 2.2.2.2 so 1.1.1.1 re 1
Sending 1, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
Success rate is 0 percent (0/1)

R1 # ping 2.2.2.2 so 3.3.3.3 re 1
Sending 1, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
Success rate is 100 percent (1/1), round-trip min/avg/max = 20/20/20 MS

Analysis: Because 1.1.1.1/32 is not declared to the OSPF process, R2 cannot learn the route information about 1.1.1.1/32. Therefore, after R1 sends packets from 1.1.1.1/32 to R2, r2 cannot send the data packet back, resulting in ping failure.

Debug to view the detailed ping packet (analyze the source address when so is not added ):

Generally, the debug statement of the ping package is the debug ip packet, but this will display a lot of information we don't need, such as route exchange information. If you only want to view the icmp ping packet, you can use the ACL to implement filtering.

R1 (config) # access-list 101 permit icmp any host 2.2.2.2

Create an ICMP packet whose ACL matches the destination address 2.2.2.2

R1 # debug ip packet 101.
IP packet debugging is on for access list 101

Enable debug ip packet based on acl 101

R1 # ping 2.2.2.2 re 1
Sending 1, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Success rate is 100 percent (1/1), round-trip min/avg/max = 36/36/36 MS
R1 #
* Mar 1 00:33:20. 867: IP: tableid = 0, s = 192.168.1.1 (local), d = 2.2.2.2 (FastEthernet0/0), routed via FIB
* Mar 1 00:33:20. 867: IP: s = 192.168.1.1 (local), d = 2.2.2.2 (FastEthernet0/0), len 100, sending

R1 # ping 2.2.2.2 so 1.1.1.1 re 1
Sending 1, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
* Mar 1 00:33:28. 691: IP: tableid = 0, s = 1.1.1.1 (local), d = 2.2.2.2 (FastEthernet0/0), routed via FIB
* Mar 1 00:33:28. 691: IP: s = 1.1.1.1 (local), d = 2.2.2.2 (FastEthernet0/0), len 100, sending.
Success rate is 0 percent (0/1)

R1 # ping 2.2.2.2 so 3.3.3.3 re 1
Sending 1, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
Success rate is 100 percent (1/1), round-trip min/avg/max = 40/40/40 MS
R1 #
* Mar 1 00:34:39. 227: IP: tableid = 0, s = 3.3.3.3 (local), d = 2.2.2.2 (FastEthernet0/0), routed via FIB
* Mar 1 00:34:39. 227: IP: s = 3.3.3.3 (local), d = 2.2.2.2 (FastEthernet0/0), len 100, sending

Analysis: From the debug information, we can see that ping without so uses the IP address configured for the destination network interface, and the Local interface is identified from the debug information. Some technologies used in the experiment, such as the route-map configured on the interface, do not process the traffic generated by the local interface. You need to change it to the global route-map, and pay special attention to such issues.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.