1

I can not use ping 'target' source 'interface'

ping 192.168.0.2 source lo0

% Invalid input detected at '^' marker.

It's possible if I use "ping"

R2#ping
Protocol [ip]: ip
Target IP address: 192.168.0.2
Repeat count [5]: 
Datagram size [100]: 
Timeout in seconds [2]: 
Extended commands [n]: y
Source address or interface: loopback0
Type of service [0]: 
Set DF bit in IP header? [no]: 
Validate reply data? [no]: 
Data pattern [0xABCD]: 
Loose, Strict, Record, Timestamp, Verbose[none]: 
Sweep range of sizes [n]: 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/25/59 ms

That's time consuming! I'd like to use the "shortcut command" but I can't! Any suggestion?

My Topology, for curious enter image description here

I'm trying ping 192.168.0.2 (R2) source 192.168.1.1 (Loopback0)

  • got no problem with that command and source interface as loopback. maybe IOS limitation. I suggest to state the IOS version. Is there loopback option as the source interface for the command in your router? If no, then it is IOS limitation. – Ron Vince Aug 18 '15 at 1:54
  • Version 12.4(15)T1 I can use source interface using extended ping.. Furthermore I see some video tutorials that They use it – TMoraes Aug 18 '15 at 2:12
  • According to the command reference, this should be available on the command line of the 12.4(15)T train as long as you are in privileged mode. Could you also provide your platform? Maybe there is some platform specific differences? – YLearn Aug 18 '15 at 3:37
  • What happens when you specify the IP address of the source interface rather than the interface name? This is how I've always used the "one line" extended ping and it's worked fine for me. – John Jensen Aug 18 '15 at 4:56
  • @YLearn Platform? OS? @ John Jensen using directly IP Addr I didn't test! – TMoraes Aug 18 '15 at 13:56
3

Packet Tracer does not provide access to IOS. It provides access to an IOS-like environment that has a limited subset of IOS features/commands, mainly tailored to learn CCNA level concepts.

As such, it doesn't surprise me that you do not have this option on the command line.

  • Wow, this explains everything. – John Jensen Aug 19 '15 at 4:32
1

I had the same problem. It is strange but in my case adding ip addressing on interface unlocked additional options in ping command

R2#ping ip 1.1.1.1 ?
  <cr>

R2#conf t          
Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#int fa0/0
R2(config-if)#ip address 10.0.0.2 255.0.0.0
R2(config-if)#^Z

R2#ping 10.0.0.1 ?
  data      specify data pattern
  df-bit    enable do not fragment bit in IP header
  repeat    specify repeat count
  size      specify datagram size
  source    specify source address or name
  timeout   specify timeout interval
  validate  validate reply data
0

Source address or interface is a partial output of the extended ping command. The interface cannot be written as lo0.

Look at this page Using the Extended ping and Extended traceroute Commands

  • Even trying ping 192.168.0.2 source loopback 0 or loopback0 it doesn't works! – TMoraes Aug 18 '15 at 1:46
0

Instead of supplying the exit interface, use the source IP address instead.

ping 192.168.1.1 source 10.15.2.1 repeat 100

This should do what you want.

  • John, using R2#ping 192.168.0.2 source 192.168.1.1 repeat 100 ^ % Invalid input detected at '^' marker.] – TMoraes Aug 18 '15 at 14:14
  • I get the same error as Thiago. What version of IOS are you using that allows you to state "source"? – stephen muth Aug 18 '15 at 16:13
  • @stephenmuth, from Cisco documentation: The following keywords were added in Cisco IOS Release 12.0: data, df-bit, repeat, size, source, timeout, validate. – YLearn Aug 19 '15 at 3:59
  • I've used this on NX-OS for sure, and various of versions IOS. I'll have to test a few boxes tomorrow, but I don't think I've ever had problems running the command... – John Jensen Aug 19 '15 at 4:20
-1

Ping has an option to allow you to use specific option source ip address to destination.

Syntax: ping -I source ip destination ip

Ex: ping -I 10.5.6.7 173.34.56.77

  • That's the ping binary on linux, not the ping command on cisco. – Teun Vink Jan 20 '18 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.