1TCPBRIDGE(1)                  Programmer's Manual                 TCPBRIDGE(1)
2
3
4

NAME

6       tcpbridge - Bridge network traffic across two interfaces
7

SYNOPSIS

9       tcpbridge [-flag [value]]... [--opt-name [[=| ]value]]...
10
11       All arguments must be options.
12
13       tcpbridge  is a tool for selectively briding network traffic across two
14       interfaces and optionally modifying the packets in betweeen
15

DESCRIPTION

17       This manual page documents, briefly, the tcpbridge command.  The  basic
18       operation  of  tcpbridge is to be a network bridge between two subnets.
19       All packets received on one interface are sent via the other.
20
21       Optionally, packets can be edited in a variety  of  ways  according  to
22       your needs.
23
24       For  more  details,  please  see the Tcpreplay Manual at: http://tcpre
25       play.synfin.net/trac/wiki/manual
26

OPTIONS

28
29       -r string, --portmap=string
30              Rewrite TCP/UDP ports.  This option may appear up to 1 times.
31
32              Specify a list of comma delimited port mappingings consisting of
33              colon  delimited  port  number pairs.  Each colon delimited port
34              pair consists of the port to match followed by the  port  number
35              to rewrite.
36
37              Example:
38                  --portmap=80:8000,8080:80
39
40       -s number, --seed=number
41              Randomize  src/dst  IP addresses w/ given seed.  This option may
42              appear up to 1 times.  This option takes an  integer  number  as
43              its argument.
44
45              Causes the source and destination IP addresses to be pseudo ran‐
46              domized but still maintain client/server  relationships.   Since
47              the  randomization  is  deterministic based on the seed, you can
48              reuse the same seed value to recreate the traffic.
49
50       -N string, --pnat=string
51              Rewrite IP addresses using pseudo-NAT.  This option  may  appear
52              up  to 2 times.  This option must not appear in combination with
53              any of the following options: srcipmap.
54
55              Takes a comma delimited series of colon delimited CIDR  netblock
56              pairs.   Each netblock pair is evaluated in order against the IP
57              addresses.  If the IP address in the packet  matches  the  first
58              netblock,  it  is  rewriten  using the second netblock as a mask
59              against the high order bits.
60
61              Example:
62                  --pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
63
64       -S string, --srcipmap=string
65              Rewrite source IP addresses using pseudo-NAT.  This  option  may
66              appear  up  to 1 times.  This option must not appear in combina‐
67              tion with any of the following options: pnat.
68
69              Works just like the --pnat option, but only affects  the  source
70              IP addresses in the IPv4 header.
71
72       -D string, --dstipmap=string
73              Rewrite  destination IP addresses using pseudo-NAT.  This option
74              may appear up to 1 times.  This option must not appear in combi‐
75              nation with any of the following options: pnat.
76
77              Works just like the --pnat option, but only affects the destina‐
78              tion IP addresses in the IPv4 header.
79
80       -e string, --endpoints=string
81              Rewrite IP addresses to be between two endpoints.   This  option
82              may  appear  up to 1 times.  This option must appear in combina‐
83              tion with the following options: cachefile.
84
85              Takes a pair of colon delimited IP addresses which will be  used
86              to rewrite all traffic to appear to be between the two IP's.
87
88              Example:
89                  --endpoints=172.16.0.1:172.16.0.2
90
91       -b, --skipbroadcast
92              Skip rewriting broadcast/multicast IP's.
93
94              By default --seed, --pnat and --endpoints will rewrite broadcast
95              and multicast IP and MAC addresses. Setting this flag will  keep
96              broadcast/multicast IP and MAC addresses from being rewritten.
97
98       -C, --fixcsum
99              Force recalculation of IP/TCP/UDP checksums.
100
101              Causes  each  IP  packet to have it's checksums recalcualted and
102              fixed.  Automatically enabled for packets modified with  --seed,
103              --pnat, --endpoints or --fixlen.
104
105       -m number, --mtu=number
106              Override  default  MTU  length  (1500  bytes).   This option may
107              appear up to 1 times.  This option takes an  integer  number  as
108              its argument.  The value of number is constrained to being:
109                  in the range  1 through MAXPACKET
110
111              Override the default 1500 byte MTU size for determining the max‐
112              imum padding length.
113
114       -E, --efcs
115              Remove Ethernet checksums (FCS) from end of frames.
116
117              Note, this option is pretty dangerous!  We don't actually check
118              to see if a FCS actually exists in the frame, we just blindly
119              delete the last two bytes.  Hence, you should only use this if
120              you know know that your OS provides the FCS when reading raw
121              packets.
122
123       --ttl=string
124              Modify the IPv4 TTL.
125
126              Allows you to modify the TTL of all the IPv4 packets.  Specify a
127              number to hard-code the value or +/-value to increase or
128              decrease by the value provided (limited to 1-255).
129
130              Examples:
131                  --ttl=10
132                  --ttl=+7
133                  --ttl=-64
134
135       -F string, --fixlen=string
136              Pad or truncate packet data to match header length.  This option
137              may appear up to 1 times.
138
139              Packets may be truncated during capture if the snaplen is
140              smaller then the packet.  This option allows you to modify the
141              packet to pad the packet back out to the size stored in the IPv4
142              header or rewrite the IP header total length to reflect the
143              stored packet length.
144
145              pad Truncated packets will be padded out so that the packet
146              length matches the IPv4 total length
147
148              trunc Truncated packets will have their IPv4 total length field
149              rewritten to match the actual packet length
150
151              del Delete the packet
152
153       --skipl2broadcast
154              Skip rewriting broadcast/multicast Layer 2 addresses.
155
156              By default, editing Layer 2 addresses will rewrite broadcast and
157              multicast MAC addresses.   Setting this flag will keep broad‐
158              cast/multicast MAC addresses from being rewritten.
159
160       --dlt=string
161              Override output DLT encapsulation.  This option may appear up to
162              1 times.
163
164              By default, no DLT (data link type) conversion will be made.  To
165              change the DLT type of the output pcap, select one of the fol‐
166              lowing values:
167
168              enet Ethernet aka DLT_EN10MB
169
170              hdlc Cisco HDLC aka DLT_C_HDLC
171
172              user User specified Layer 2 header and DLT type
173
174       --enet-dmac=string
175              Override destination ethernet MAC addresses.  This option may
176              appear up to 1 times.
177
178              Takes a pair of comma deliminated ethernet MAC addresses which
179              will replace the destination MAC address of outbound packets.
180              The first MAC address will be used for the server to client
181              traffic and the optional second MAC address will be used for the
182              client to server traffic.
183
184              Example:
185                  --enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
186
187       --enet-smac=string
188              Override source ethernet MAC addresses.  This option may appear
189              up to 1 times.
190
191              Takes a pair of comma deliminated ethernet MAC addresses which
192              will replace the source MAC address of outbound packets.  The
193              first MAC address will be used for the server to client traffic
194              and the optional second MAC address will be used for the client
195              to server traffic.
196
197              Example:
198                  --enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
199
200       --enet-vlan=string
201              Specify ethernet 802.1q VLAN tag mode.  This option may appear
202              up to 1 times.
203
204              Allows you to rewrite ethernet frames to add a 802.1q header to
205              standard 802.3 ethernet headers or remove the 802.1q VLAN tag
206              information.
207
208              add Rewrites the existing 802.3 ethernet header as an 802.1q
209              VLAN header
210
211              del Rewrites the existing 802.1q VLAN header as an 802.3 ether‐
212              net header
213
214       --enet-vlan-tag=number
215              Specify the new ethernet 802.1q VLAN tag value.  This option may
216              appear up to 1 times.  This option must appear in combination
217              with the following options: enet-vlan.  This option takes an
218              integer number as its argument.  The value of number is con‐
219              strained to being:
220                  in the range  0 through 4095
221
222
223
224       --enet-vlan-cfi=number
225              Specify the ethernet 802.1q VLAN CFI value.  This option may
226              appear up to 1 times.  This option must appear in combination
227              with the following options: enet-vlan.  This option takes an
228              integer number as its argument.  The value of number is con‐
229              strained to being:
230                  in the range  0 through 1
231
232
233
234       --enet-vlan-pri=number
235              Specify the ethernet 802.1q VLAN priority.  This option may
236              appear up to 1 times.  This option must appear in combination
237              with the following options: enet-vlan.  This option takes an
238              integer number as its argument.  The value of number is con‐
239              strained to being:
240                  in the range  0 through 7
241
242
243
244       --hdlc-control=number
245              Specify HDLC control value.  This option may appear up to 1
246              times.  This option takes an integer number as its argument.
247
248              The Cisco HDLC header has a 1 byte "control" field.  Apparently
249              this should always be 0, but if you can use any 1 byte value.
250
251       --hdlc-address=number
252              Specify HDLC address.  This option may appear up to 1 times.
253              This option takes an integer number as its argument.
254
255              The Cisco HDLC header has a 1 byte "address" field which has two
256              valid values:
257
258              0x0F Unicast
259
260              0xBF Broadcast
261              You can however specify any single byte value.
262
263       --user-dlt=number
264              Set output file DLT type.  This option may appear up to 1 times.
265              This option takes an integer number as its argument.
266
267              Set the DLT value of the output pcap file.
268
269       --user-dlink=string
270              Rewrite Data-Link layer with user specified data.  This option
271              may appear up to 2 times.
272
273              Provide a series of comma deliminated hex values which will be
274              used to rewrite or create the Layer 2 header of the packets.
275              The first instance of this argument will rewrite both server and
276              client traffic, but if this argument is specified a second time,
277              it will be used for the client traffic.
278
279              Example:
280                  --user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
281
282       -d number, --dbug=number
283              Enable debugging output.  This option may appear up to 1 times.
284              This option takes an integer number as its argument.  The value
285              of number is constrained to being:
286                  in the range  0 through 5
287              The default number for this option is:
288                   0
289
290              If configured with --enable-debug, then you can specify a ver‐
291              bosity level for debugging output.  Higher numbers increase ver‐
292              bosity.
293
294       -i string, --intf1=string
295              Primary interface (listen in uni-directional mode).  This option
296              may appear up to 1 times.
297
298
299
300       -I string, --intf2=string
301              Secondary interface (send in uni-directional mode).  This option
302              may appear up to 1 times.
303
304
305
306       -u, --unidir
307              Send and receive in only one direction.  This option may appear
308              up to 1 times.
309
310              Normally, tcpbridge will send and receive traffic in both direc‐
311              tions (bi-directionally).  However, if you choose this option,
312              traffic will be sent uni-directionally.
313
314       -L number, --limit=number
315              Limit the number of packets to send.  This option may appear up
316              to 1 times.  This option takes an integer number as its argu‐
317              ment.  The value of number is constrained to being:
318                  greater than or equal to 1
319              The default number for this option is:
320                   -1
321
322              By default, tcpbridge will send packets forever or until Ctrl-C.
323              Alternatively, you can specify a maximum number of packets to
324              send.
325
326       -x string, --include=string
327              Include only packets matching rule.  This option may appear up
328              to 1 times.  This option must not appear in combination with any
329              of the following options: exclude.
330
331              Override default of sending all packets stored in the capture
332              file and only send packets which match the provided rule.  Rules
333              can be one of:
334
335
336              S:<CIDR1>,...  - Source IP must match specified CIDR(s)
337
338              D:<CIDR1>,...  - Destination IP must match specified CIDR(s)
339
340              B:<CIDR1>,...  - Both source and destination IP must match spec‐
341              ified CIDR(s)
342
343              E:<CIDR1>,...  - Either IP must match specified CIDR(s)
344
345              P:<LIST> - Must be one of the listed packets where the list cor‐
346              responds to the packet number in the capture file.
347                  --include=P:1-5,9,15,72-
348              would send packets 1 thru 5, the 9th and 15th packet, and pack‐
349              ets 72 until the end of the file
350
351              F:'<bpf>' - BPF filter.  See the tcpdump(8) man page for syntax.
352
353       -X string, --exclude=string
354              Exclude any packet matching this rule.  This option may appear
355              up to 1 times.  This option must not appear in combination with
356              any of the following options: include.
357
358              Override default of sending all packets stored in the capture
359              file and only send packets which do not match the provided rule.
360              Rules can be one of:
361
362
363              S:<CIDR1>,...  - Source IP must not match specified CIDR(s)
364
365              D:<CIDR1>,...  - Destination IP must not match specified CIDR(s)
366
367              B:<CIDR1>,...  - Both source and destination IP must not match
368              specified CIDR(s)
369
370              E:<CIDR1>,...  - Either IP must not match specified CIDR(s)
371
372              P:<LIST> - Must not be one of the listed packets where the list
373              corresponds to the packet number in the capture file.
374                  --exclude=P:1-5,9,15,72-
375              would drop packets 1 thru 5, the 9th and 15th packet, and pack‐
376              ets 72 until the end of the file
377
378       -P, --pid
379              Print the PID of tcpbridge at startup.
380
381
382
383       -v, --verbose
384              Print decoded packets via tcpdump to STDOUT.  This option may
385              appear up to 1 times.
386
387
388
389       -A string, --decode=string
390              Arguments passed to tcpdump decoder.  This option may appear up
391              to 1 times.  This option must appear in combination with the
392              following options: verbose.
393
394              When enabling verbose mode (-v) you may also specify one or more
395              additional  arguments to pass to tcpdump to modify the way pack‐
396              ets are decoded.  By default, -n and -l are used.   Be  sure  to
397              quote the arguments like: --verbose="-axxx" so that they are not
398              interpreted by tcpbridge.  The following arguments are vaild:
399                  [ -aAeNqRStuvxX ]
400                  [ -E spi@ipaddr algo:secret,... ]
401                  [ -s snaplen ]
402
403       -V, --version
404              Print version information.
405
406
407
408       -h, --less-help
409              Display less usage information and exit.
410
411
412
413       -H, --help
414              Display usage information and exit.
415
416       -!, --more-help
417              Extended usage information passed thru pager.
418
419       - [rcfile], --save-opts[=rcfile]
420              Save the option state to rcfile.  The default is the last con‐
421              figuration file listed in the OPTION PRESETS section, below.
422
423       - rcfile, --load-opts=rcfile, --no-load-opts
424              Load options from rcfile.  The no-load-opts form will disable
425              the loading of earlier RC/INI files.  --no-load-opts is handled
426              early, out of order.
427

