tcpreplay.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <!--#exec cmd="header tcpreplay" -->
  2. <ul>
  3. </ul><H2>NAME </H2><ul>
  4. tcpreplay - Replay network traffic stored in pcap files
  5. </ul><H2>SYNOPSIS </H2><ul>
  6. <b>tcpreplay</b>
  7. [<b>-<i>flag</i></b> [<i>value</i>]]... [<b>--<i>opt-name</i></b> [[=| ]<i>value</i>]]...
  8. <br>
  9. &lt;pcap_file(s)&gt;
  10. <p>
  11. tcpreplay is a tool for replaying network traffic from files saved with
  12. tcpdump or other tools which write pcap(3) files.
  13. </ul><H2>DESCRIPTION </H2><ul>
  14. This manual page documents, briefly, the <b>tcpreplay</b> command.
  15. The basic operation of tcpreplay is to resend all packets from the
  16. input file(s) at the speed at which they were recorded, or a specified
  17. data rate, up to as fast as the hardware is capable.
  18. <p>Optionally, the traffic can be split between two interfaces, written to
  19. files, filtered and edited in various ways, providing the means to test
  20. firewalls, NIDS and other network devices.
  21. </ul><H2>OPTIONS </H2><ul>
  22. <p><dl compact><dt><b>-a</b>, <b>--accurate</b>
  23. <dd>Enable more accurate packet timing.
  24. This option may appear up to 1 times.
  25. </dl>
  26. <p>
  27. Enables more accurate timing between packets at the cost of higher
  28. CPU utilization.
  29. <p><dl compact><dt><b>-d</b> <i>number</i>, <b>--dbug</b>=<b><i>number</i></b>
  30. <dd>Enable debugging output.
  31. This option may appear up to 1 times.
  32. This option takes an integer number as its argument.
  33. The value of <i>number</i> is constrained to being:
  34. <pre>
  35. in the range 0 through 5
  36. <br></pre>
  37. The default <i>number</i> for this option is:
  38. </dl><br>
  39. 0
  40. <p>
  41. If configured with --enable-debug, then you can specify a verbosity
  42. level for debugging output. Higher numbers increase verbosity.
  43. <p><dl compact><dt><b>-v</b>, <b>--verbose</b>
  44. <dd>Print decoded packets via tcpdump to STDOUT.
  45. This option may appear up to 1 times.
  46. </dl>
  47. <p>
  48. <p><p><dl compact><dt><b>-A</b> <i>string</i>, <b>--decode</b>=<b><i>string</i></b>
  49. <dd>Arguments passed to tcpdump decoder.
  50. This option may appear up to 1 times.
  51. This option must appear in combination with the following options:
  52. verbose.
  53. </dl>
  54. <p>
  55. When enabling verbose mode (<b>-v</b>) you may also specify one or more
  56. additional arguments to pass to <b>tcpdump</b> to modify the way packets
  57. are decoded. By default, -n and -l are used. Be sure to
  58. quote the arguments like: -A "-axxx" so that they are not interpreted
  59. by tcpreplay. The following arguments are vaild:
  60. [ -aAeNqRStuvxX ]
  61. [ -E spi@ipaddr algo:secret,... ]
  62. [ -s snaplen ]
  63. <p><dl compact><dt><b>-c</b> <i>string</i>, <b>--cachefile</b>=<b><i>string</i></b>
  64. <dd>Split traffic via a tcppep cache file.
  65. This option may appear up to 1 times.
  66. </dl>
  67. <p>
  68. <p><p><dl compact><dt><b>-i</b> <i>string</i>, <b>--intf1</b>=<b><i>string</i></b>
  69. <dd>Server/primary traffic output interface.
  70. This option may appear up to 1 times.
  71. </dl>
  72. <p>
  73. <p><p><dl compact><dt><b>-I</b> <i>string</i>, <b>--intf2</b>=<b><i>string</i></b>
  74. <dd>Client/secondary traffic output interface.
  75. This option may appear up to 1 times.
  76. This option must appear in combination with the following options:
  77. cachefile.
  78. </dl>
  79. <p>
  80. <p><p><dl compact><dt><b>-l</b> <i>number</i>, <b>--loop</b>=<b><i>number</i></b>
  81. <dd>Loop through the capture file X times.
  82. This option may appear up to 1 times.
  83. This option takes an integer number as its argument.
  84. The value of <i>number</i> is constrained to being:
  85. <pre>
  86. greater than or equal to 0
  87. <br></pre>
  88. The default <i>number</i> for this option is:
  89. </dl><br>
  90. 1
  91. <p>
  92. <p><p><dl compact><dt><b>-L</b>, <b>--pktlen</b>
  93. <dd>Override the snaplen and use the actual packet len.
  94. This option may appear up to 1 times.
  95. </dl>
  96. <p>
  97. By default, tcpreplay will send packets based on the size of the "snaplen"
  98. stored in the pcap file which is usually the correct thing to do. However,
  99. occasionally, tools will store more bytes then told to. By specifying this
  100. option, tcpreplay will ignore the snaplen field and instead try to send
  101. packets based on the original packet length. Bad things (TM) may happen if
  102. you specify this option.
  103. <p><dl compact><dt><b>-m</b> <i>string</i>, <b>--multiplier</b>=<b><i>string</i></b>
  104. <dd>Modify replay speed to a given multiple.
  105. This option may appear up to 1 times.
  106. This option must not appear in combination with any of the following options:
  107. pps, mbps, oneatatime, topspeed.
  108. </dl>
  109. <p>
  110. Specify a floating point value to modify the packet replay speed.
  111. Examples:
  112. <pre>
  113. 2.0 will replay traffic at twice the speed captured
  114. <br> 0.7 will replay traffic at 70% the speed captured
  115. <br></pre>
  116. <p><dl compact><dt><b>-p</b> <i>number</i>, <b>--pps</b>=<b><i>number</i></b>
  117. <dd>Replay packets at a given packets/sec.
  118. This option may appear up to 1 times.
  119. This option must not appear in combination with any of the following options:
  120. multiplier, mbps, oneatatime, topspeed.
  121. This option takes an integer number as its argument.
  122. </dl>
  123. <p>
  124. <p><p><dl compact><dt><b>-M</b> <i>string</i>, <b>--mbps</b>=<b><i>string</i></b>
  125. <dd>Replay packets at a given Mbps.
  126. This option may appear up to 1 times.
  127. This option must not appear in combination with any of the following options:
  128. multiplier, pps, oneatatime, topspeed.
  129. </dl>
  130. <p>
  131. Specify a floating point value for the Mbps rate that tcpreplay
  132. should send packets at.
  133. <p><dl compact><dt><b>-t</b>, <b>--topspeed</b>
  134. <dd>Replay packets as fast as possible.
  135. This option must not appear in combination with any of the following options:
  136. mbps, multiplier, pps, oneatatime.
  137. </dl>
  138. <p>
  139. <p><p><dl compact><dt><b>-o</b>, <b>--oneatatime</b>
  140. <dd>Replay one packet at a time for each user input.
  141. This option must not appear in combination with any of the following options:
  142. mbps, pps, multiplier, topspeed.
  143. </dl>
  144. <p>
  145. Allows you to step through one or more packets at a time.
  146. <p><dl compact><dt><b>-P</b>, <b>--pid</b>
  147. <dd>Print the PID of tcpreplay at startup.
  148. </dl>
  149. <p>
  150. <p><p><dl compact><dt><b>-V</b>, <b>--version</b>
  151. <dd>Print version information.
  152. </dl>
  153. <p>
  154. <p><p><dl compact><dt><b>-h</b>, <b>--less-help</b>
  155. <dd>Display less usage information and exit.
  156. </dl>
  157. <p>
  158. <p><p><dl compact><dt><b>-H</b>,<b> --help</b>
  159. <dd>Display usage information and exit.
  160. <dt><b>-!</b>,<b> --more-help</b>
  161. <dd>Extended usage information passed thru pager.
  162. <dt><b>-</b> [<i>rcfile</i>],<b> --save-opts</b>[=<i>rcfile</i>]
  163. <dd>Save the option state to <i>rcfile</i>. The default is the <i>last</i>
  164. configuration file listed in the <b>OPTION PRESETS</b> section, below.
  165. <dt><b>-</b> <i>rcfile</i>,<b> --load-opts</b>=<i>rcfile</i>,<b> --no-load-opts</b>
  166. <dd>Load options from <i>rcfile</i>.
  167. The <i>no-load-opts</i> form will disable the loading
  168. of earlier RC/INI files. <i>--no-load-opts</i> is handled early,
  169. out of order.
  170. </dl>
  171. </ul><H2>OPTION PRESETS </H2><ul>
  172. Any option that is not marked as <i>not presettable</i> may be preset
  173. by loading values from configuration ("RC" or ".INI") file(s).
  174. The <i>homerc</i> file is "<i>$$/</i>", unless that is a directory.
  175. In that case, the file "<i>.tcpreplayrc</i>"
  176. is searched for within that directory.
  177. </ul><H2>SIGNALS </H2><ul>
  178. tcpreplay understands the following signals:
  179. <p>
  180. <i><b>SIGUSR1</b></i>
  181. Suspend tcpreplay
  182. <p>
  183. <i><b>SIGCONT</b></i>
  184. Restart tcpreplay
  185. <br>
  186. <p>
  187. </ul><H2>SEE ALSO </H2><ul>
  188. tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
  189. <p>
  190. </ul><H2>BUGS </H2><ul>
  191. tcpreplay can only send packets as fast as your computer's interface,
  192. processor, disk and system bus will allow.
  193. <p>Replaying captured traffic may simulate odd or broken conditions on your
  194. network and cause problems.
  195. <p>Some operating systems by default do not allow for forging source MAC
  196. addresses. Please consult your operating system's documentation and the
  197. tcpreplay FAQ if you experiance this issue.
  198. </ul><H2>AUTHOR </H2><ul>
  199. Copyright 2000-2005 Aaron Turner
  200. <p>For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  201. <p>
  202. Released under the Free BSD License.
  203. <p>
  204. This manual page was <i>AutoGen</i>-erated from the <b>tcpreplay</b>
  205. option definitions.
  206. </ul>
  207. <!--#exec cmd="trailer" -->