1TCPBRIDGE(1) Programmer's Manual TCPBRIDGE(1)
2
3
4
6 tcpbridge - Bridge network traffic across two interfaces
7
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
17 This manual page briefly documents 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
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 Examples:
38 --portmap=80:8000 --portmap=8080:80 # 80->8000 and 8080->80
39 --portmap=8000,8080,88888:80 # 3 different ports become 80
40 --portmap=8000-8999:80 # ports 8000 to 8999 become 80
41
42 -s number, --seed=number
43 Randomize src/dst IPv4/v6 addresses w/ given seed. This option
44 may appear up to 1 times. This option takes an integer number
45 as its argument.
46
47 Causes the source and destination IPv4/v6 addresses to be pseudo
48 randomized but still maintain client/server relationships.
49 Since the randomization is deterministic based on the seed, you
50 can reuse the same seed value to recreate the traffic.
51
52 -N string, --pnat=string
53 Rewrite IPv4/v6 addresses using pseudo-NAT. This option may
54 appear up to 2 times. This option must not appear in combina‐
55 tion with any of the following options: srcipmap.
56
57 Takes a comma delimited series of colon delimited CIDR netblock
58 pairs. Each netblock pair is evaluated in order against the IP
59 addresses. If the IP address in the packet matches the first
60 netblock, it is rewriten using the second netblock as a mask
61 against the high order bits.
62
63 IPv4 Example:
64 --pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
65 IPv6 Example:
66 --pnat=[2001:db8::/32]:[dead::/16],[2001:db8::/32]:[::ffff:0:0/96]
67
68 -S string, --srcipmap=string
69 Rewrite source IPv4/v6 addresses using pseudo-NAT. This option
70 may appear up to 1 times. This option must not appear in combi‐
71 nation with any of the following options: pnat.
72
73 Works just like the --pnat option, but only affects the source
74 IP addresses in the IPv4/v6 header.
75
76 -D string, --dstipmap=string
77 Rewrite destination IPv4/v6 addresses using pseudo-NAT. This
78 option may appear up to 1 times. This option must not appear in
79 combination with any of the following options: pnat.
80
81 Works just like the --pnat option, but only affects the destina‐
82 tion IP addresses in the IPv4/v6 header.
83
84 -e string, --endpoints=string
85 Rewrite IP addresses to be between two endpoints. This option
86 may appear up to 1 times. This option must appear in combina‐
87 tion with the following options: cachefile.
88
89 Takes a pair of colon delimited IPv4/v6 addresses which will be
90 used to rewrite all traffic to appear to be between the two
91 IP's.
92
93 IPv4 Example:
94 --endpoints=172.16.0.1:172.16.0.2
95 IPv6 Example:
96 --endpoints=[2001:db8::dead:beef]:[::ffff:0:0:ac:f:0:2]
97
98
99 -b, --skipbroadcast
100 Skip rewriting broadcast/multicast IPv4/v6 addresses.
101
102 By default --seed, --pnat and --endpoints will rewrite broadcast
103 and multicast IPv4/v6 and MAC addresses. Setting this flag will
104 keep broadcast/multicast IPv4/v6 and MAC addresses from being
105 rewritten.
106
107 -C, --fixcsum
108 Force recalculation of IPv4/TCP/UDP header checksums.
109
110 Causes each IPv4/v6 packet to have it's checksums recalcualted
111 and fixed. Automatically enabled for packets modified with
112 --seed, --pnat, --endpoints or --fixlen.
113
114 -m number, --mtu=number
115 Override default MTU length (1500 bytes). This option may
116 appear up to 1 times. This option takes an integer number as
117 its argument. The value of number is constrained to being:
118 in the range 1 through MAXPACKET
119
120 Override the default 1500 byte MTU size for determining the max‐
121 imum padding length (--fixlen=pad) or when truncating (--mtu-
122 trunc).
123
124 --mtu-trunc
125 Truncate packets larger then specified MTU. This option may
126 appear up to 1 times.
127
128 Similar to --fixlen, this option will truncate data in packets
129 from Layer 3 and above to be no larger then the MTU.
130
131 -E, --efcs
132 Remove Ethernet checksums (FCS) from end of frames.
133
134 Note, this option is pretty dangerous! We don't actually check
135 to see if a FCS actually exists in the frame, we just blindly
136 delete the last two bytes. Hence, you should only use this if
137 you know know that your OS provides the FCS when reading raw
138 packets.
139
140 --ttl=string
141 Modify the IPv4/v6 TTL/Hop Limit.
142
143 Allows you to modify the TTL/Hop Limit of all the IPv4/v6 pack‐
144 ets. Specify a number to hard-code the value or +/-value to
145 increase or decrease by the value provided (limited to 1-255).
146
147 Examples:
148 --ttl=10
149 --ttl=+7
150 --ttl=-64
151
152 --tos=number
153 Set the IPv4 TOS/DiffServ/ECN byte. This option may appear up
154 to 1 times. This option takes an integer number as its argu‐
155 ment. The value of number is constrained to being:
156 in the range 0 through 255
157
158 Allows you to override the TOS (also known as DiffServ/ECN)
159 value in IPv4.
160
161 --tclass=number
162 Set the IPv6 Traffic Class byte. This option may appear up to 1
163 times. This option takes an integer number as its argument.
164 The value of number is constrained to being:
165 in the range 0 through 255
166
167 Allows you to override the IPv6 Traffic Class field.
168
169 --flowlabel=number
170 Set the IPv6 Flow Label. This option may appear up to 1 times.
171 This option takes an integer number as its argument. The value
172 of number is constrained to being:
173 in the range 0 through 1048575
174
175 Allows you to override the 20bit IPv6 Flow Label field. Has no
176 effect on IPv4 packets.
177
178 -F string, --fixlen=string
179 Pad or truncate packet data to match header length. This option
180 may appear up to 1 times.
181
182 Packets may be truncated during capture if the snaplen is
183 smaller then the packet. This option allows you to modify the
184 packet to pad the packet back out to the size stored in the
185 IPv4/v6 header or rewrite the IP header total length to reflect
186 the stored packet length.
187
188 pad Truncated packets will be padded out so that the packet
189 length matches the IPv4 total length
190
191 trunc Truncated packets will have their IPv4 total length field
192 rewritten to match the actual packet length
193
194 del Delete the packet
195
196 --skipl2broadcast
197 Skip rewriting broadcast/multicast Layer 2 addresses.
198
199 By default, editing Layer 2 addresses will rewrite broadcast and
200 multicast MAC addresses. Setting this flag will keep broad‐
201 cast/multicast MAC addresses from being rewritten.
202
203 --dlt=string
204 Override output DLT encapsulation. This option may appear up to
205 1 times.
206
207 By default, no DLT (data link type) conversion will be made. To
208 change the DLT type of the output pcap, select one of the fol‐
209 lowing values:
210
211 enet Ethernet aka DLT_EN10MB
212
213 hdlc Cisco HDLC aka DLT_C_HDLC
214
215 user User specified Layer 2 header and DLT type
216
217 --enet-dmac=string
218 Override destination ethernet MAC addresses. This option may
219 appear up to 1 times.
220
221 Takes a pair of comma deliminated ethernet MAC addresses which
222 will replace the destination MAC address of outbound packets.
223 The first MAC address will be used for the server to client
224 traffic and the optional second MAC address will be used for the
225 client to server traffic.
226
227 Example:
228 --enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
229
230 --enet-smac=string
231 Override source ethernet MAC addresses. This option may appear
232 up to 1 times.
233
234 Takes a pair of comma deliminated ethernet MAC addresses which
235 will replace the source MAC address of outbound packets. The
236 first MAC address will be used for the server to client traffic
237 and the optional second MAC address will be used for the client
238 to server traffic.
239
240 Example:
241 --enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
242
243 --enet-vlan=string
244 Specify ethernet 802.1q VLAN tag mode. This option may appear
245 up to 1 times.
246
247 Allows you to rewrite ethernet frames to add a 802.1q header to
248 standard 802.3 ethernet headers or remove the 802.1q VLAN tag
249 information.
250
251 add Rewrites the existing 802.3 ethernet header as an 802.1q
252 VLAN header
253
254 del Rewrites the existing 802.1q VLAN header as an 802.3 ether‐
255 net header
256
257 --enet-vlan-tag=number
258 Specify the new ethernet 802.1q VLAN tag value. This option may
259 appear up to 1 times. This option must appear in combination
260 with the following options: enet-vlan. This option takes an
261 integer number as its argument. The value of number is con‐
262 strained to being:
263 in the range 0 through 4095
264
265
266
267 --enet-vlan-cfi=number
268 Specify the ethernet 802.1q VLAN CFI value. This option may
269 appear up to 1 times. This option must appear in combination
270 with the following options: enet-vlan. This option takes an
271 integer number as its argument. The value of number is con‐
272 strained to being:
273 in the range 0 through 1
274
275
276
277 --enet-vlan-pri=number
278 Specify the ethernet 802.1q VLAN priority. This option may
279 appear up to 1 times. This option must appear in combination
280 with the following options: enet-vlan. This option takes an
281 integer number as its argument. The value of number is con‐
282 strained to being:
283 in the range 0 through 7
284
285
286
287 --hdlc-control=number
288 Specify HDLC control value. This option may appear up to 1
289 times. This option takes an integer number as its argument.
290
291 The Cisco HDLC header has a 1 byte "control" field. Apparently
292 this should always be 0, but if you can use any 1 byte value.
293
294 --hdlc-address=number
295 Specify HDLC address. This option may appear up to 1 times.
296 This option takes an integer number as its argument.
297
298 The Cisco HDLC header has a 1 byte "address" field which has two
299 valid values:
300
301 0x0F Unicast
302
303 0xBF Broadcast
304 You can however specify any single byte value.
305
306 --user-dlt=number
307 Set output file DLT type. This option may appear up to 1 times.
308 This option takes an integer number as its argument.
309
310 Set the DLT value of the output pcap file.
311
312 --user-dlink=string
313 Rewrite Data-Link layer with user specified data. This option
314 may appear up to 2 times.
315
316 Provide a series of comma deliminated hex values which will be
317 used to rewrite or create the Layer 2 header of the packets.
318 The first instance of this argument will rewrite both server and
319 client traffic, but if this argument is specified a second time,
320 it will be used for the client traffic.
321
322 Example:
323 --user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
324
325 -d number, --dbug=number
326 Enable debugging output. This option may appear up to 1 times.
327 This option takes an integer number as its argument. The value
328 of number is constrained to being:
329 in the range 0 through 5
330 The default number for this option is:
331 0
332
333 If configured with --enable-debug, then you can specify a ver‐
334 bosity level for debugging output. Higher numbers increase ver‐
335 bosity.
336
337 -i string, --intf1=string
338 Primary interface (listen in uni-directional mode). This option
339 may appear up to 1 times.
340
341
342
343 -I string, --intf2=string
344 Secondary interface (send in uni-directional mode). This option
345 may appear up to 1 times.
346
347
348
349 -u, --unidir
350 Send and receive in only one direction. This option may appear
351 up to 1 times.
352
353 Normally, tcpbridge will send and receive traffic in both direc‐
354 tions (bi-directionally). However, if you choose this option,
355 traffic will be sent uni-directionally.
356
357 --listnics
358 List available network interfaces and exit.
359
360
361
362 -L number, --limit=number
363 Limit the number of packets to send. This option may appear up
364 to 1 times. This option takes an integer number as its argu‐
365 ment. The value of number is constrained to being:
366 greater than or equal to 1
367 The default number for this option is:
368 -1
369
370 By default, tcpbridge will send packets forever or until Ctrl-C.
371 Alternatively, you can specify a maximum number of packets to
372 send.
373
374 -M string, --mac=string
375 MAC addresses of local NIC's. This option may appear up to 2
376 times.
377
378 tcpbridge does not support detecting the MAC addresses of the
379 local network interfaces under Windows. Please specify both MAC
380 addresses of the interfaces used in the bridge: -M <intf1 mac>
381 -M <intf2 mac>
382
383 -x string, --include=string
384 Include only packets matching rule. This option may appear up
385 to 1 times. This option must not appear in combination with any
386 of the following options: exclude.
387
388 Override default of sending all packets stored in the capture
389 file and only send packets which match the provided rule. Rules
390 can be one of:
391
392
393 S:<CIDR1>,... - Source IP must match specified CIDR(s)
394
395 D:<CIDR1>,... - Destination IP must match specified CIDR(s)
396
397 B:<CIDR1>,... - Both source and destination IP must match spec‐
398 ified CIDR(s)
399
400 E:<CIDR1>,... - Either IP must match specified CIDR(s)
401
402 P:<LIST> - Must be one of the listed packets where the list cor‐
403 responds to the packet number in the capture file.
404 --include=P:1-5,9,15,72-
405 would send packets 1 thru 5, the 9th and 15th packet, and pack‐
406 ets 72 until the end of the file
407
408 F:'<bpf>' - BPF filter. See the tcpdump(8) man page for syntax.
409
410 -X string, --exclude=string
411 Exclude any packet matching this rule. This option may appear
412 up to 1 times. This option must not appear in combination with
413 any of the following options: include.
414
415 Override default of sending all packets stored in the capture
416 file and only send packets which do not match the provided rule.
417 Rules can be one of:
418
419
420 S:<CIDR1>,... - Source IP must not match specified CIDR(s)
421
422 D:<CIDR1>,... - Destination IP must not match specified CIDR(s)
423
424 B:<CIDR1>,... - Both source and destination IP must not match
425 specified CIDR(s)
426
427 E:<CIDR1>,... - Either IP must not match specified CIDR(s)
428
429 P:<LIST> - Must not be one of the listed packets where the list
430 corresponds to the packet number in the capture file.
431 --exclude=P:1-5,9,15,72-
432 would drop packets 1 thru 5, the 9th and 15th packet, and pack‐
433 ets 72 until the end of the file
434
435 -P, --pid
436 Print the PID of tcpbridge at startup.
437
438
439
440 -v, --verbose
441 Print decoded packets via tcpdump to STDOUT. This option may
442 appear up to 1 times.
443
444
445
446 -A string, --decode=string
447 Arguments passed to tcpdump decoder. This option may appear up
448 to 1 times. This option must appear in combination with the
449 following options: verbose.
450
451 When enabling verbose mode (-v) you may also specify one or more
452 additional arguments to pass to tcpdump to modify the way pack‐
453 ets are decoded. By default, -n and -l are used. Be sure to
454 quote the arguments like: --verbose="-axxx" so that they are not
455 interpreted by tcpbridge. The following arguments are vaild:
456 [ -aAeNqRStuvxX ]
457 [ -E spi@ipaddr algo:secret,... ]
458 [ -s snaplen ]
459
460 -V, --version
461 Print version information.
462
463
464
465 -h, --less-help
466 Display less usage information and exit.
467
468
469
470 -H, --help
471 Display usage information and exit.
472
473 -!, --more-help
474 Extended usage information passed thru pager.
475
476 - [rcfile], --save-opts[=rcfile]
477 Save the option state to rcfile. The default is the last con‐
478 figuration file listed in the OPTION PRESETS section, below.
479
480 - rcfile, --load-opts=rcfile, --no-load-opts
481 Load options from rcfile. The no-load-opts form will disable
482 the loading of earlier RC/INI files. --no-load-opts is handled
483 early, out of order.
484
486 Any option that is not marked as not presettable may be preset by load‐
487 ing values from configuration ("RC" or ".INI") file(s). The homerc
488 file is "$$/", unless that is a directory. In that case, the file
489 ".tcpbridgerc" is searched for within that directory.
490
492 tcpbridge understands the following signals:
493
494 SIGUSR1 Suspend tcpbridge
495
496 SIGCONT Restart tcpbridge
497
498
500 tcpdump(1), tcpprep(1), tcprewrite(1), tcpreplay(1)
501
502
504 tcpbridge can only send packets as fast as your computer's interface,
505 processor and system bus will allow.
506
507 Connecting both interfaces to the same subnet may create a broadcast
508 storm and take down the network. Improper use of the packet editing
509 functions may have other undefined and possible negative consequences.
510
511 Some operating systems by default do not allow for forging source MAC
512 addresses. Please consult your operating system's documentation and
513 the tcpreplay FAQ if you experiance this issue.
514
516 Copyright 2000-2010 Aaron Turner
517
518 For support please use the tcpreplay-users@lists.sourceforge.net mail‐
519 ing list.
520
521 The latest version of this software is always available from:
522 http://tcpreplay.synfin.net/
523
524 Released under the Free BSD License.
525
526 This manual page was AutoGen-erated from the tcpbridge option defini‐
527 tions.
528
529
530
531(tcpbridge ) 2010-04-04 TCPBRIDGE(1)