1

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
  <cr>

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

ping 10.0.0.1 source x
ping 10.0.0.1 -s x

all do not work.

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

2 Answers 2

3
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
  <cr>

rtr3745#ping ip ?
  WORD  Ping destination address or hostname
  <cr>

rtr3745#ping ip 1.1.1.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
  <cr>

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

4

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

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

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 that you have read and understand our privacy policy and code of conduct.

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