tcpbridge.1 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. .TH TCPBRIDGE 1 2006-08-07 "" "Programmer's Manual"
  2. .\" DO NOT EDIT THIS FILE (tcpbridge.1)
  3. .\"
  4. .\" It has been AutoGen-ed Monday August 7, 2006 at 09:28:41 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 selectively 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 -b ", " --skipbroadcast
  119. Skip rewriting broadcast/multicast IP's.
  120. .sp
  121. By default, --dmac, --smac, --seed, --pnat and --endpoints will rewrite
  122. broadcast and multicast IP and MAC addresses. Setting this flag
  123. will keep broadcast/multicast IP and MAC addresses from being rewritten.
  124. .TP
  125. .BR -C ", " --fixcsum
  126. Force recalculation of IP/TCP/UDP checksums.
  127. .sp
  128. Causes each IP packet to have it's checksums recalcualted and
  129. fixed. Automatically enabled for packets modified with \fB--seed\fP,
  130. \fB--pnat\fP, \fB--endpoints\fP or \fB--fixlen\fP.
  131. .TP
  132. .BR -m " \fInumber\fP, " --mtu "=" \fInumber\fP
  133. Override default MTU length (1500 bytes).
  134. This option may appear up to 1 times.
  135. This option takes an integer number as its argument.
  136. The value of \fInumber\fP is constrained to being:
  137. .in +4
  138. .nf
  139. .na
  140. in the range 1 through MAXPACKET
  141. .fi
  142. .in -4
  143. .sp
  144. Override the default 1500 byte MTU size for determining the maximum padding length.
  145. .TP
  146. .BR -F " \fIstring\fP, " --fixlen "=" \fIstring\fP
  147. Pad or truncate packet data to match header length.
  148. This option may appear up to 1 times.
  149. .sp
  150. Packets may be truncated during capture if the snaplen is smaller then the
  151. packet. This option allows you to modify the packet to pad the packet back
  152. out to the size stored in the IPv4 header or rewrite the IP header total length
  153. to reflect the stored packet length.
  154. .sp 1
  155. \fBpad\fP
  156. Truncated packets will be padded out so that the packet length matches the
  157. IPv4 total length
  158. .sp 1
  159. \fBtrunc\fP
  160. Truncated packets will have their IPv4 total length field rewritten to match
  161. the actual packet length
  162. .sp 1
  163. \fBdel\fP
  164. Delete the packet
  165. .TP
  166. .BR -T " \fIstring\fP, " --vlan "=" \fIstring\fP
  167. Specify 802.1q VLAN tag mode.
  168. This option may appear up to 1 times.
  169. .sp
  170. Allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3
  171. ethernet headers or remove the 802.1q VLAN tag information.
  172. .sp 1
  173. \fBadd\fP
  174. Rewrites the existing 802.3 ethernet header as an 802.1q VLAN header
  175. .sp 1
  176. \fBdel\fP
  177. Rewrites the existing 802.1q VLAN header as an 802.3 ethernet header
  178. .TP
  179. .BR -t " \fInumber\fP, " --vlan-tag "=" \fInumber\fP
  180. Specify the new 802.1q VLAN tag value.
  181. This option may appear up to 1 times.
  182. This option must appear in combination with the following options:
  183. vlan.
  184. This option takes an integer number as its argument.
  185. The value of \fInumber\fP is constrained to being:
  186. .in +4
  187. .nf
  188. .na
  189. in the range 0 through 4095
  190. .fi
  191. .in -4
  192. .sp
  193. .TP
  194. .BR -f " \fInumber\fP, " --vlan-cfi "=" \fInumber\fP
  195. Specify the 802.1q VLAN CFI value.
  196. This option may appear up to 1 times.
  197. This option must appear in combination with the following options:
  198. vlan.
  199. This option takes an integer number as its argument.
  200. The value of \fInumber\fP is constrained to being:
  201. .in +4
  202. .nf
  203. .na
  204. in the range 0 through 1
  205. .fi
  206. .in -4
  207. .sp
  208. .TP
  209. .BR -p " \fInumber\fP, " --vlan-pri "=" \fInumber\fP
  210. Specify the 802.1q VLAN priority.
  211. This option may appear up to 1 times.
  212. This option must appear in combination with the following options:
  213. vlan.
  214. This option takes an integer number as its argument.
  215. The value of \fInumber\fP is constrained to being:
  216. .in +4
  217. .nf
  218. .na
  219. in the range 0 through 7
  220. .fi
  221. .in -4
  222. .sp
  223. .TP
  224. .BR -d " \fInumber\fP, " --dbug "=" \fInumber\fP
  225. Enable debugging output.
  226. This option may appear up to 1 times.
  227. This option takes an integer number as its argument.
  228. The value of \fInumber\fP is constrained to being:
  229. .in +4
  230. .nf
  231. .na
  232. in the range 0 through 5
  233. .fi
  234. .in -4
  235. The default \fInumber\fP for this option is:
  236. .ti +4
  237. 0
  238. .sp
  239. If configured with --enable-debug, then you can specify a verbosity
  240. level for debugging output. Higher numbers increase verbosity.
  241. .TP
  242. .BR -i " \fIstring\fP, " --intf1 "=" \fIstring\fP
  243. Primary interface (listen in uni-directional mode).
  244. This option may appear up to 1 times.
  245. .sp
  246. .TP
  247. .BR -I " \fIstring\fP, " --intf2 "=" \fIstring\fP
  248. Secondary interface (send in uni-directional mode).
  249. This option may appear up to 1 times.
  250. .sp
  251. .TP
  252. .BR -u ", " --unidir
  253. Send and receive in only one direction.
  254. This option may appear up to 1 times.
  255. .sp
  256. Normally, tcpbridge will send and receive traffic in both directions
  257. (bi-directionally). However, if you choose this option, traffic will
  258. be sent uni-directionally.
  259. .TP
  260. .BR -L " \fInumber\fP, " --limit "=" \fInumber\fP
  261. Limit the number of packets to send.
  262. This option may appear up to 1 times.
  263. This option takes an integer number as its argument.
  264. The value of \fInumber\fP is constrained to being:
  265. .in +4
  266. .nf
  267. .na
  268. greater than or equal to 0
  269. .fi
  270. .in -4
  271. The default \fInumber\fP for this option is:
  272. .ti +4
  273. -1
  274. .sp
  275. By default, tcpbridge will send packets forever or until Ctrl-C. Alternatively,
  276. you can specify a maximum number of packets to send.
  277. .TP
  278. .BR -x " \fIstring\fP, " --include "=" \fIstring\fP
  279. Include only packets matching rule.
  280. This option may appear up to 1 times.
  281. This option must not appear in combination with any of the following options:
  282. exclude.
  283. .sp
  284. Override default of sending all packets stored in the capture file and only
  285. send packets which match the provided rule. Rules can be one of:
  286. .sp
  287. .IR "S:<CIDR1>,... "
  288. - Source IP must match specified CIDR(s)
  289. .sp
  290. .IR "D:<CIDR1>,... "
  291. - Destination IP must match specified CIDR(s)
  292. .sp
  293. .IR "B:<CIDR1>,... "
  294. - Both source and destination IP must match specified CIDR(s)
  295. .sp
  296. .IR "E:<CIDR1>,... "
  297. - Either IP must match specified CIDR(s)
  298. .sp
  299. .IR "P:<LIST> "
  300. - Must be one of the listed packets where the list
  301. corresponds to the packet number in the capture file.
  302. .nf
  303. --include=P:1-5,9,15,72-
  304. .fi
  305. would send packets 1 thru 5, the 9th and 15th packet, and packets 72 until the
  306. end of the file
  307. .sp
  308. .IR "F:'<bpf>'"
  309. - BPF filter. See the \fItcpdump(8)\fP man page for syntax.
  310. .br
  311. .TP
  312. .BR -X " \fIstring\fP, " --exclude "=" \fIstring\fP
  313. Exclude any packet matching this rule.
  314. This option may appear up to 1 times.
  315. This option must not appear in combination with any of the following options:
  316. include.
  317. .sp
  318. Override default of sending all packets stored in the capture file and only
  319. send packets which do not match the provided rule. Rules can be one of:
  320. .sp
  321. .IR "S:<CIDR1>,... "
  322. - Source IP must not match specified CIDR(s)
  323. .sp
  324. .IR "D:<CIDR1>,... "
  325. - Destination IP must not match specified CIDR(s)
  326. .sp
  327. .IR "B:<CIDR1>,... "
  328. - Both source and destination IP must not match specified CIDR(s)
  329. .sp
  330. .IR "E:<CIDR1>,... "
  331. - Either IP must not match specified CIDR(s)
  332. .sp
  333. .IR "P:<LIST> "
  334. - Must not be one of the listed packets where the list
  335. corresponds to the packet number in the capture file.
  336. .nf
  337. --exclude=P:1-5,9,15,72-
  338. .fi
  339. would drop packets 1 thru 5, the 9th and 15th packet, and packets 72 until the
  340. end of the file
  341. .br
  342. .TP
  343. .BR -e " \fIstring\fP, " --endpoints "=" \fIstring\fP
  344. Rewrite IP addresses to be between two endpoints.
  345. This option may appear up to 1 times.
  346. .sp
  347. Takes a pair of colon delimited IP addresses which will be used to rewrite
  348. all traffic to appear to be between the two IP's.
  349. Example:
  350. .nf
  351. --endpoints=172.16.0.1:172.16.0.2
  352. .fi
  353. .TP
  354. .BR -P ", " --pid
  355. Print the PID of tcpbridge at startup.
  356. .sp
  357. .TP
  358. .BR -v ", " --verbose
  359. Print decoded packets via tcpdump to STDOUT.
  360. This option may appear up to 1 times.
  361. .sp
  362. .TP
  363. .BR -A " \fIstring\fP, " --decode "=" \fIstring\fP
  364. Arguments passed to tcpdump decoder.
  365. This option may appear up to 1 times.
  366. This option must appear in combination with the following options:
  367. verbose.
  368. .sp
  369. When enabling verbose mode (\fB-v\fP) you may also specify one or more
  370. additional arguments to pass to \fBtcpdump\fP to modify the way packets
  371. are decoded. By default, -n and -l are used. Be sure to
  372. quote the arguments like: --verbose="-axxx" so that they are not interpreted
  373. by tcpbridge. The following arguments are vaild:
  374. [ -aAeNqRStuvxX ]
  375. [ -E spi@ipaddr algo:secret,... ]
  376. [ -s snaplen ]
  377. .TP
  378. .BR -V ", " --version
  379. Print version information.
  380. .sp
  381. .TP
  382. .BR -h ", " --less-help
  383. Display less usage information and exit.
  384. .sp
  385. .TP
  386. .BR \-H , " \--help"
  387. Display usage information and exit.
  388. .TP
  389. .BR \-! , " \--more-help"
  390. Extended usage information passed thru pager.
  391. .TP
  392. .BR \- " [\fIrcfile\fP]," " \--save-opts" "[=\fIrcfile\fP]"
  393. Save the option state to \fIrcfile\fP. The default is the \fIlast\fP
  394. configuration file listed in the \fBOPTION PRESETS\fP section, below.
  395. .TP
  396. .BR \- " \fIrcfile\fP," " \--load-opts" "=\fIrcfile\fP," " --no-load-opts"
  397. Load options from \fIrcfile\fP.
  398. The \fIno-load-opts\fP form will disable the loading
  399. of earlier RC/INI files. \fI--no-load-opts\fP is handled early,
  400. out of order.
  401. .SH OPTION PRESETS
  402. Any option that is not marked as \fInot presettable\fP may be preset
  403. by loading values from configuration ("RC" or ".INI") file(s).
  404. The \fIhomerc\fP file is "\fI$$/\fP", unless that is a directory.
  405. In that case, the file "\fI.tcpbridgerc\fP"
  406. is searched for within that directory.
  407. .SH "SIGNALS"
  408. tcpbridge understands the following signals:
  409. .sp
  410. .IR "\fBSIGUSR1\fP"
  411. Suspend tcpbridge
  412. .sp
  413. .IR "\fBSIGCONT\fP"
  414. Restart tcpbridge
  415. .br
  416. .SH "SEE ALSO"
  417. tcpdump(1), tcpprep(1), tcprewrite(1), tcpreplay(1)
  418. .SH "BUGS"
  419. tcpbridge can only send packets as fast as your computer's interface,
  420. processor and system bus will allow.
  421. Connecting both interfaces to the same subnet may create a broadcast storm and
  422. take down the network. Improper use of the packet editing functions may have
  423. other undefined and possible negative consequences.
  424. Some operating systems by default do not allow for forging source MAC
  425. addresses. Please consult your operating system's documentation and the
  426. tcpreplay FAQ if you experiance this issue.
  427. .SH AUTHOR
  428. Copyright 2000-2005 Aaron Turner
  429. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  430. .PP
  431. Released under the Free BSD License.
  432. .PP
  433. This manual page was \fIAutoGen\fP-erated from the \fBtcpbridge\fP
  434. option definitions.