tcpreplay-edit.1 34 KB

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