OPTION PRESETS

429       Any option that is not marked as not presettable may be preset by load‐
430       ing values from configuration ("RC" or ".INI") file(s).  The homerc
431       file is "$$/", unless that is a directory.  In that case, the file
432       ".tcpbridgerc" is searched for within that directory.
433

SIGNALS

435       tcpbridge understands the following signals:
436
437       SIGUSR1 Suspend tcpbridge
438
439       SIGCONT Restart tcpbridge
440
441

SEE ALSO

443       tcpdump(1), tcpprep(1), tcprewrite(1), tcpreplay(1)
444
445

BUGS

447       tcpbridge can only send packets as fast as your computer's interface,
448       processor and system bus will allow.
449
450       Connecting both interfaces to the same subnet may create a broadcast
451       storm and take down the network.  Improper use of the packet editing
452       functions may have other undefined and possible negative consequences.
453
454       Some operating systems by default do not allow for forging source MAC
455       addresses.  Please consult your operating system's documentation and
456       the tcpreplay FAQ if you experiance this issue.
457

AUTHOR

459       Copyright 2000-2008 Aaron Turner
460
461       For support please use the tcpreplay-users@lists.sourceforge.net mail‐
462       ing list.
463
464       The latest version of this software is always available from:
465       http://tcpreplay.synfin.net/
466
467       Released under the Free BSD License.
468
469       This manual page was AutoGen-erated from the tcpbridge option defini‐
470       tions.
471
472
473
474(tcpbridge )                      2008-05-15                      TCPBRIDGE(1)
Impressum