tcpbridge.1 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. .TH TCPBRIDGE 1 2006-07-17 "" "Programmer's Manual"
  2. .\" DO NOT EDIT THIS FILE (tcpbridge.1)
  3. .\"
  4. .\" It has been AutoGen-ed Monday July 17, 2006 at 06:48:26 PM PDT
  5. .\" From the definitions tcpbridge_opts.def
  6. .\" and the template file agman1.tpl
  7. .\"
  8. .SH NAME
  9. tcpbridge \- Bridge network traffic across two interfaces
  10. .SH SYNOPSIS
  11. .B tcpbridge
  12. .\" Mixture of short (flag) options and long options
  13. .RB [ -\fIflag\fP " [\fIvalue\fP]]... [" --\fIopt-name\fP " [[=| ]\fIvalue\fP]]..."
  14. .PP
  15. All arguments must be options.
  16. .PP
  17. tcpbridge is a tool for briding network traffic across two interfaces
  18. and optionally modifying the packets in betweeen
  19. .SH "DESCRIPTION"
  20. This manual page documents, briefly, the \fBtcpbridge\fP command.
  21. The basic operation of tcpbridge is to be a network bridge between two
  22. subnets. All packets received on one interface are sent via the other.
  23. Optionally, packets can be edited in a variety of ways according to your needs.
  24. .SH OPTIONS
  25. .TP
  26. .BR -D " \fIstring\fP, " --dmac "=" \fIstring\fP
  27. Rewrite destination MAC addresses.
  28. This option may appear up to 1 times.
  29. .sp
  30. Takes a pair of comma deliminated ethernet MAC addresses which
  31. will replace the destination MAC address of outbound packets.
  32. The first MAC address will be used for the server traffic
  33. and the optional second MAC address will be used for the client
  34. traffic.
  35. Example:
  36. .nf
  37. --dmac 00:12:13:14:15:16,00:22:33:44:55:66
  38. .fi
  39. .TP
  40. .BR -S " \fIstring\fP, " --smac "=" \fIstring\fP
  41. Rewrite source MAC addresses.
  42. This option may appear up to 1 times.
  43. .sp
  44. Takes a pair of comma deliminated ethernet MAC addresses which
  45. will replace the source MAC address of outbound packets.
  46. The first MAC address will be used for the server traffic
  47. and the optional second MAC address will be used for the client traffic.
  48. Example:
  49. .nf
  50. --smac 00:12:13:14:15:16,00:22:33:44:55:66
  51. .fi
  52. .TP
  53. .BR -P " \fInumber\fP, " --proto "=" \fInumber\fP
  54. Override L2 protocol type for DLT_RAW.
  55. This option may appear up to 1 times.
  56. This option takes an integer number as its argument.
  57. The value of \fInumber\fP is constrained to being:
  58. .in +4
  59. .nf
  60. .na
  61. in the range 0 through 65535
  62. .fi
  63. .in -4
  64. .sp
  65. By default, pcap files encapsulated using DLT_RAW will have their protocol
  66. set to ETHERTYPE_IP (0x0800).
  67. .TP
  68. .BR -l " \fIstring\fP, " --dlink "=" \fIstring\fP
  69. Rewrite Data-Link layer with specified data.
  70. This option may appear up to 2 times.
  71. .sp
  72. Provide a series of comma deliminated hex values which will be
  73. used to rewrite or create the Layer 2 header of the packets.
  74. The first instance of this argument will rewrite both server
  75. and client traffic, but if this argument is specified a second
  76. time, it will be used for the client traffic.
  77. Example:
  78. .nf
  79. --dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
  80. .fi
  81. .TP
  82. .BR -r " \fIstring\fP, " --portmap "=" \fIstring\fP
  83. Rewrite TCP/UDP ports.
  84. This option may appear up to 1 times.
  85. .sp
  86. Specify a list of comma delimited port mappingings consisting of
  87. colon delimited port number pairs. Each colon delimited port pair
  88. consists of the port to match followed by the port number to rewrite.
  89. Example:
  90. .nf
  91. --portmap=80:8000,8080:80
  92. .fi
  93. .TP
  94. .BR -s " \fInumber\fP, " --seed "=" \fInumber\fP
  95. Randomize src/dst IP addresses w/ given seed.
  96. This option may appear up to 1 times.
  97. This option takes an integer number as its argument.
  98. .sp
  99. Causes the source and destination IP addresses to be pseudo
  100. randomized but still maintain client/server relationships.
  101. Since the randomization is deterministic based on the seed,
  102. you can reuse the same seed value to recreate the traffic.
  103. .TP
  104. .BR -N " \fIstring\fP, " --pnat "=" \fIstring\fP
  105. Rewrite IP addresses using pseudo-NAT.
  106. This option may appear up to 2 times.
  107. .sp
  108. Takes a comma delimited series of colon delimited CIDR
  109. netblock pairs. Each netblock pair is evaluated in order against
  110. the IP addresses. If the IP address in the packet matches the
  111. first netblock, it is rewriten using the second netblock as a
  112. mask against the high order bits.
  113. 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. .TP
  118. .BR -e " \fIstring\fP, " --endpoints "=" \fIstring\fP
  119. Rewrite IP addresses to be between two endpoints.
  120. This option may appear up to 1 times.
  121. .sp
  122. Takes a pair of colon delimited IP addresses which will be used to rewrite
  123. all traffic to appear to be between the two IP's.
  124. Example:
  125. .nf
  126. --endpoints=172.16.0.1:172.16.0.2
  127. .fi
  128. .TP
  129. .BR -C ", " --fixcsum
  130. Force recalculation of IP/TCP/UDP checksums.
  131. .sp
  132. Causes each IP packet to have it's checksums recalcualted and
  133. fixed. Automatically enabled for packets modified with \fB--seed\fP,
  134. \fB--pnat\fP, \fB--endpoints\fP or \fB--fixlen\fP.
  135. .TP
  136. .BR -m " \fInumber\fP, " --mtu "=" \fInumber\fP
  137. Override default MTU length (1500 bytes).
  138. This option may appear up to 1 times.
  139. This option takes an integer number as its argument.
  140. The value of \fInumber\fP is constrained to being:
  141. .in +4
  142. .nf
  143. .na
  144. in the range 1 through MAXPACKET
  145. .fi
  146. .in -4
  147. .sp
  148. Override the default 1500 byte MTU size for determining the maximum padding length.
  149. .TP
  150. .BR -E ", " --efcs
  151. Remove Ethernet checksums (FCS) from end of frames.
  152. .sp
  153. .TP
  154. .BR -F " \fIstring\fP, " --fixlen "=" \fIstring\fP
  155. Pad or truncate packet data to match header length.
  156. This option may appear up to 1 times.
  157. .sp
  158. Packets may be truncated during capture if the snaplen is smaller then the
  159. packet. This option allows you to modify the packet to pad the packet back
  160. out to the size stored in the IPv4 header or rewrite the IP header total length
  161. to reflect the stored packet length.
  162. .sp 1
  163. \fBpad\fP
  164. Truncated packets will be padded out so that the packet length matches the
  165. IPv4 total length
  166. .sp 1
  167. \fBtrunc\fP
  168. Truncated packets will have their IPv4 total length field rewritten to match
  169. the actual packet length
  170. .sp 1
  171. \fBdel\fP
  172. Delete the packet
  173. .TP
  174. .BR -T " \fIstring\fP, " --vlan "=" \fIstring\fP
  175. Specify 802.1q VLAN tag mode.
  176. This option may appear up to 1 times.
  177. .sp
  178. Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
  179. ethernet headers or remove the 802.1q VLAN tag information.
  180. .sp 1
  181. \fBadd\fP
  182. Rewrites the existing 802.3 ethernet header as an 802.1q VLAN header
  183. .sp 1
  184. \fBdel\fP
  185. Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
  186. .TP
  187. .BR -t " \fInumber\fP, " --vlan-tag "=" \fInumber\fP
  188. Specify the new 802.1q VLAN tag value.
  189. This option may appear up to 1 times.
  190. This option must appear in combination with the following options:
  191. vlan.
  192. This option takes an integer number as its argument.
  193. The value of \fInumber\fP is constrained to being:
  194. .in +4
  195. .nf
  196. .na
  197. in the range 0 through 4095
  198. .fi
  199. .in -4
  200. .sp
  201. .TP
  202. .BR -f " \fInumber\fP, " --vlan-cfi "=" \fInumber\fP
  203. Specify the 802.1q VLAN CFI value.
  204. This option may appear up to 1 times.
  205. This option must appear in combination with the following options:
  206. vlan.
  207. This option takes an integer number as its argument.
  208. The value of \fInumber\fP is constrained to being:
  209. .in +4
  210. .nf
  211. .na
  212. in the range 0 through 1
  213. .fi
  214. .in -4
  215. .sp
  216. .TP
  217. .BR -p " \fInumber\fP, " --vlan-pri "=" \fInumber\fP
  218. Specify the 802.1q VLAN priority.
  219. This option may appear up to 1 times.
  220. This option must appear in combination with the following options:
  221. vlan.
  222. This option takes an integer number as its argument.
  223. The value of \fInumber\fP is constrained to being:
  224. .in +4
  225. .nf
  226. .na
  227. in the range 0 through 7
  228. .fi
  229. .in -4
  230. .sp
  231. .TP
  232. .BR -d " \fInumber\fP, " --dbug "=" \fInumber\fP
  233. Enable debugging output.
  234. This option may appear up to 1 times.
  235. This option takes an integer number as its argument.
  236. The value of \fInumber\fP is constrained to being:
  237. .in +4
  238. .nf
  239. .na
  240. in the range 0 through 5
  241. .fi
  242. .in -4
  243. The default \fInumber\fP for this option is:
  244. .ti +4
  245. 0
  246. .sp
  247. If configured with --enable-debug, then you can specify a verbosity
  248. level for debugging output. Higher numbers increase verbosity.
  249. .TP
  250. .BR -i " \fIstring\fP, " --intf1 "=" \fIstring\fP
  251. Primary interface (listen in uni-directional mode).
  252. This option may appear up to 1 times.
  253. .sp
  254. .TP
  255. .BR -I " \fIstring\fP, " --intf2 "=" \fIstring\fP
  256. Secondary interface (send in uni-directional mode).
  257. This option may appear up to 1 times.
  258. .sp
  259. .TP
  260. .BR -u ", " --unidir
  261. Send and receive in only one direction.
  262. This option may appear up to 1 times.
  263. .sp
  264. Normally, tcpbridge will send and receive traffic in both directions
  265. (bi-directionally). However, if you choose this option, traffic will
  266. be sent uni-directionally.
  267. .TP
  268. .BR -L " \fInumber\fP, " --limit "=" \fInumber\fP
  269. Limit the number of packets to send.
  270. This option may appear up to 1 times.
  271. This option takes an integer number as its argument.
  272. The value of \fInumber\fP is constrained to being:
  273. .in +4
  274. .nf
  275. .na
  276. greater than or equal to 0
  277. .fi
  278. .in -4
  279. The default \fInumber\fP for this option is:
  280. .ti +4
  281. -1
  282. .sp
  283. By default, tcpbridge will send packets forever or until Ctrl-C. Alternatively,
  284. you can specify a maximum number of packets to send.
  285. .TP
  286. .BR -x " \fIstring\fP, " --include "=" \fIstring\fP
  287. Include only packets matching rule.
  288. This option may appear up to 1 times.
  289. This option must not appear in combination with any of the following options:
  290. exclude.
  291. .sp
  292. Override default of sending all packets stored in the capture file and only
  293. send packets which match the provided rule. Rules can be one of:
  294. .sp
  295. .IR "S:<CIDR1>,... "
  296. - Source IP must match specified CIDR(s)
  297. .sp
  298. .IR "D:<CIDR1>,... "
  299. - Destination IP must match specified CIDR(s)
  300. .sp
  301. .IR "B:<CIDR1>,... "
  302. - Both source and destination IP must match specified CIDR(s)
  303. .sp
  304. .IR "E:<CIDR1>,... "
  305. - Either IP must match specified CIDR(s)
  306. .sp
  307. .IR "P:<LIST> "
  308. - Must be one of the listed packets where the list
  309. corresponds to the packet number in the capture file.
  310. .nf
  311. --include=P:1-5,9,15,72-
  312. .fi
  313. would send packets 1 thru 5, the 9th and 15th packet, and packets 72 until the
  314. end of the file
  315. .sp
  316. .IR "F:'<bpf>'"
  317. - BPF filter. See the \fItcpdump(8)\fP man page for syntax.
  318. .br
  319. .TP
  320. .BR -X " \fIstring\fP, " --exclude "=" \fIstring\fP
  321. Exclude any packet matching this rule.
  322. This option may appear up to 1 times.
  323. This option must not appear in combination with any of the following options:
  324. include.
  325. .sp
  326. Override default of sending all packets stored in the capture file and only
  327. send packets which do not match the provided rule. Rules can be one of:
  328. .sp
  329. .IR "S:<CIDR1>,... "
  330. - Source IP must not match specified CIDR(s)
  331. .sp
  332. .IR "D:<CIDR1>,... "
  333. - Destination IP must not match specified CIDR(s)
  334. .sp
  335. .IR "B:<CIDR1>,... "
  336. - Both source and destination IP must not match specified CIDR(s)
  337. .sp
  338. .IR "E:<CIDR1>,... "
  339. - Either IP must not match specified CIDR(s)
  340. .sp
  341. .IR "P:<LIST> "
  342. - Must not be one of the listed packets where the list
  343. corresponds to the packet number in the capture file.
  344. .nf
  345. --exclude=P:1-5,9,15,72-
  346. .fi
  347. would drop packets 1 thru 5, the 9th and 15th packet, and packets 72 until the
  348. end of the file
  349. .br
  350. .TP
  351. .BR -P ", " --pid
  352. Print the PID of tcpbridge at startup.
  353. .sp
  354. .TP
  355. .BR -v ", " --verbose
  356. Print decoded packets via tcpdump to STDOUT.
  357. This option may appear up to 1 times.
  358. .sp
  359. .TP
  360. .BR -A " \fIstring\fP, " --decode "=" \fIstring\fP
  361. Arguments passed to tcpdump decoder.
  362. This option may appear up to 1 times.
  363. This option must appear in combination with the following options:
  364. verbose.
  365. .sp
  366. When enabling verbose mode (\fB-v\fP) you may also specify one or more
  367. additional arguments to pass to \fBtcpdump\fP to modify the way packets
  368. are decoded. By default, -n and -l are used. Be sure to
  369. quote the arguments like: --verbose="-axxx" so that they are not interpreted
  370. by tcpbridge. The following arguments are vaild:
  371. [ -aAeNqRStuvxX ]
  372. [ -E spi@ipaddr algo:secret,... ]
  373. [ -s snaplen ]
  374. .TP
  375. .BR -V ", " --version
  376. Print version information.
  377. .sp
  378. .TP
  379. .BR -h ", " --less-help
  380. Display less usage information and exit.
  381. .sp
  382. .TP
  383. .BR \-H , " \--help"
  384. Display usage information and exit.
  385. .TP
  386. .BR \-! , " \--more-help"
  387. Extended usage information passed thru pager.
  388. .TP
  389. .BR \- " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
  390. Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
  391. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  392. .TP
  393. .BR \- " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " --no-load-opts"
  394. Load options from \fIrcfile\fP.
  395. The \fIno-load-opts\fP form will disable the loading
  396. of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
  397. out of order.
  398. .SH OPTION PRESETS
  399. Any option that is not marked as \fInot presettable\fP may be preset
  400. by loading values from configuration ("RC" or ".INI") file(s).
  401. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  402. In that case, the file "\fI.tcpbridgerc\fP"
  403. is searched for within that directory.
  404. .SH "SIGNALS"
  405. tcpbridge understands the following signals:
  406. .sp
  407. .IR "\fBSIGUSR1\fP"
  408. Suspend tcpbridge
  409. .sp
  410. .IR "\fBSIGCONT\fP"
  411. Restart tcpbridge
  412. .br
  413. .SH "SEE ALSO"
  414. tcpdump(1), tcpprep(1), tcprewrite(1), tcpreplay(1)
  415. .SH "BUGS"
  416. tcpbridge can only send packets as fast as your computer's interface,
  417. processor and system bus will allow.
  418. Connecting both interfaces to the same subnet may create a broadcast storm and
  419. take down the network. Improper use of the packet editing functions may have
  420. other undefined and possible negative consequences.
  421. Some operating systems by default do not allow for forging source MAC
  422. addresses. Please consult your operating system's documentation and the
  423. tcpreplay FAQ if you experiance this issue.
  424. .SH AUTHOR
  425. Copyright 2000-2005 Aaron Turner
  426. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  427. .PP
  428. Released under the Free BSD License.
  429. .PP
  430. This manual page was \fIAutoGen\fP-erated from the \fBtcpbridge\fP
  431. option definitions.