tcpreplay.1 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. .de1 NOP
  2. . it 1 an-trap
  3. . if \\n[.$] \,\\$*\/
  4. ..
  5. .ie t \
  6. .ds B-Font [CB]
  7. .ds I-Font [CI]
  8. .ds R-Font [CR]
  9. .el \
  10. .ds B-Font B
  11. .ds I-Font I
  12. .ds R-Font R
  13. .TH tcpreplay-edit 1 "26 Apr 2017" "tcpreplay" "User Commands"
  14. .\"
  15. .\" DO NOT EDIT THIS FILE (in-mem file)
  16. .\"
  17. .\" It has been AutoGen-ed
  18. .\" From the definitions tcpreplay_opts.def
  19. .\" and the template file agman-cmd.tpl
  20. .SH NAME
  21. \f\*[B-Font]tcpreplay-edit\fP
  22. \- Replay network traffic stored in pcap files
  23. .SH SYNOPSIS
  24. \f\*[B-Font]tcpreplay-edit\fP
  25. .\" Mixture of short (flag) options and long options
  26. [\f\*[B-Font]\-flags\f[]]
  27. [\f\*[B-Font]\-flag\f[] [\f\*[I-Font]value\f[]]]
  28. [\f\*[B-Font]\-\-option-name\f[][[=| ]\f\*[I-Font]value\f[]]]
  29. <pcap_file(s)>
  30. .sp \n(Ppu
  31. .ne 2
  32. tcpreplay is a tool for replaying network traffic from files saved with
  33. tcpdump or other tools which write pcap(3) files.
  34. .SH "DESCRIPTION"
  35. The basic operation of tcpreplay is to resend all packets from the
  36. input file(s) at the speed at which they were recorded, or a specified
  37. data rate, up to as fast as the hardware is capable.
  38. .sp
  39. Optionally, the traffic can be split between two interfaces, written to
  40. files, filtered and edited in various ways, providing the means to test
  41. firewalls, NIDS and other network devices.
  42. .sp
  43. For more details, please see the Tcpreplay Manual at:
  44. http://tcpreplay.appneta.com
  45. .SH "OPTIONS"
  46. .SS ""
  47. .TP
  48. .NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-portmap\f[]=\f\*[I-Font]string\f[]
  49. Rewrite TCP/UDP ports.
  50. This option may appear up to \-1 times.
  51. .sp
  52. Specify a list of comma delimited port mappingings consisting of
  53. colon delimited port number pairs. Each colon delimited port pair
  54. consists of the port to match followed by the port number to rewrite.
  55. .sp
  56. Examples:
  57. .nf
  58. \--portmap=80:8000 \--portmap=8080:80 # 80->8000 and 8080->80
  59. \--portmap=8000,8080,88888:80 # 3 different ports become 80
  60. \--portmap=8000-8999:80 # ports 8000 to 8999 become 80
  61. .fi
  62. .TP
  63. .NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-seed\f[]=\f\*[I-Font]number\f[]
  64. Randomize src/dst IPv4/v6 addresses w/ given seed.
  65. This option may appear up to 1 times.
  66. This option must not appear in combination with any of the following options:
  67. fuzz-seed.
  68. This option takes an integer number as its argument.
  69. .sp
  70. Causes the source and destination IPv4/v6 addresses to be pseudo
  71. randomized but still maintain client/server relationships.
  72. Since the randomization is deterministic based on the seed,
  73. you can reuse the same seed value to recreate the traffic.
  74. .TP
  75. .NOP \f\*[B-Font]\-N\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-pnat\f[]=\f\*[I-Font]string\f[]
  76. Rewrite IPv4/v6 addresses using pseudo-NAT.
  77. This option may appear up to 2 times.
  78. This option must not appear in combination with any of the following options:
  79. srcipmap.
  80. .sp
  81. Takes a comma delimited series of colon delimited CIDR
  82. netblock pairs. Each netblock pair is evaluated in order against
  83. the IP addresses. If the IP address in the packet matches the
  84. first netblock, it is rewritten using the second netblock as a
  85. mask against the high order bits.
  86. .sp
  87. IPv4 Example:
  88. .nf
  89. \--pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
  90. .fi
  91. IPv6 Example:
  92. .nf
  93. \--pnat=[2001:db8::/32]:[dead::/16],[2001:db8::/32]:[::ffff:0:0/96]
  94. .fi
  95. .TP
  96. .NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-srcipmap\f[]=\f\*[I-Font]string\f[]
  97. Rewrite source IPv4/v6 addresses using pseudo-NAT.
  98. This option may appear up to 1 times.
  99. This option must not appear in combination with any of the following options:
  100. pnat.
  101. .sp
  102. Works just like the \--pnat option, but only affects the source IP
  103. addresses in the IPv4/v6 header.
  104. .TP
  105. .NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-dstipmap\f[]=\f\*[I-Font]string\f[]
  106. Rewrite destination IPv4/v6 addresses using pseudo-NAT.
  107. This option may appear up to 1 times.
  108. This option must not appear in combination with any of the following options:
  109. pnat.
  110. .sp
  111. Works just like the \--pnat option, but only affects the destination IP
  112. addresses in the IPv4/v6 header.
  113. .TP
  114. .NOP \f\*[B-Font]\-e\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-endpoints\f[]=\f\*[I-Font]string\f[]
  115. Rewrite IP addresses to be between two endpoints.
  116. This option may appear up to 1 times.
  117. This option must appear in combination with the following options:
  118. cachefile.
  119. .sp
  120. Takes a pair of colon delimited IPv4/v6 addresses which will be used to rewrite
  121. all traffic to appear to be between the two IP addresses.
  122. .sp
  123. IPv4 Example:
  124. .nf
  125. \--endpoints=172.16.0.1:172.16.0.2
  126. .fi
  127. IPv6 Example:
  128. .nf
  129. \--endpoints=[2001:db8::dead:beef]:[::ffff:0:0:ac:f:0:2]
  130. .fi
  131. .TP
  132. .NOP \f\*[B-Font]\-b\f[], \f\*[B-Font]\-\-skipbroadcast\f[]
  133. Skip rewriting broadcast/multicast IPv4/v6 addresses.
  134. .sp
  135. By default \--seed, \--pnat and \--endpoints will rewrite
  136. broadcast and multicast IPv4/v6 and MAC addresses. Setting this flag
  137. will keep broadcast/multicast IPv4/v6 and MAC addresses from being rewritten.
  138. .TP
  139. .NOP \f\*[B-Font]\-C\f[], \f\*[B-Font]\-\-fixcsum\f[]
  140. Force recalculation of IPv4/TCP/UDP header checksums.
  141. .sp
  142. Causes each IPv4/v6 packet to have their checksums recalculated and
  143. fixed. Automatically enabled for packets modified with \fB--seed\fP,
  144. \fB--pnat\fP, \fB--endpoints\fP or \fB--fixlen\fP.
  145. .TP
  146. .NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-mtu\f[]=\f\*[I-Font]number\f[]
  147. Override default MTU length (1500 bytes).
  148. This option may appear up to 1 times.
  149. This option takes an integer number as its argument.
  150. The value of
  151. \f\*[I-Font]number\f[]
  152. is constrained to being:
  153. .in +4
  154. .nf
  155. .na
  156. in the range 1 through MAXPACKET
  157. .fi
  158. .in -4
  159. .sp
  160. Override the default 1500 byte MTU size for determining the maximum padding length
  161. (--fixlen=pad) or when truncating (--mtu-trunc).
  162. .TP
  163. .NOP \f\*[B-Font]\-\-mtu\-trunc\f[]
  164. Truncate packets larger then specified MTU.
  165. This option may appear up to 1 times.
  166. .sp
  167. Similar to \--fixlen, this option will truncate data in packets from Layer 3 and above to be
  168. no larger then the MTU.
  169. .TP
  170. .NOP \f\*[B-Font]\-E\f[], \f\*[B-Font]\-\-efcs\f[]
  171. Remove Ethernet checksums (FCS) from end of frames.
  172. .sp
  173. Note, this option is pretty dangerous! We do not actually check to see if a FCS
  174. actually exists in the frame, we just blindly delete the last 4 bytes. Hence,
  175. you should only use this if you know know that your OS provides the FCS when
  176. reading raw packets.
  177. .TP
  178. .NOP \f\*[B-Font]\-\-ttl\f[]=\f\*[I-Font]string\f[]
  179. Modify the IPv4/v6 TTL/Hop Limit.
  180. .sp
  181. Allows you to modify the TTL/Hop Limit of all the IPv4/v6 packets. Specify a number to hard-code
  182. the value or +/-value to increase or decrease by the value provided (limited to 1-255).
  183. .sp
  184. Examples:
  185. .nf
  186. \--ttl=10
  187. \--ttl=+7
  188. \--ttl=-64
  189. .fi
  190. .TP
  191. .NOP \f\*[B-Font]\-\-tos\f[]=\f\*[I-Font]number\f[]
  192. Set the IPv4 TOS/DiffServ/ECN byte.
  193. This option may appear up to 1 times.
  194. This option takes an integer number as its argument.
  195. The value of
  196. \f\*[I-Font]number\f[]
  197. is constrained to being:
  198. .in +4
  199. .nf
  200. .na
  201. in the range 0 through 255
  202. .fi
  203. .in -4
  204. .sp
  205. Allows you to override the TOS (also known as DiffServ/ECN) value in IPv4.
  206. .TP
  207. .NOP \f\*[B-Font]\-\-tclass\f[]=\f\*[I-Font]number\f[]
  208. Set the IPv6 Traffic Class byte.
  209. This option may appear up to 1 times.
  210. This option takes an integer number as its argument.
  211. The value of
  212. \f\*[I-Font]number\f[]
  213. is constrained to being:
  214. .in +4
  215. .nf
  216. .na
  217. in the range 0 through 255
  218. .fi
  219. .in -4
  220. .sp
  221. Allows you to override the IPv6 Traffic Class field.
  222. .TP
  223. .NOP \f\*[B-Font]\-\-flowlabel\f[]=\f\*[I-Font]number\f[]
  224. Set the IPv6 Flow Label.
  225. This option may appear up to 1 times.
  226. This option takes an integer number as its argument.
  227. The value of
  228. \f\*[I-Font]number\f[]
  229. is constrained to being:
  230. .in +4
  231. .nf
  232. .na
  233. in the range 0 through 1048575
  234. .fi
  235. .in -4
  236. .sp
  237. Allows you to override the 20bit IPv6 Flow Label field. Has no effect on IPv4
  238. packets.
  239. .TP
  240. .NOP \f\*[B-Font]\-F\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-fixlen\f[]=\f\*[I-Font]string\f[]
  241. Pad or truncate packet data to match header length.
  242. This option may appear up to 1 times.
  243. .sp
  244. Packets may be truncated during capture if the snaplen is smaller then the
  245. packet. This option allows you to modify the packet to pad the packet back
  246. out to the size stored in the IPv4/v6 header or rewrite the IP header total length
  247. to reflect the stored packet length.
  248. .sp 1
  249. \fBpad\fP
  250. Truncated packets will be padded out so that the packet length matches the
  251. IPv4 total length
  252. .sp 1
  253. \fBtrunc\fP
  254. Truncated packets will have their IPv4 total length field rewritten to match
  255. the actual packet length
  256. .sp 1
  257. \fBdel\fP
  258. Delete the packet
  259. .TP
  260. .NOP \f\*[B-Font]\-\-fuzz\-seed\f[]=\f\*[I-Font]number\f[]
  261. Fuzz 1/8 packet. Edit Bytes, length, or emulate packet drop.
  262. This option takes an integer number as its argument.
  263. The value of
  264. \f\*[I-Font]number\f[]
  265. is constrained to being:
  266. .in +4
  267. .nf
  268. .na
  269. greater than or equal to 0
  270. .fi
  271. .in -4
  272. The default
  273. \f\*[I-Font]number\f[]
  274. for this option is:
  275. .ti +4
  276. 0
  277. .sp
  278. This fuzzing was designed as to test layer 7 protocols such as voip protocols.
  279. It modifies randomly 1 out of 8 packets in order for stateful protocols to cover
  280. more of their code. The random fuzzing actions focus on data start and end
  281. because it often is the part of the data application protocols base their
  282. decisions on.
  283. .sp
  284. Possible fuzzing actions list:
  285. * drop packet
  286. * reduce packet size
  287. * edit packet Bytes:
  288. * Not all Bytes have the same probability of appearance in real life.
  289. Replace with 0x00, 0xFF, or a random byte with equal likelyhook
  290. * Not all Bytes have the same significance in a packet.
  291. Replace the start, the end, or the middle of the packet with equal likelihood.
  292. * do nothing (7 out of 8 packets)
  293. .TP
  294. .NOP \f\*[B-Font]\-\-skipl2broadcast\f[]
  295. Skip rewriting broadcast/multicast Layer 2 addresses.
  296. .sp
  297. By default, editing Layer 2 addresses will rewrite
  298. broadcast and multicast MAC addresses. Setting this flag
  299. will keep broadcast/multicast MAC addresses from being rewritten.
  300. .TP
  301. .NOP \f\*[B-Font]\-\-dlt\f[]=\f\*[I-Font]string\f[]
  302. Override output DLT encapsulation.
  303. This option may appear up to 1 times.
  304. .sp
  305. By default, no DLT (data link type) conversion will be made.
  306. To change the DLT type of the output pcap, select one of the following values:
  307. .sp 1
  308. \fBenet\fP
  309. Ethernet aka DLT_EN10MB
  310. .sp 1
  311. \fBhdlc\fP
  312. Cisco HDLC aka DLT_C_HDLC
  313. .sp 1
  314. \fBjnpr_ether\fP
  315. Juniper Ethernet DLT_C_JNPR_ETHER
  316. .sp 1
  317. \fBpppserial\fP
  318. PPP Serial aka DLT_PPP_SERIAL
  319. .sp 1
  320. \fBuser\fP
  321. User specified Layer 2 header and DLT type
  322. .br
  323. .TP
  324. .NOP \f\*[B-Font]\-\-enet\-dmac\f[]=\f\*[I-Font]string\f[]
  325. Override destination ethernet MAC addresses.
  326. This option may appear up to 1 times.
  327. .sp
  328. Takes a pair of comma deliminated ethernet MAC addresses which
  329. will replace the destination MAC address of outbound packets.
  330. The first MAC address will be used for the server to client traffic
  331. and the optional second MAC address will be used for the client
  332. to server traffic.
  333. .sp
  334. Example:
  335. .nf
  336. \--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
  337. .fi
  338. .TP
  339. .NOP \f\*[B-Font]\-\-enet\-smac\f[]=\f\*[I-Font]string\f[]
  340. Override source ethernet MAC addresses.
  341. This option may appear up to 1 times.
  342. .sp
  343. Takes a pair of comma deliminated ethernet MAC addresses which
  344. will replace the source MAC address of outbound packets.
  345. The first MAC address will be used for the server to client traffic
  346. and the optional second MAC address will be used for the client
  347. to server traffic.
  348. .sp
  349. Example:
  350. .nf
  351. \--enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
  352. .fi
  353. .TP
  354. .NOP \f\*[B-Font]\-\-enet\-subsmac\f[]=\f\*[I-Font]string\f[]
  355. Substitute MAC addresses.
  356. This option may appear up to 9999 times.
  357. .sp
  358. Allows you to rewrite ethernet MAC addresses of packets. It takes
  359. comma delimited pair or MACs address and rewrites all occurrences of
  360. the first MAC with the value of the second MAC.
  361. Example:
  362. .nf
  363. \--enet-subsmac=00:12:13:14:15:16,00:22:33:44:55:66
  364. .fi
  365. .TP
  366. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\f[]=\f\*[I-Font]number\f[]
  367. Randomize MAC addresses.
  368. This option may appear up to 1 times.
  369. This option must not appear in combination with any of the following options:
  370. enet-smac, enet-dmac, enet-subsmac.
  371. This option takes an integer number as its argument.
  372. .sp
  373. Allows you to randomize ethernet MAC addresses of packets, mostly
  374. like what \fB--seed\fP option does for IPv4/IPv6 addresses.
  375. .TP
  376. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\-keep\-bytes\f[]=\f\*[I-Font]number\f[]
  377. Randomize MAC addresses.
  378. This option may appear up to 1 times.
  379. This option must appear in combination with the following options:
  380. enet-mac-seed.
  381. This option takes an integer number as its argument.
  382. The value of
  383. \f\*[I-Font]number\f[]
  384. is constrained to being:
  385. .in +4
  386. .nf
  387. .na
  388. in the range 1 through 6
  389. .fi
  390. .in -4
  391. .sp
  392. Keep some bytes untouched when usinging \fB--enet-mac-seed\fP option.
  393. .TP
  394. .NOP \f\*[B-Font]\-\-enet\-vlan\f[]=\f\*[I-Font]string\f[]
  395. Specify ethernet 802.1q VLAN tag mode.
  396. This option may appear up to 1 times.
  397. .sp
  398. Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
  399. ethernet headers or remove the 802.1q VLAN tag information.
  400. .sp 1
  401. \fBadd\fP
  402. Rewrites the existing 802.3 ethernet header as an 802.1q VLAN header
  403. .sp 1
  404. \fBdel\fP
  405. Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
  406. .TP
  407. .NOP \f\*[B-Font]\-\-enet\-vlan\-tag\f[]=\f\*[I-Font]number\f[]
  408. Specify the new ethernet 802.1q VLAN tag value.
  409. This option may appear up to 1 times.
  410. This option must appear in combination with the following options:
  411. enet-vlan.
  412. This option takes an integer number as its argument.
  413. The value of
  414. \f\*[I-Font]number\f[]
  415. is constrained to being:
  416. .in +4
  417. .nf
  418. .na
  419. in the range 0 through 4095
  420. .fi
  421. .in -4
  422. .sp
  423. .TP
  424. .NOP \f\*[B-Font]\-\-enet\-vlan\-cfi\f[]=\f\*[I-Font]number\f[]
  425. Specify the ethernet 802.1q VLAN CFI value.
  426. This option may appear up to 1 times.
  427. This option must appear in combination with the following options:
  428. enet-vlan.
  429. This option takes an integer number as its argument.
  430. The value of
  431. \f\*[I-Font]number\f[]
  432. is constrained to being:
  433. .in +4
  434. .nf
  435. .na
  436. in the range 0 through 1
  437. .fi
  438. .in -4
  439. .sp
  440. .TP
  441. .NOP \f\*[B-Font]\-\-enet\-vlan\-pri\f[]=\f\*[I-Font]number\f[]
  442. Specify the ethernet 802.1q VLAN priority.
  443. This option may appear up to 1 times.
  444. This option must appear in combination with the following options:
  445. enet-vlan.
  446. This option takes an integer number as its argument.
  447. The value of
  448. \f\*[I-Font]number\f[]
  449. is constrained to being:
  450. .in +4
  451. .nf
  452. .na
  453. in the range 0 through 7
  454. .fi
  455. .in -4
  456. .sp
  457. .TP
  458. .NOP \f\*[B-Font]\-\-hdlc\-control\f[]=\f\*[I-Font]number\f[]
  459. Specify HDLC control value.
  460. This option may appear up to 1 times.
  461. This option takes an integer number as its argument.
  462. .sp
  463. The Cisco HDLC header has a 1 byte "control" field. Apparently this should
  464. always be 0, but if you can use any 1 byte value.
  465. .TP
  466. .NOP \f\*[B-Font]\-\-hdlc\-address\f[]=\f\*[I-Font]number\f[]
  467. Specify HDLC address.
  468. This option may appear up to 1 times.
  469. This option takes an integer number as its argument.
  470. .sp
  471. The Cisco HDLC header has a 1 byte "address" field which has two valid
  472. values:
  473. .sp 1
  474. \fB0x0F\fP
  475. Unicast
  476. .sp 1
  477. \fB0xBF\fP
  478. Broadcast
  479. .br
  480. You can however specify any single byte value.
  481. .TP
  482. .NOP \f\*[B-Font]\-\-user\-dlt\f[]=\f\*[I-Font]number\f[]
  483. Set output file DLT type.
  484. This option may appear up to 1 times.
  485. This option takes an integer number as its argument.
  486. .sp
  487. Set the DLT value of the output pcap file.
  488. .TP
  489. .NOP \f\*[B-Font]\-\-user\-dlink\f[]=\f\*[I-Font]string\f[]
  490. Rewrite Data-Link layer with user specified data.
  491. This option may appear up to 2 times.
  492. .sp
  493. Provide a series of comma deliminated hex values which will be
  494. used to rewrite or create the Layer 2 header of the packets.
  495. The first instance of this argument will rewrite both server
  496. and client traffic, but if this argument is specified a second
  497. time, it will be used for the client traffic.
  498. .sp
  499. Example:
  500. .nf
  501. \--user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
  502. .fi
  503. .TP
  504. .NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-dbug\f[]=\f\*[I-Font]number\f[]
  505. Enable debugging output.
  506. This option may appear up to 1 times.
  507. This option takes an integer number as its argument.
  508. The value of
  509. \f\*[I-Font]number\f[]
  510. is constrained to being:
  511. .in +4
  512. .nf
  513. .na
  514. in the range 0 through 5
  515. .fi
  516. .in -4
  517. The default
  518. \f\*[I-Font]number\f[]
  519. for this option is:
  520. .ti +4
  521. 0
  522. .sp
  523. If configured with \--enable-debug, then you can specify a verbosity
  524. level for debugging output. Higher numbers increase verbosity.
  525. .TP
  526. .NOP \f\*[B-Font]\-q\f[], \f\*[B-Font]\-\-quiet\f[]
  527. Quiet mode.
  528. .sp
  529. Print nothing except the statistics at the end of the run
  530. .TP
  531. .NOP \f\*[B-Font]\-T\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-timer\f[]=\f\*[I-Font]string\f[]
  532. Select packet timing mode: select, ioport, gtod, nano.
  533. This option may appear up to 1 times.
  534. The default
  535. \f\*[I-Font]string\f[]
  536. for this option is:
  537. .ti +4
  538. gtod
  539. .sp
  540. Allows you to select the packet timing method to use:
  541. .sp
  542. .IR "nano"
  543. - Use nanosleep() API
  544. .sp
  545. .IR "select"
  546. - Use select() API
  547. .sp
  548. .IR "ioport"
  549. - Write to the i386 IO Port 0x80
  550. .sp
  551. .IR "gtod [default]"
  552. - Use a gettimeofday() loop
  553. .br
  554. .TP
  555. .NOP \f\*[B-Font]\-\-maxsleep\f[]=\f\*[I-Font]number\f[]
  556. Sleep for no more then X milliseconds between packets.
  557. This option takes an integer number as its argument.
  558. The default
  559. \f\*[I-Font]number\f[]
  560. for this option is:
  561. .ti +4
  562. 0
  563. .sp
  564. Set a limit for the maximum number of milliseconds that tcpreplay will sleep
  565. between packets. Effectively prevents long delays between packets without
  566. effecting the majority of packets. Default is disabled.
  567. .TP
  568. .NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
  569. Print decoded packets via tcpdump to STDOUT.
  570. This option may appear up to 1 times.
  571. .sp
  572. .TP
  573. .NOP \f\*[B-Font]\-A\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-decode\f[]=\f\*[I-Font]string\f[]
  574. Arguments passed to tcpdump decoder.
  575. This option may appear up to 1 times.
  576. This option must appear in combination with the following options:
  577. verbose.
  578. .sp
  579. When enabling verbose mode (\fB-v\fP) you may also specify one or more
  580. additional arguments to pass to \fBtcpdump\fP to modify the way packets
  581. are decoded. By default, \-n and \-l are used. Be sure to
  582. quote the arguments like: \-A "-axxx" so that they are not interpreted
  583. by tcpreplay. Please see the tcpdump(1) man page for a complete list of
  584. options.
  585. .TP
  586. .NOP \f\*[B-Font]\-K\f[], \f\*[B-Font]\-\-preload\-pcap\f[]
  587. Preloads packets into RAM before sending.
  588. .sp
  589. This option loads the specified pcap(s) into RAM before starting to send in order
  590. to improve replay performance while introducing a startup performance hit.
  591. Preloading can be used with or without \fB--loop\fP. This option also suppresses
  592. flow statistics collection for every iteration, which can significantly reduce
  593. memory usage. Flow statistics are predicted based on options supplied and
  594. statistics collected from the first loop iteration.
  595. .TP
  596. .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-cachefile\f[]=\f\*[I-Font]string\f[]
  597. Split traffic via a tcpprep cache file.
  598. This option may appear up to 1 times.
  599. This option must appear in combination with the following options:
  600. intf2.
  601. This option must not appear in combination with any of the following options:
  602. dualfile.
  603. .sp
  604. If you have a pcap file you would like to use to send bi-directional
  605. traffic through a device (firewall, router, IDS, etc) then using tcpprep
  606. you can create a cachefile which tcpreplay will use to split the traffic
  607. across two network interfaces.
  608. .TP
  609. .NOP \f\*[B-Font]\-2\f[], \f\*[B-Font]\-\-dualfile\f[]
  610. Replay two files at a time from a network tap.
  611. This option may appear up to 1 times.
  612. This option must appear in combination with the following options:
  613. intf2.
  614. This option must not appear in combination with any of the following options:
  615. cachefile.
  616. .sp
  617. If you captured network traffic using a network tap, then you can end up with
  618. two pcap files- one for each direction. This option will replay these two
  619. files at the same time, one on each interface and inter-mix them using the
  620. timestamps in each.
  621. .TP
  622. .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-intf1\f[]=\f\*[I-Font]string\f[]
  623. Client to server/RX/primary traffic output interface.
  624. This option may appear up to 1 times.
  625. .sp
  626. Required network interface used to send either all traffic or traffic which is
  627. marked as 'primary' via tcpprep. Primary traffic is usually client-to-server
  628. or inbound (RX) on khial virtual interfaces.
  629. .TP
  630. .NOP \f\*[B-Font]\-I\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-intf2\f[]=\f\*[I-Font]string\f[]
  631. Server to client/TX/secondary traffic output interface.
  632. This option may appear up to 1 times.
  633. .sp
  634. Optional network interface used to send traffic which is marked as 'secondary'
  635. via tcpprep. Secondary traffic is usually server-to-client or outbound
  636. (TX) on khial virtual interfaces. Generally, it only makes sense to use this
  637. option with \--cachefile.
  638. .TP
  639. .NOP \f\*[B-Font]\-\-listnics\f[]
  640. List available network interfaces and exit.
  641. .sp
  642. .TP
  643. .NOP \f\*[B-Font]\-l\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-loop\f[]=\f\*[I-Font]number\f[]
  644. Loop through the capture file X times.
  645. This option may appear up to 1 times.
  646. This option takes an integer number as its argument.
  647. The value of
  648. \f\*[I-Font]number\f[]
  649. is constrained to being:
  650. .in +4
  651. .nf
  652. .na
  653. greater than or equal to 0
  654. .fi
  655. .in -4
  656. The default
  657. \f\*[I-Font]number\f[]
  658. for this option is:
  659. .ti +4
  660. 1
  661. .sp
  662. .TP
  663. .NOP \f\*[B-Font]\-\-loopdelay\-ms\f[]=\f\*[I-Font]number\f[]
  664. Delay between loops in milliseconds.
  665. This option must appear in combination with the following options:
  666. loop.
  667. This option takes an integer number as its argument.
  668. The value of
  669. \f\*[I-Font]number\f[]
  670. is constrained to being:
  671. .in +4
  672. .nf
  673. .na
  674. greater than or equal to 0
  675. .fi
  676. .in -4
  677. The default
  678. \f\*[I-Font]number\f[]
  679. for this option is:
  680. .ti +4
  681. 0
  682. .sp
  683. .TP
  684. .NOP \f\*[B-Font]\-\-pktlen\f[]
  685. Override the snaplen and use the actual packet len.
  686. This option may appear up to 1 times.
  687. .sp
  688. By default, tcpreplay will send packets based on the size of the "snaplen"
  689. stored in the pcap file which is usually the correct thing to do. However,
  690. occasionally, tools will store more bytes then told to. By specifying this
  691. option, tcpreplay will ignore the snaplen field and instead try to send
  692. packets based on the original packet length. Bad things may happen if
  693. you specify this option.
  694. .TP
  695. .NOP \f\*[B-Font]\-L\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-limit\f[]=\f\*[I-Font]number\f[]
  696. Limit the number of packets to send.
  697. This option may appear up to 1 times.
  698. This option takes an integer number as its argument.
  699. The value of
  700. \f\*[I-Font]number\f[]
  701. is constrained to being:
  702. .in +4
  703. .nf
  704. .na
  705. greater than or equal to 1
  706. .fi
  707. .in -4
  708. The default
  709. \f\*[I-Font]number\f[]
  710. for this option is:
  711. .ti +4
  712. \-1
  713. .sp
  714. By default, tcpreplay will send all the packets. Alternatively, you can
  715. specify a maximum number of packets to send.
  716. .TP
  717. .NOP \f\*[B-Font]\-\-duration\f[]=\f\*[I-Font]number\f[]
  718. Limit the number of seconds to send.
  719. This option may appear up to 1 times.
  720. This option takes an integer number as its argument.
  721. The value of
  722. \f\*[I-Font]number\f[]
  723. is constrained to being:
  724. .in +4
  725. .nf
  726. .na
  727. greater than or equal to 1
  728. .fi
  729. .in -4
  730. The default
  731. \f\*[I-Font]number\f[]
  732. for this option is:
  733. .ti +4
  734. \-1
  735. .sp
  736. By default, tcpreplay will send all the packets. Alternatively, you can
  737. specify a maximum number of seconds to transmit.
  738. .TP
  739. .NOP \f\*[B-Font]\-x\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-multiplier\f[]=\f\*[I-Font]string\f[]
  740. Modify replay speed to a given multiple.
  741. This option may appear up to 1 times.
  742. This option must not appear in combination with any of the following options:
  743. pps, mbps, oneatatime, topspeed.
  744. .sp
  745. Specify a value to modify the packet replay speed.
  746. Examples:
  747. .nf
  748. 2.0 will replay traffic at twice the speed captured
  749. 0.7 will replay traffic at 70% the speed captured
  750. .fi
  751. .TP
  752. .NOP \f\*[B-Font]\-p\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-pps\f[]=\f\*[I-Font]string\f[]
  753. Replay packets at a given packets/sec.
  754. This option may appear up to 1 times.
  755. This option must not appear in combination with any of the following options:
  756. multiplier, mbps, oneatatime, topspeed.
  757. .sp
  758. Specify a value to regulate the packet replay to a specific packet-per-second rate.
  759. Examples:
  760. .nf
  761. 200 will replay traffic at 200 packets per second
  762. 0.25 will replay traffic at 15 packets per minute
  763. .fi
  764. .TP
  765. .NOP \f\*[B-Font]\-M\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-mbps\f[]=\f\*[I-Font]string\f[]
  766. Replay packets at a given Mbps.
  767. This option may appear up to 1 times.
  768. This option must not appear in combination with any of the following options:
  769. multiplier, pps, oneatatime, topspeed.
  770. .sp
  771. Specify a floating point value for the Mbps rate that tcpreplay
  772. should send packets at.
  773. .TP
  774. .NOP \f\*[B-Font]\-t\f[], \f\*[B-Font]\-\-topspeed\f[]
  775. Replay packets as fast as possible.
  776. This option must not appear in combination with any of the following options:
  777. mbps, multiplier, pps, oneatatime.
  778. .sp
  779. .TP
  780. .NOP \f\*[B-Font]\-o\f[], \f\*[B-Font]\-\-oneatatime\f[]
  781. Replay one packet at a time for each user input.
  782. This option must not appear in combination with any of the following options:
  783. mbps, pps, multiplier, topspeed.
  784. .sp
  785. Allows you to step through one or more packets at a time.
  786. .TP
  787. .NOP \f\*[B-Font]\-\-pps\-multi\f[]=\f\*[I-Font]number\f[]
  788. Number of packets to send for each time interval.
  789. This option must appear in combination with the following options:
  790. pps.
  791. This option takes an integer number as its argument.
  792. The value of
  793. \f\*[I-Font]number\f[]
  794. is constrained to being:
  795. .in +4
  796. .nf
  797. .na
  798. greater than or equal to 1
  799. .fi
  800. .in -4
  801. The default
  802. \f\*[I-Font]number\f[]
  803. for this option is:
  804. .ti +4
  805. 1
  806. .sp
  807. When trying to send packets at very high rates, the time between each packet
  808. can be so short that it is impossible to accurately sleep for the required
  809. period of time. This option allows you to send multiple packets at a time,
  810. thus allowing for longer sleep times which can be more accurately implemented.
  811. .TP
  812. .NOP \f\*[B-Font]\-\-unique\-ip\f[]
  813. Modify IP addresses each loop iteration to generate unique flows.
  814. This option must appear in combination with the following options:
  815. loop.
  816. This option must not appear in combination with any of the following options:
  817. seed, fuzz-seed.
  818. .sp
  819. Ensure IPv4 and IPv6 packets will be unique for each \fB--loop\fP iteration.
  820. This is done in a way that will not alter packet CRC, and therefore will genrally
  821. not affect performance. This option will significantly increase the flows/sec over
  822. generated over multiple loop iterations.
  823. .TP
  824. .NOP \f\*[B-Font]\-\-unique\-ip\-loops\f[]=\f\*[I-Font]string\f[]
  825. Number of times to loop before assigning new unique ip.
  826. This option may appear up to 1 times.
  827. This option must appear in combination with the following options:
  828. unique-ip.
  829. .sp
  830. Number of \fB--loop\fP iterations before a new unique IP is assigned. Default
  831. is 1. Assumes both \fB--loop\fP and \fB--unique-ip\fP.
  832. .TP
  833. .NOP \f\*[B-Font]\-\-netmap\f[]
  834. Write packets directly to netmap enabled network adapter.
  835. .sp
  836. This feature will detect netmap capable network drivers on Linux and BSD
  837. systems. If detected, the network driver is bypassed for the execution
  838. duration, and network buffers will be written to directly. This will allow
  839. you to achieve full line rates on commodity network adapters, similar to rates
  840. achieved by commercial network traffic generators. Note that bypassing the network
  841. driver will disrupt other applications connected through the test interface. See
  842. INSTALL for more information.
  843. .sp
  844. This feature can also be enabled by specifying an interface as 'netmap:<intf>'
  845. or 'vale:<intf>. For example 'netmap:eth0' specifies netmap over interface eth0.
  846. .TP
  847. .NOP \f\*[B-Font]\-\-nm\-delay\f[]=\f\*[I-Font]number\f[]
  848. Netmap startup delay.
  849. This option takes an integer number as its argument.
  850. The default
  851. \f\*[I-Font]number\f[]
  852. for this option is:
  853. .ti +4
  854. 10
  855. .sp
  856. Number of seconds to delay after netmap is loaded. Required to ensure interfaces
  857. are fully up before netmap transmit. Requires netmap option. Default is 10 seconds.
  858. .TP
  859. .NOP \f\*[B-Font]\-\-no\-flow\-stats\f[]
  860. Suppress printing and tracking flow count, rates and expirations.
  861. .sp
  862. Suppress the collection and printing of flow statistics. This option may
  863. improve performance when not using \fB--preload-pcap\fP option, otherwise
  864. its only function is to suppress printing.
  865. .sp
  866. The flow feature will track and print statistics of the flows being sent.
  867. A flow is loosely defined as a unique combination of a 5-tuple, i.e.
  868. source IP, destination IP, source port, destination port and protocol.
  869. .sp
  870. If \fB--loop\fP is specified, the flows from one iteration to the next
  871. will not be unique, unless the packets are altered. Use \fB--unique-ip\fP
  872. or \fBtcpreplay-edit\fP to alter packets between iterations.
  873. .TP
  874. .NOP \f\*[B-Font]\-\-flow\-expiry\f[]=\f\*[I-Font]number\f[]
  875. Number of inactive seconds before a flow is considered expired.
  876. This option must not appear in combination with any of the following options:
  877. no-flow-stats.
  878. This option takes an integer number as its argument.
  879. The value of
  880. \f\*[I-Font]number\f[]
  881. is constrained to being:
  882. .in +4
  883. .nf
  884. .na
  885. greater than or equal to 0
  886. .fi
  887. .in -4
  888. The default
  889. \f\*[I-Font]number\f[]
  890. for this option is:
  891. .ti +4
  892. 0
  893. .sp
  894. This option will track and report flow expirations based on the flow idle
  895. times. The timestamps within the pcap file are used to determine the expiry,
  896. not the actual timestamp of the packets are replayed. For example, a value of
  897. 30 suggests that if no traffic is seen on a flow for 30 seconds, any
  898. subsequent traffic would be considered a new flow, and thereby will increment
  899. the flows and flows per second (fps) statistics.
  900. .sp
  901. This option can be used to optimize flow timeout settings for flow products.
  902. Setting the timeout low may lead to flows being dropped when in fact the flow
  903. is simply slow to respond. Configuring your flow timeouts too high may
  904. increase resources required by your flow product.
  905. .sp
  906. Note that using this option while replaying at higher than original speeds
  907. can lead to inflated flows and fps counts.
  908. .sp
  909. Default is 0 (no expiry) and a typical value is 30-120 seconds.
  910. .TP
  911. .NOP \f\*[B-Font]\-P\f[], \f\*[B-Font]\-\-pid\f[]
  912. Print the PID of tcpreplay at startup.
  913. .sp
  914. .TP
  915. .NOP \f\*[B-Font]\-\-stats\f[]=\f\*[I-Font]number\f[]
  916. Print statistics every X seconds, or every loop if '0'.
  917. This option takes an integer number as its argument.
  918. The value of
  919. \f\*[I-Font]number\f[]
  920. is constrained to being:
  921. .in +4
  922. .nf
  923. .na
  924. greater than or equal to 0
  925. .fi
  926. .in -4
  927. .sp
  928. Note that timed delays are a "best effort" and long delays between
  929. sending packets may cause equally long delays between printing statistics.
  930. .TP
  931. .NOP \f\*[B-Font]\-V\f[], \f\*[B-Font]\-\-version\f[]
  932. Print version information.
  933. .sp
  934. .TP
  935. .NOP \f\*[B-Font]\-h\f[], \f\*[B-Font]\-\-less\-help\f[]
  936. Display less usage information and exit.
  937. .sp
  938. .TP
  939. .NOP \f\*[B-Font]\-H\f[], \f\*[B-Font]\-\-help\f[]
  940. Display usage information and exit.
  941. .TP
  942. .NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
  943. Pass the extended usage information through a pager.
  944. .TP
  945. .NOP \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
  946. Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
  947. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  948. The command will exit after updating the config file.
  949. .TP
  950. .NOP \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
  951. Load options from \fIcfgfile\fP.
  952. The \fIno-load-opts\fP form will disable the loading
  953. of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
  954. out of order.
  955. .PP
  956. .SH "OPTION PRESETS"
  957. Any option that is not marked as \fInot presettable\fP may be preset
  958. by loading values from configuration ("RC" or ".INI") file(s).
  959. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  960. In that case, the file "\fI.tcpreplay-editrc\fP"
  961. is searched for within that directory.
  962. .SH "FILES"
  963. See \fBOPTION PRESETS\fP for configuration files.
  964. .SH "EXIT STATUS"
  965. One of the following exit values will be returned:
  966. .TP
  967. .NOP 0 " (EXIT_SUCCESS)"
  968. Successful program execution.
  969. .TP
  970. .NOP 1 " (EXIT_FAILURE)"
  971. The operation failed or the command syntax was not valid.
  972. .TP
  973. .NOP 66 " (EX_NOINPUT)"
  974. A specified configuration file could not be loaded.
  975. .TP
  976. .NOP 70 " (EX_SOFTWARE)"
  977. libopts had an internal operational error. Please report
  978. it to autogen-users@lists.sourceforge.net. Thank you.
  979. .PP
  980. .SH "AUTHORS"
  981. Copyright 2013-2017 Fred Klassen \- AppNeta
  982. Copyright 2000-2012 Aaron Turner
  983. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  984. The latest version of this software is always available from:
  985. http://tcpreplay.appneta.com/
  986. .SH "COPYRIGHT"
  987. Copyright (C) 2000-2017 Aaron Turner and Fred Klassen all rights reserved.
  988. This program is released under the terms of the GNU General Public License, version 3 or later.
  989. .SH "BUGS"
  990. Please send bug reports to: tcpreplay-users@lists.sourceforge.net
  991. .SH "NOTES"
  992. This manual page was \fIAutoGen\fP-erated from the \fBtcpreplay-edit\fP
  993. option definitions.