tcprewrite.1 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  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 tcprewrite 1 "12 Jul 2024" "tcprewrite" "User Commands"
  14. .\"
  15. .\" DO NOT EDIT THIS FILE (in-mem file)
  16. .\"
  17. .\" It has been AutoGen-ed
  18. .\" From the definitions ../../src/tcprewrite_opts.def
  19. .\" and the template file agman-cmd.tpl
  20. .SH NAME
  21. \f\*[B-Font]tcprewrite\fP
  22. \- Rewrite the packets in a pcap file.
  23. .SH SYNOPSIS
  24. \f\*[B-Font]tcprewrite\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. .sp \n(Ppu
  30. .ne 2
  31. All arguments must be options.
  32. .sp \n(Ppu
  33. .ne 2
  34. .SH "DESCRIPTION"
  35. Tcprewrite is a tool to rewrite packets stored in \fIpcap(3)\fP file format,
  36. such as created by tools such as \fItcpdump(1)\fP and \fIwireshark(1)\fP.
  37. Once a pcap file has had it's packets rewritten, they can be replayed back
  38. out on the network using \fItcpreplay(1)\fP.
  39. .sp
  40. tcprewrite currently supports reading the following DLT types:
  41. .sp 1
  42. \fBDLT_C_HDLC\fP aka Cisco HDLC
  43. .sp 1
  44. \fBDLT_EN10MB\fP aka Ethernet
  45. .sp 1
  46. \fBDLT_LINUX_SLL\fP aka Linux Cooked Socket
  47. .sp 1
  48. \fBDLT_LINUX_SLL2\fP aka Linux Cooked Socket v2
  49. .sp 1
  50. \fBDLT_RAW\fP aka RAW IP
  51. .sp 1
  52. \fBDLT_NULL\fP aka BSD Loopback
  53. .sp 1
  54. \fBDLT_LOOP\fP aka OpenBSD Loopback
  55. .sp 1
  56. \fBDLT_IEEE802_11\fP aka 802.11a/b/g
  57. .sp 1
  58. \fBDLT_IEEE802_11_RADIO\fP aka 802.11a/b/g with Radiotap headers
  59. .sp 1
  60. \fBDLT_JUNIPER_ETHER\fP aka Juniper Encapsulated Ethernet
  61. .sp 1
  62. \fBDLT_PPP_SERIAL\fP aka PPP over Serial
  63. .sp
  64. Please see the \--dlt option for supported DLT types for writing.
  65. .sp
  66. The packet editing features of tcprewrite which distinguish between "client"
  67. and "server" traffic requires a tcpprep(1) cache file.
  68. .sp
  69. For more details, please see the Tcpreplay Manual at:
  70. http://tcpreplay.appneta.com
  71. .SH "OPTIONS"
  72. .SS ""
  73. .TP
  74. .NOP \f\*[B-Font]\-r\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-portmap\f[]=\f\*[I-Font]string\f[]
  75. Rewrite TCP/UDP ports.
  76. This option may appear up to 9999 times.
  77. .sp
  78. Specify a list of comma delimited port mappings consisting of
  79. colon delimited port number pairs. Each colon delimited port pair
  80. consists of the port to match followed by the port number to rewrite.
  81. .sp
  82. Examples:
  83. .nf
  84. \--portmap=80:8000 \--portmap=8080:80 # 80->8000 and 8080->80
  85. \--portmap=8000,8080,88888:80 # 3 different ports become 80
  86. \--portmap=8000-8999:80 # ports 8000 to 8999 become 80
  87. .fi
  88. .TP
  89. .NOP \f\*[B-Font]\-s\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-seed\f[]=\f\*[I-Font]number\f[]
  90. Randomize src/dst IPv4/v6 addresses w/ given seed.
  91. This option may appear up to 1 times.
  92. This option must not appear in combination with any of the following options:
  93. fuzz-seed.
  94. This option takes an integer number as its argument.
  95. .sp
  96. Causes the source and destination IPv4/v6 addresses to be pseudo
  97. randomized but still maintain client/server relationships.
  98. Since the randomization is deterministic based on the seed,
  99. you can reuse the same seed value to recreate the traffic.
  100. .TP
  101. .NOP \f\*[B-Font]\-N\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-pnat\f[]=\f\*[I-Font]string\f[]
  102. Rewrite IPv4/v6 addresses using pseudo-NAT.
  103. This option may appear up to 2 times.
  104. This option must not appear in combination with any of the following options:
  105. srcipmap.
  106. .sp
  107. Takes a comma delimited series of colon delimited CIDR
  108. netblock pairs. Each netblock pair is evaluated in order against
  109. the IP addresses. If the IP address in the packet matches the
  110. first netblock, it is rewritten using the second netblock as a
  111. mask against the high order bits.
  112. .sp
  113. IPv4 Example:
  114. .nf
  115. \--pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
  116. .fi
  117. IPv6 Example:
  118. .nf
  119. \--pnat=[2001:db8::/32]:[dead::/16],[2001:db8::/32]:[::ffff:0:0/96]
  120. .fi
  121. .TP
  122. .NOP \f\*[B-Font]\-S\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-srcipmap\f[]=\f\*[I-Font]string\f[]
  123. Rewrite source IPv4/v6 addresses using pseudo-NAT.
  124. This option may appear up to 1 times.
  125. This option must not appear in combination with any of the following options:
  126. pnat.
  127. .sp
  128. Works just like the \--pnat option, but only affects the source IP
  129. addresses in the IPv4/v6 header.
  130. .TP
  131. .NOP \f\*[B-Font]\-D\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-dstipmap\f[]=\f\*[I-Font]string\f[]
  132. Rewrite destination IPv4/v6 addresses using pseudo-NAT.
  133. This option may appear up to 1 times.
  134. This option must not appear in combination with any of the following options:
  135. pnat.
  136. .sp
  137. Works just like the \--pnat option, but only affects the destination IP
  138. addresses in the IPv4/v6 header.
  139. .TP
  140. .NOP \f\*[B-Font]\-e\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-endpoints\f[]=\f\*[I-Font]string\f[]
  141. Rewrite IP addresses to be between two endpoints.
  142. This option may appear up to 1 times.
  143. This option must appear in combination with the following options:
  144. cachefile.
  145. .sp
  146. Takes a pair of colon delimited IPv4/v6 addresses which will be used to rewrite
  147. all traffic to appear to be between the two IP addresses.
  148. .sp
  149. IPv4 Example:
  150. .nf
  151. \--endpoints=172.16.0.1:172.16.0.2
  152. .fi
  153. IPv6 Example:
  154. .nf
  155. \--endpoints=[2001:db8::dead:beef]:[::ffff:0:0:ac:f:0:2]
  156. .fi
  157. .TP
  158. .NOP \f\*[B-Font]\-\-tcp\-sequence\f[]=\f\*[I-Font]number\f[]
  159. Change TCP Sequence (and ACK) numbers /w given seed.
  160. This option takes an integer number as its argument.
  161. The value of
  162. \f\*[I-Font]number\f[]
  163. is constrained to being:
  164. .in +4
  165. .nf
  166. .na
  167. greater than or equal to 1
  168. .fi
  169. .in -4
  170. The default
  171. \f\*[I-Font]number\f[]
  172. for this option is:
  173. .ti +4
  174. 0
  175. .sp
  176. Change all TCP sequence numbers, and related sequence-acknowledgement numbers.
  177. They will be shifted by a random amount based on the provided seed.
  178. .TP
  179. .NOP \f\*[B-Font]\-b\f[], \f\*[B-Font]\-\-skipbroadcast\f[]
  180. Skip rewriting broadcast/multicast IPv4/v6 addresses.
  181. .sp
  182. By default \--seed, \--pnat and \--endpoints will rewrite
  183. broadcast and multicast IPv4/v6 and MAC addresses. Setting this flag
  184. will keep broadcast/multicast IPv4/v6 and MAC addresses from being rewritten.
  185. .TP
  186. .NOP \f\*[B-Font]\-C\f[], \f\*[B-Font]\-\-fixcsum\f[]
  187. Force recalculation of IPv4/TCP/UDP header checksums.
  188. .sp
  189. Causes each IPv4/v6 packet to have their checksums recalculated and
  190. fixed. Automatically enabled for packets modified with \fB--seed\fP,
  191. \fB--pnat\fP, \fB--endpoints\fP or \fB--fixlen\fP.
  192. .TP
  193. .NOP \f\*[B-Font]\-\-fixhdrlen\f[]
  194. Alter IP/TCP header len to match packet length.
  195. .sp
  196. By default, tcpreplay will send packets with the original packet length,
  197. However, you may want the packet length revised to minimum packet size.
  198. Using this option, tcpreplay will rewrite (fix) the packet length,
  199. and recalculate checksums when packet length changes.
  200. Caution: undesired packet changes may occur when this option is specified.
  201. .TP
  202. .NOP \f\*[B-Font]\-m\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-mtu\f[]=\f\*[I-Font]number\f[]
  203. Override default MTU length (1500 bytes).
  204. This option may appear up to 1 times.
  205. This option takes an integer number as its argument.
  206. The value of
  207. \f\*[I-Font]number\f[]
  208. is constrained to being:
  209. .in +4
  210. .nf
  211. .na
  212. in the range 1 through MAX_SNAPLEN
  213. .fi
  214. .in -4
  215. .sp
  216. Override the default 1500 byte MTU size for determining the maximum padding length
  217. (--fixlen=pad) or when truncating (--mtu-trunc).
  218. .TP
  219. .NOP \f\*[B-Font]\-\-mtu\-trunc\f[]
  220. Truncate packets larger then specified MTU.
  221. This option may appear up to 1 times.
  222. .sp
  223. Similar to \--fixlen, this option will truncate data in packets from Layer 3 and above to be
  224. no larger then the MTU.
  225. .TP
  226. .NOP \f\*[B-Font]\-E\f[], \f\*[B-Font]\-\-efcs\f[]
  227. Remove Ethernet checksums (FCS) from end of frames.
  228. .sp
  229. Note, this option is pretty dangerous! We do not actually check to see if a FCS
  230. actually exists in the frame, we just blindly delete the last 4 bytes. Hence,
  231. you should only use this if you know know that your OS provides the FCS when
  232. reading raw packets.
  233. .TP
  234. .NOP \f\*[B-Font]\-\-ttl\f[]=\f\*[I-Font]string\f[]
  235. Modify the IPv4/v6 TTL/Hop Limit.
  236. .sp
  237. Allows you to modify the TTL/Hop Limit of all the IPv4/v6 packets. Specify a number to hard-code
  238. the value or +/-value to increase or decrease by the value provided (limited to 1-255).
  239. .sp
  240. Examples:
  241. .nf
  242. \--ttl=10
  243. \--ttl=+7
  244. \--ttl=-64
  245. .fi
  246. .TP
  247. .NOP \f\*[B-Font]\-\-tos\f[]=\f\*[I-Font]number\f[]
  248. Set the IPv4 TOS/DiffServ/ECN byte.
  249. This option may appear up to 1 times.
  250. This option takes an integer number as its argument.
  251. The value of
  252. \f\*[I-Font]number\f[]
  253. is constrained to being:
  254. .in +4
  255. .nf
  256. .na
  257. in the range 0 through 255
  258. .fi
  259. .in -4
  260. .sp
  261. Allows you to override the TOS (also known as DiffServ/ECN) value in IPv4.
  262. .TP
  263. .NOP \f\*[B-Font]\-\-tclass\f[]=\f\*[I-Font]number\f[]
  264. Set the IPv6 Traffic Class byte.
  265. This option may appear up to 1 times.
  266. This option takes an integer number as its argument.
  267. The value of
  268. \f\*[I-Font]number\f[]
  269. is constrained to being:
  270. .in +4
  271. .nf
  272. .na
  273. in the range 0 through 255
  274. .fi
  275. .in -4
  276. .sp
  277. Allows you to override the IPv6 Traffic Class field.
  278. .TP
  279. .NOP \f\*[B-Font]\-\-flowlabel\f[]=\f\*[I-Font]number\f[]
  280. Set the IPv6 Flow Label.
  281. This option may appear up to 1 times.
  282. This option takes an integer number as its argument.
  283. The value of
  284. \f\*[I-Font]number\f[]
  285. is constrained to being:
  286. .in +4
  287. .nf
  288. .na
  289. in the range 0 through 1048575
  290. .fi
  291. .in -4
  292. .sp
  293. Allows you to override the 20bit IPv6 Flow Label field. Has no effect on IPv4
  294. packets.
  295. .TP
  296. .NOP \f\*[B-Font]\-F\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-fixlen\f[]=\f\*[I-Font]string\f[]
  297. Pad or truncate packet data to match header length.
  298. This option may appear up to 1 times.
  299. .sp
  300. Packets may be truncated during capture if the snaplen is smaller then the
  301. packet. This option allows you to modify the packet to pad the packet back
  302. out to the size stored in the IPv4/v6 header or rewrite the IP header total length
  303. to reflect the stored packet length.
  304. .sp 1
  305. \fBpad\fP
  306. Truncated packets will be padded out so that the packet length matches the
  307. IPv4 total length
  308. .sp 1
  309. \fBtrunc\fP
  310. Truncated packets will have their IPv4 total length field rewritten to match
  311. the actual packet length
  312. .sp 1
  313. \fBdel\fP
  314. Delete the packet
  315. .TP
  316. .NOP \f\*[B-Font]\-\-fuzz\-seed\f[]=\f\*[I-Font]number\f[]
  317. Fuzz 1 in X packets. Edit bytes, length, or emulate packet drop.
  318. This option takes an integer number as its argument.
  319. The value of
  320. \f\*[I-Font]number\f[]
  321. is constrained to being:
  322. .in +4
  323. .nf
  324. .na
  325. greater than or equal to 0
  326. .fi
  327. .in -4
  328. The default
  329. \f\*[I-Font]number\f[]
  330. for this option is:
  331. .ti +4
  332. 0
  333. .sp
  334. This fuzzing was designed as to test layer 7 protocols such as voip protocols.
  335. It modifies randomly 1 out of X packets (where X = \fB--fuzz-factor\fP) in order
  336. for stateful protocols to cover more of their code. The random fuzzing actions
  337. focus on data start and end because it often is the part of the data application
  338. protocols base their decisions on.
  339. .sp
  340. Possible fuzzing actions list:
  341. * drop packet
  342. * reduce packet size
  343. * edit packet Bytes:
  344. * Not all Bytes have the same probability of appearance in real life.
  345. Replace with 0x00, 0xFF, or a random byte with equal likelihood.
  346. * Not all Bytes have the same significance in a packet.
  347. Replace the start, the end, or the middle of the packet with equal likelihood.
  348. * do nothing (7 out of 8 packets)
  349. .TP
  350. .NOP \f\*[B-Font]\-\-fuzz\-factor\f[]=\f\*[I-Font]number\f[]
  351. Set the Fuzz 1 in X packet ratio (default 1 in 8 packets).
  352. This option must appear in combination with the following options:
  353. fuzz-seed.
  354. This option takes an integer number as its argument.
  355. The value of
  356. \f\*[I-Font]number\f[]
  357. is constrained to being:
  358. .in +4
  359. .nf
  360. .na
  361. greater than or equal to 1
  362. .fi
  363. .in -4
  364. The default
  365. \f\*[I-Font]number\f[]
  366. for this option is:
  367. .ti +4
  368. 8
  369. .sp
  370. Sets the ratio of for \fB--fuzz-seed\fP option. By default this value is 8,
  371. which means 1 in 8 packets are modified by fuzzing. Note that this ratio is
  372. based on the random number generated by the supplied fuzz seed. Therefore by
  373. default you cannot expect that exactly every eighth packet will be modified.
  374. .TP
  375. .NOP \f\*[B-Font]\-\-skipl2broadcast\f[]
  376. Skip rewriting broadcast/multicast Layer 2 addresses.
  377. .sp
  378. By default, editing Layer 2 addresses will rewrite
  379. broadcast and multicast MAC addresses. Setting this flag
  380. will keep broadcast/multicast MAC addresses from being rewritten.
  381. .TP
  382. .NOP \f\*[B-Font]\-\-dlt\f[]=\f\*[I-Font]string\f[]
  383. Override output DLT encapsulation.
  384. This option may appear up to 1 times.
  385. .sp
  386. By default, no DLT (data link type) conversion will be made.
  387. To change the DLT type of the output pcap, select one of the following values:
  388. .sp 1
  389. \fBenet\fP
  390. Ethernet aka DLT_EN10MB
  391. .sp 1
  392. \fBhdlc\fP
  393. Cisco HDLC aka DLT_C_HDLC
  394. .sp 1
  395. \fBjnpr_eth\fP
  396. Juniper Ethernet DLT_C_JNPR_ETHER
  397. .sp 1
  398. \fBpppserial\fP
  399. PPP Serial aka DLT_PPP_SERIAL
  400. .sp 1
  401. \fBuser\fP
  402. User specified Layer 2 header and DLT type
  403. .br
  404. .TP
  405. .NOP \f\*[B-Font]\-\-enet\-dmac\f[]=\f\*[I-Font]string\f[]
  406. Override destination ethernet MAC addresses.
  407. This option may appear up to 1 times.
  408. .sp
  409. Takes a pair of comma deliminated ethernet MAC addresses which
  410. will replace the destination MAC address of outbound packets.
  411. The first MAC address will be used for the server to client traffic
  412. and the optional second MAC address will be used for the client
  413. to server traffic.
  414. .sp
  415. Example:
  416. .nf
  417. \--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
  418. .fi
  419. .TP
  420. .NOP \f\*[B-Font]\-\-enet\-smac\f[]=\f\*[I-Font]string\f[]
  421. Override source ethernet MAC addresses.
  422. This option may appear up to 1 times.
  423. .sp
  424. Takes a pair of comma deliminated ethernet MAC addresses which
  425. will replace the source MAC address of outbound packets.
  426. The first MAC address will be used for the server to client traffic
  427. and the optional second MAC address will be used for the client
  428. to server traffic.
  429. .sp
  430. Example:
  431. .nf
  432. \--enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
  433. .fi
  434. .TP
  435. .NOP \f\*[B-Font]\-\-enet\-subsmac\f[]=\f\*[I-Font]string\f[]
  436. Substitute MAC addresses.
  437. This option may appear up to 9999 times.
  438. .sp
  439. Allows you to rewrite ethernet MAC addresses of packets. It takes
  440. comma delimited pair or MACs address and rewrites all occurrences of
  441. the first MAC with the value of the second MAC.
  442. Example:
  443. .nf
  444. \--enet-subsmac=00:12:13:14:15:16,00:22:33:44:55:66
  445. .fi
  446. .TP
  447. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\f[]=\f\*[I-Font]number\f[]
  448. Randomize MAC addresses.
  449. This option may appear up to 1 times.
  450. This option must not appear in combination with any of the following options:
  451. enet-smac, enet-dmac, enet-subsmac.
  452. This option takes an integer number as its argument.
  453. .sp
  454. Allows you to randomize ethernet MAC addresses of packets, mostly
  455. like what \fB--seed\fP option does for IPv4/IPv6 addresses.
  456. .TP
  457. .NOP \f\*[B-Font]\-\-enet\-mac\-seed\-keep\-bytes\f[]=\f\*[I-Font]number\f[]
  458. Randomize MAC addresses.
  459. This option may appear up to 1 times.
  460. This option must appear in combination with the following options:
  461. enet-mac-seed.
  462. This option takes an integer number as its argument.
  463. The value of
  464. \f\*[I-Font]number\f[]
  465. is constrained to being:
  466. .in +4
  467. .nf
  468. .na
  469. in the range 1 through 6
  470. .fi
  471. .in -4
  472. .sp
  473. Keep some bytes untouched when usinging \fB--enet-mac-seed\fP option.
  474. .TP
  475. .NOP \f\*[B-Font]\-\-enet\-vlan\f[]=\f\*[I-Font]string\f[]
  476. Specify ethernet 802.1q VLAN tag mode.
  477. This option may appear up to 1 times.
  478. .sp
  479. Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
  480. ethernet headers or remove the 802.1q VLAN tag information.
  481. .sp 1
  482. \fBadd\fP
  483. Adds an 802.1q VLAN header to the existing 802.3 ethernet header. If
  484. a VLAN header already exists, a new VLAN header is added outside of the
  485. existing header.
  486. .sp
  487. Note that you will be allowed to run this option multiple times to create
  488. more than 2 VLAN headers, however those packets will be valid. At most
  489. you should have 2 X 802.1q VLAN tags, or outer an 802.1ad and an inner 802.1q
  490. VLAN tag.
  491. .sp 1
  492. \fBdel\fP
  493. Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
  494. .TP
  495. .NOP \f\*[B-Font]\-\-enet\-vlan\-tag\f[]=\f\*[I-Font]number\f[]
  496. Specify the new ethernet 802.1q VLAN tag value.
  497. This option may appear up to 1 times.
  498. This option must appear in combination with the following options:
  499. enet-vlan.
  500. This option takes an integer number as its argument.
  501. The value of
  502. \f\*[I-Font]number\f[]
  503. is constrained to being:
  504. .in +4
  505. .nf
  506. .na
  507. in the range 0 through 4095
  508. .fi
  509. .in -4
  510. .sp
  511. .TP
  512. .NOP \f\*[B-Font]\-\-enet\-vlan\-cfi\f[]=\f\*[I-Font]number\f[]
  513. Specify the ethernet 802.1q VLAN CFI value.
  514. This option may appear up to 1 times.
  515. This option must appear in combination with the following options:
  516. enet-vlan.
  517. This option takes an integer number as its argument.
  518. The value of
  519. \f\*[I-Font]number\f[]
  520. is constrained to being:
  521. .in +4
  522. .nf
  523. .na
  524. in the range 0 through 1
  525. .fi
  526. .in -4
  527. .sp
  528. .TP
  529. .NOP \f\*[B-Font]\-\-enet\-vlan\-pri\f[]=\f\*[I-Font]number\f[]
  530. Specify the ethernet 802.1q VLAN priority.
  531. This option may appear up to 1 times.
  532. This option must appear in combination with the following options:
  533. enet-vlan.
  534. This option takes an integer number as its argument.
  535. The value of
  536. \f\*[I-Font]number\f[]
  537. is constrained to being:
  538. .in +4
  539. .nf
  540. .na
  541. in the range 0 through 7
  542. .fi
  543. .in -4
  544. .sp
  545. .TP
  546. .NOP \f\*[B-Font]\-\-enet\-vlan\-proto\f[]=\f\*[I-Font]string\f[]
  547. Specify VLAN tag protocol 802.1q or 802.1ad.
  548. This option may appear up to 1 times.
  549. .sp
  550. Allows you to specify the protocol of the added VLAN tags.
  551. .sp 1
  552. \fB802.1q\fP
  553. Specifies that 802.1q VLAN headers are to be added. This is the default.
  554. .sp 1
  555. \fB802.1ad\fP
  556. Specifies that 802.1ad Q-in-Q VLAN headers are to be added. To make valid packets,
  557. input packets must already have 802.1q VLAN headers.
  558. .TP
  559. .NOP \f\*[B-Font]\-\-hdlc\-control\f[]=\f\*[I-Font]number\f[]
  560. Specify HDLC control value.
  561. This option may appear up to 1 times.
  562. This option takes an integer number as its argument.
  563. .sp
  564. The Cisco HDLC header has a 1 byte "control" field. Apparently this should
  565. always be 0, but if you can use any 1 byte value.
  566. .TP
  567. .NOP \f\*[B-Font]\-\-hdlc\-address\f[]=\f\*[I-Font]number\f[]
  568. Specify HDLC address.
  569. This option may appear up to 1 times.
  570. This option takes an integer number as its argument.
  571. .sp
  572. The Cisco HDLC header has a 1 byte "address" field which has two valid
  573. values:
  574. .sp 1
  575. \fB0x0F\fP
  576. Unicast
  577. .sp 1
  578. \fB0xBF\fP
  579. Broadcast
  580. .br
  581. You can however specify any single byte value.
  582. .TP
  583. .NOP \f\*[B-Font]\-\-user\-dlt\f[]=\f\*[I-Font]number\f[]
  584. Set output file DLT type.
  585. This option may appear up to 1 times.
  586. This option takes an integer number as its argument.
  587. .sp
  588. Set the DLT value of the output pcap file.
  589. .TP
  590. .NOP \f\*[B-Font]\-\-user\-dlink\f[]=\f\*[I-Font]string\f[]
  591. Rewrite Data-Link layer with user specified data.
  592. This option may appear up to 2 times.
  593. .sp
  594. Provide a series of comma deliminated hex values which will be
  595. used to rewrite or create the Layer 2 header of the packets.
  596. The first instance of this argument will rewrite both server
  597. and client traffic, but if this argument is specified a second
  598. time, it will be used for the client traffic.
  599. .sp
  600. Example:
  601. .nf
  602. \--user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
  603. .fi
  604. .TP
  605. .NOP \f\*[B-Font]\-d\f[] \f\*[I-Font]number\f[], \f\*[B-Font]\-\-dbug\f[]=\f\*[I-Font]number\f[]
  606. Enable debugging output.
  607. This option may appear up to 1 times.
  608. This option takes an integer number as its argument.
  609. The value of
  610. \f\*[I-Font]number\f[]
  611. is constrained to being:
  612. .in +4
  613. .nf
  614. .na
  615. in the range 0 through 5
  616. .fi
  617. .in -4
  618. The default
  619. \f\*[I-Font]number\f[]
  620. for this option is:
  621. .ti +4
  622. 0
  623. .sp
  624. If configured with \--enable-debug, then you can specify a verbosity
  625. level for debugging output. Higher numbers increase verbosity.
  626. .TP
  627. .NOP \f\*[B-Font]\-i\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-infile\f[]=\f\*[I-Font]string\f[]
  628. Input pcap file to be processed.
  629. This option may appear up to 1 times.
  630. .sp
  631. .TP
  632. .NOP \f\*[B-Font]\-o\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-outfile\f[]=\f\*[I-Font]string\f[]
  633. Output pcap file.
  634. This option may appear up to 1 times.
  635. .sp
  636. .TP
  637. .NOP \f\*[B-Font]\-c\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-cachefile\f[]=\f\*[I-Font]string\f[]
  638. Split traffic via tcpprep cache file.
  639. This option may appear up to 1 times.
  640. .sp
  641. Use tcpprep cache file to split traffic based upon client/server relationships.
  642. .TP
  643. .NOP \f\*[B-Font]\-v\f[], \f\*[B-Font]\-\-verbose\f[]
  644. Print decoded packets via tcpdump to STDOUT.
  645. This option may appear up to 1 times.
  646. .sp
  647. .TP
  648. .NOP \f\*[B-Font]\-A\f[] \f\*[I-Font]string\f[], \f\*[B-Font]\-\-decode\f[]=\f\*[I-Font]string\f[]
  649. Arguments passed to tcpdump decoder.
  650. This option may appear up to 1 times.
  651. This option must appear in combination with the following options:
  652. verbose.
  653. .sp
  654. When enabling verbose mode (\fB-v\fP) you may also specify one or
  655. more additional arguments to pass to \fBtcpdump\fP to modify
  656. the way packets are decoded. By default, \-n and \-l are used.
  657. Be sure to quote the arguments so that they are not interpreted
  658. by tcprewrite. Please see the tcpdump(1) man page for a complete list of
  659. options.
  660. .TP
  661. .NOP \f\*[B-Font]\-\-fragroute\f[]=\f\*[I-Font]string\f[]
  662. Parse fragroute configuration file.
  663. This option may appear up to 1 times.
  664. .sp
  665. Enable advanced evasion techniques using the built-in fragroute(8)
  666. engine. See the fragroute(8) man page for more details. Important:
  667. tcprewrite does not support the delay, echo or print commands.
  668. .TP
  669. .NOP \f\*[B-Font]\-\-fragdir\f[]=\f\*[I-Font]string\f[]
  670. Which flows to apply fragroute to: c2s, s2c, both.
  671. This option may appear up to 1 times.
  672. This option must appear in combination with the following options:
  673. cachefile.
  674. .sp
  675. Apply the fragroute engine to packets going c2s, s2c or both when
  676. using a cache file.
  677. .TP
  678. .NOP \f\*[B-Font]\-\-skip\-soft\-errors\f[]
  679. Skip writing packets with soft errors.
  680. This option may appear up to 1 times.
  681. .sp
  682. In some cases, packets can not be decoded or the requested editing
  683. is not possible. Normally these packets are written to the output
  684. file unedited so that tcpprep cache files can still be used, but if
  685. you wish, these packets can be suppressed.
  686. .sp
  687. One example of this is 802.11 management frames which contain no data.
  688. .TP
  689. .NOP \f\*[B-Font]\-V\f[], \f\*[B-Font]\-\-version\f[]
  690. Print version information.
  691. .sp
  692. .TP
  693. .NOP \f\*[B-Font]\-h\f[], \f\*[B-Font]\-\-less\-help\f[]
  694. Display less usage information and exit.
  695. .sp
  696. .TP
  697. .NOP \f\*[B-Font]\-w\f[], \f\*[B-Font]\-\-suppress\-warnings\f[]
  698. suppress printing warning messages.
  699. .sp
  700. .TP
  701. .NOP \f\*[B-Font]\-H\f[], \f\*[B-Font]\-\-help\f[]
  702. Display usage information and exit.
  703. .TP
  704. .NOP \f\*[B-Font]\-\&!\f[], \f\*[B-Font]\-\-more-help\f[]
  705. Pass the extended usage information through a pager.
  706. .TP
  707. .NOP \f\*[B-Font]\-\-save-opts\f[] [=\f\*[I-Font]cfgfile\f[]]
  708. Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
  709. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  710. The command will exit after updating the config file.
  711. .TP
  712. .NOP \f\*[B-Font]\-\-load-opts\f[]=\f\*[I-Font]cfgfile\f[], \f\*[B-Font]\-\-no-load-opts\f[]
  713. Load options from \fIcfgfile\fP.
  714. The \fIno-load-opts\fP form will disable the loading
  715. of earlier config/rc/ini files. \fI\-\-no-load-opts\fP is handled early,
  716. out of order.
  717. .PP
  718. .SH "OPTION PRESETS"
  719. Any option that is not marked as \fInot presettable\fP may be preset
  720. by loading values from configuration ("RC" or ".INI") file(s).
  721. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  722. In that case, the file "\fI.tcprewriterc\fP"
  723. is searched for within that directory.
  724. .SH "FILES"
  725. See \fBOPTION PRESETS\fP for configuration files.
  726. .SH "EXIT STATUS"
  727. One of the following exit values will be returned:
  728. .TP
  729. .NOP 0 " (EXIT_SUCCESS)"
  730. Successful program execution.
  731. .TP
  732. .NOP 1 " (EXIT_FAILURE)"
  733. The operation failed or the command syntax was not valid.
  734. .TP
  735. .NOP 66 " (EX_NOINPUT)"
  736. A specified configuration file could not be loaded.
  737. .TP
  738. .NOP 70 " (EX_SOFTWARE)"
  739. libopts had an internal operational error. Please report
  740. it to autogen-users@lists.sourceforge.net. Thank you.
  741. .PP
  742. .SH "AUTHORS"
  743. Copyright 2013-2024 Fred Klassen \- AppNeta
  744. Copyright 2000-2012 Aaron Turner
  745. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  746. The latest version of this software is always available from:
  747. http://tcpreplay.appneta.com/
  748. .SH "COPYRIGHT"
  749. Copyright (C) 2000-2024 Aaron Turner and Fred Klassen all rights reserved.
  750. This program is released under the terms of the GNU General Public License, version 3 or later.
  751. .SH "BUGS"
  752. Please send bug reports to: tcpreplay-users@lists.sourceforge.net
  753. .SH "NOTES"
  754. This manual page was \fIAutoGen\fP-erated from the \fBtcprewrite\fP
  755. option definitions.