How can I ping with source option in Cisco Router?

I have a ISR 4321 Router, I want to ping from a source IP address:

Router#ping ?
  WORD  Ping destination address or hostname
  ip    IP echo
  ipv6  IPv6 echo

there I have two question, how can I add source options in Cisco Router? I tried use the

ping source x
ping -s x

all do not work.

and when I #ping ?, what's the meaning of <cr>?

2 Answers 2

rtr3745#ping ?
  WORD  Ping destination address or hostname
  clns  CLNS echo
  ip    IP echo
  ipv6  IPv6 echo
  mpls  MPLS echo
  srb   srb echo
  tag   Tag encapsulated IP echo

rtr3745#ping ip ?
  WORD  Ping destination address or hostname

rtr3745#ping ip ?
  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

"?" shows the next valid element. Source can be the address of an interface, or the name of that interface.


You can use the ping command for choosing Extended commands options:

Protocol [ip]: 
Target IP address:
Repeat count [5]: 10
Datagram size [100]: 
Timeout in seconds [2]: 
Extended commands [n]: y
Source address or interface:

the <cr> it stands for "Carriage Return."

it means that, you can just click enter and the command is complete. There may be more commands in the ? output that you can append, but the <cr> means that you can hit enter, end the command, and not get an error for entering an incomplete command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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