1tcpbridge(1) User Commands tcpbridge(1)
2
3
4
6 tcpbridge - Bridge network traffic across two interfaces
7
9 tcpbridge [-flags] [-flag [value]] [--option-name[[=| ]value]]
10
11 All arguments must be options.
12
13 tcpbridge is a tool for selectively bridging network traffic across two
14 interfaces and optionally modifying the packets in between
15
17 The basic operation of tcpbridge is to be a network bridge between two
18 subnets. All packets received on one interface are sent via the other.
19
20 Optionally, packets can be edited in a variety of ways according to
21 your needs.
22
23 For more details, please see the Tcpreplay Manual at: http://tcpre‐
24 play.appneta.com
25
27
28 -r string, --portmap=string
29 Rewrite TCP/UDP ports. This option may appear up to 9999 times.
30
31 Specify a list of comma delimited port mappings consisting of
32 colon delimited port number pairs. Each colon delimited port
33 pair consists of the port to match followed by the port number
34 to rewrite.
35
36 Examples:
37 --portmap=80:8000 --portmap=8080:80 # 80->8000 and 8080->80
38 --portmap=8000,8080,88888:80 # 3 different ports become 80
39 --portmap=8000-8999:80 # ports 8000 to 8999 become 80
40
41 -s number, --seed=number
42 Randomize src/dst IPv4/v6 addresses w/ given seed. This option
43 may appear up to 1 times. This option must not appear in combi‐
44 nation with any of the following options: fuzz-seed. This
45 option takes an integer number 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 rewritten 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 IP
91 addresses.
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 --tcp-sequence=number
99 Change TCP Sequence (and ACK) numbers /w given seed. This
100 option takes an integer number as its argument. The value of
101 number is constrained to being:
102 greater than or equal to 1
103 The default number for this option is:
104 0
105
106 Change all TCP sequence numbers, and related sequence-acknowl‐
107 edgement numbers. They will be shifted by a random amount based
108 on the provided seed.
109
110 -b, --skipbroadcast
111 Skip rewriting broadcast/multicast IPv4/v6 addresses.
112
113 By default --seed, --pnat and --endpoints will rewrite broadcast
114 and multicast IPv4/v6 and MAC addresses. Setting this flag will
115 keep broadcast/multicast IPv4/v6 and MAC addresses from being
116 rewritten.
117
118 -C, --fixcsum
119 Force recalculation of IPv4/TCP/UDP header checksums.
120
121 Causes each IPv4/v6 packet to have their checksums recalculated
122 and fixed. Automatically enabled for packets modified with
123 --seed, --pnat, --endpoints or --fixlen.
124
125 -m number, --mtu=number
126 Override default MTU length (1500 bytes). This option may
127 appear up to 1 times. This option takes an integer number as
128 its argument. The value of number is constrained to being:
129 in the range 1 through MAXPACKET
130
131 Override the default 1500 byte MTU size for determining the max‐
132 imum padding length (--fixlen=pad) or when truncating (--mtu-
133 trunc).
134
135 --mtu-trunc
136 Truncate packets larger then specified MTU. This option may
137 appear up to 1 times.
138
139 Similar to --fixlen, this option will truncate data in packets
140 from Layer 3 and above to be no larger then the MTU.
141
142 -E, --efcs
143 Remove Ethernet checksums (FCS) from end of frames.
144
145 Note, this option is pretty dangerous! We do not actually check
146 to see if a FCS actually exists in the frame, we just blindly
147 delete the last 4 bytes. Hence, you should only use this if you
148 know know that your OS provides the FCS when reading raw pack‐
149 ets.
150
151 --ttl=string
152 Modify the IPv4/v6 TTL/Hop Limit.
153
154 Allows you to modify the TTL/Hop Limit of all the IPv4/v6 pack‐
155 ets. Specify a number to hard-code the value or +/-value to
156 increase or decrease by the value provided (limited to 1-255).
157
158 Examples:
159 --ttl=10
160 --ttl=+7
161 --ttl=-64
162
163 --tos=number
164 Set the IPv4 TOS/DiffServ/ECN byte. This option may appear up
165 to 1 times. This option takes an integer number as its argu‐
166 ment. The value of number is constrained to being:
167 in the range 0 through 255
168
169 Allows you to override the TOS (also known as DiffServ/ECN)
170 value in IPv4.
171
172 --tclass=number
173 Set the IPv6 Traffic Class byte. This option may appear up to 1
174 times. This option takes an integer number as its argument.
175 The value of number is constrained to being:
176 in the range 0 through 255
177
178 Allows you to override the IPv6 Traffic Class field.
179
180 --flowlabel=number
181 Set the IPv6 Flow Label. This option may appear up to 1 times.
182 This option takes an integer number as its argument. The value
183 of number is constrained to being:
184 in the range 0 through 1048575
185
186 Allows you to override the 20bit IPv6 Flow Label field. Has no
187 effect on IPv4 packets.
188
189 -F string, --fixlen=string
190 Pad or truncate packet data to match header length. This option
191 may appear up to 1 times.
192
193 Packets may be truncated during capture if the snaplen is
194 smaller then the packet. This option allows you to modify the
195 packet to pad the packet back out to the size stored in the
196 IPv4/v6 header or rewrite the IP header total length to reflect
197 the stored packet length.
198
199 pad Truncated packets will be padded out so that the packet
200 length matches the IPv4 total length
201
202 trunc Truncated packets will have their IPv4 total length field
203 rewritten to match the actual packet length
204
205 del Delete the packet
206
207 --fuzz-seed=number
208 Fuzz 1 in X packets. Edit bytes, length, or emulate packet drop.
209 This option takes an integer number as its argument. The value
210 of number is constrained to being:
211 greater than or equal to 0
212 The default number for this option is:
213 0
214
215 This fuzzing was designed as to test layer 7 protocols such as
216 voip protocols. It modifies randomly 1 out of X packets (where
217 X = --fuzz-factor) in order for stateful protocols to cover more
218 of their code. The random fuzzing actions focus on data start
219 and end because it often is the part of the data application
220 protocols base their decisions on.
221
222 Possible fuzzing actions list:
223 * drop packet
224 * reduce packet size
225 * edit packet Bytes:
226 * Not all Bytes have the same probability of appearance in
227 real life.
228 Replace with 0x00, 0xFF, or a random byte with equal like‐
229 lihood.
230 * Not all Bytes have the same significance in a packet.
231 Replace the start, the end, or the middle of the packet
232 with equal likelihood.
233 * do nothing (7 out of 8 packets)
234
235 --fuzz-factor=number
236 Set the Fuzz 1 in X packet ratio (default 1 in 8 packets). This
237 option must appear in combination with the following options:
238 fuzz-seed. This option takes an integer number as its argument.
239 The value of number is constrained to being:
240 greater than or equal to 1
241 The default number for this option is:
242 8
243
244 Sets the ratio of for --fuzz-seed option. By default this value
245 is 8, which means 1 in 8 packets are modified by fuzzing. Note
246 that this ratio is based on the random number generated by the
247 supplied fuzz seed. Therefore by default you cannot expect that
248 exactly every eighth packet will be modified.
249
250 --skipl2broadcast
251 Skip rewriting broadcast/multicast Layer 2 addresses.
252
253 By default, editing Layer 2 addresses will rewrite broadcast and
254 multicast MAC addresses. Setting this flag will keep broad‐
255 cast/multicast MAC addresses from being rewritten.
256
257 --dlt=string
258 Override output DLT encapsulation. This option may appear up to
259 1 times.
260
261 By default, no DLT (data link type) conversion will be made. To
262 change the DLT type of the output pcap, select one of the fol‐
263 lowing values:
264
265 enet Ethernet aka DLT_EN10MB
266
267 hdlc Cisco HDLC aka DLT_C_HDLC
268
269 jnpr_ether Juniper Ethernet DLT_C_JNPR_ETHER
270
271 pppserial PPP Serial aka DLT_PPP_SERIAL
272
273 user User specified Layer 2 header and DLT type
274
275 --enet-dmac=string
276 Override destination ethernet MAC addresses. This option may
277 appear up to 1 times.
278
279 Takes a pair of comma deliminated ethernet MAC addresses which
280 will replace the destination MAC address of outbound packets.
281 The first MAC address will be used for the server to client
282 traffic and the optional second MAC address will be used for the
283 client to server traffic.
284
285 Example:
286 --enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
287
288 --enet-smac=string
289 Override source ethernet MAC addresses. This option may appear
290 up to 1 times.
291
292 Takes a pair of comma deliminated ethernet MAC addresses which
293 will replace the source MAC address of outbound packets. The
294 first MAC address will be used for the server to client traffic
295 and the optional second MAC address will be used for the client
296 to server traffic.
297
298 Example:
299 --enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
300
301 --enet-subsmac=string
302 Substitute MAC addresses. This option may appear up to 9999
303 times.
304
305 Allows you to rewrite ethernet MAC addresses of packets. It
306 takes comma delimited pair or MACs address and rewrites all
307 occurrences of the first MAC with the value of the second MAC.
308 Example:
309 --enet-subsmac=00:12:13:14:15:16,00:22:33:44:55:66
310
311 --enet-mac-seed=number
312 Randomize MAC addresses. This option may appear up to 1 times.
313 This option must not appear in combination with any of the fol‐
314 lowing options: enet-smac, enet-dmac, enet-subsmac. This option
315 takes an integer number as its argument.
316
317 Allows you to randomize ethernet MAC addresses of packets,
318 mostly like what --seed option does for IPv4/IPv6 addresses.
319
320 --enet-mac-seed-keep-bytes=number
321 Randomize MAC addresses. This option may appear up to 1 times.
322 This option must appear in combination with the following
323 options: enet-mac-seed. This option takes an integer number as
324 its argument. The value of number is constrained to being:
325 in the range 1 through 6
326
327 Keep some bytes untouched when usinging --enet-mac-seed option.
328
329 --enet-vlan=string
330 Specify ethernet 802.1q VLAN tag mode. This option may appear
331 up to 1 times.
332
333 Allows you to rewrite ethernet frames to add a 802.1q header to
334 standard 802.3 ethernet headers or remove the 802.1q VLAN tag
335 information.
336
337 add Rewrites the existing 802.3 ethernet header as an 802.1q
338 VLAN header
339
340 del Rewrites the existing 802.1q VLAN header as an 802.3 ether‐
341 net header
342
343 --enet-vlan-tag=number
344 Specify the new ethernet 802.1q VLAN tag value. This option may
345 appear up to 1 times. This option must appear in combination
346 with the following options: enet-vlan. This option takes an
347 integer number as its argument. The value of number is con‐
348 strained to being:
349 in the range 0 through 4095
350
351
352 --enet-vlan-cfi=number
353 Specify the ethernet 802.1q VLAN CFI value. This option may
354 appear up to 1 times. This option must appear in combination
355 with the following options: enet-vlan. This option takes an
356 integer number as its argument. The value of number is con‐
357 strained to being:
358 in the range 0 through 1
359
360
361 --enet-vlan-pri=number
362 Specify the ethernet 802.1q VLAN priority. This option may
363 appear up to 1 times. This option must appear in combination
364 with the following options: enet-vlan. This option takes an
365 integer number as its argument. The value of number is con‐
366 strained to being:
367 in the range 0 through 7
368
369
370 --hdlc-control=number
371 Specify HDLC control value. This option may appear up to 1
372 times. This option takes an integer number as its argument.
373
374 The Cisco HDLC header has a 1 byte "control" field. Apparently
375 this should always be 0, but if you can use any 1 byte value.
376
377 --hdlc-address=number
378 Specify HDLC address. This option may appear up to 1 times.
379 This option takes an integer number as its argument.
380
381 The Cisco HDLC header has a 1 byte "address" field which has two
382 valid values:
383
384 0x0F Unicast
385
386 0xBF Broadcast
387 You can however specify any single byte value.
388
389 --user-dlt=number
390 Set output file DLT type. This option may appear up to 1 times.
391 This option takes an integer number as its argument.
392
393 Set the DLT value of the output pcap file.
394
395 --user-dlink=string
396 Rewrite Data-Link layer with user specified data. This option
397 may appear up to 2 times.
398
399 Provide a series of comma deliminated hex values which will be
400 used to rewrite or create the Layer 2 header of the packets.
401 The first instance of this argument will rewrite both server and
402 client traffic, but if this argument is specified a second time,
403 it will be used for the client traffic.
404
405 Example:
406 --user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
407
408 -d number, --dbug=number
409 Enable debugging output. This option may appear up to 1 times.
410 This option takes an integer number as its argument. The value
411 of number is constrained to being:
412 in the range 0 through 5
413 The default number for this option is:
414 0
415
416 If configured with --enable-debug, then you can specify a ver‐
417 bosity level for debugging output. Higher numbers increase ver‐
418 bosity.
419
420 -i string, --intf1=string
421 Primary interface (listen in uni-directional mode). This option
422 may appear up to 1 times.
423
424
425 -I string, --intf2=string
426 Secondary interface (send in uni-directional mode). This option
427 may appear up to 1 times.
428
429
430 -u, --unidir
431 Send and receive in only one direction. This option may appear
432 up to 1 times.
433
434 Normally, tcpbridge will send and receive traffic in both direc‐
435 tions (bi-directionally). However, if you choose this option,
436 traffic will be sent uni-directionally.
437
438 --listnics
439 List available network interfaces and exit.
440
441
442 -L number, --limit=number
443 Limit the number of packets to send. This option may appear up
444 to 1 times. This option takes an integer number as its argu‐
445 ment. The value of number is constrained to being:
446 greater than or equal to 1
447 The default number for this option is:
448 -1
449
450 By default, tcpbridge will send packets forever or until Ctrl-C.
451 Alternatively, you can specify a maximum number of packets to
452 send.
453
454 -M string, --mac=string
455 MAC addresses of local NIC's. This option may appear up to 2
456 times.
457
458 tcpbridge does not support detecting the MAC addresses of the
459 local network interfaces under Windows. Please specify both MAC
460 addresses of the interfaces used in the bridge: -M <intf1 mac>
461 -M <intf2 mac>
462
463 -x string, --include=string
464 Include only packets matching rule. This option may appear up
465 to 1 times. This option must not appear in combination with any
466 of the following options: exclude.
467
468 Override default of sending all packets stored in the capture
469 file and only send packets which match the provided rule. Rules
470 can be one of:
471
472
473 S:<CIDR1>,... - Source IP must match specified CIDR(s)
474
475 D:<CIDR1>,... - Destination IP must match specified CIDR(s)
476
477 B:<CIDR1>,... - Both source and destination IP must match spec‐
478 ified CIDR(s)
479
480 E:<CIDR1>,... - Either IP must match specified CIDR(s)
481
482 P:<LIST> - Must be one of the listed packets where the list cor‐
483 responds to the packet number in the capture file.
484 --include=P:1-5,9,15,72-
485 would send packets 1 through 5, the 9th and 15th packet, and
486 packets 72 until the end of the file
487
488 F:'<bpf>' - BPF filter. See the tcpdump(8) man page for syntax.
489
490 -X string, --exclude=string
491 Exclude any packet matching this rule. This option may appear
492 up to 1 times. This option must not appear in combination with
493 any of the following options: include.
494
495 Override default of sending all packets stored in the capture
496 file and only send packets which do not match the provided rule.
497 Rules can be one of:
498
499
500 S:<CIDR1>,... - Source IP must not match specified CIDR(s)
501
502 D:<CIDR1>,... - Destination IP must not match specified CIDR(s)
503
504 B:<CIDR1>,... - Both source and destination IP must not match
505 specified CIDR(s)
506
507 E:<CIDR1>,... - Either IP must not match specified CIDR(s)
508
509 P:<LIST> - Must not be one of the listed packets where the list
510 corresponds to the packet number in the capture file.
511 --exclude=P:1-5,9,15,72-
512 would drop packets 1 through 5, the 9th and 15th packet, and
513 packets 72 until the end of the file
514
515 -P, --pid
516 Print the PID of tcpbridge at startup.
517
518
519 -v, --verbose
520 Print decoded packets via tcpdump to STDOUT. This option may
521 appear up to 1 times.
522
523
524 -A string, --decode=string
525 Arguments passed to tcpdump decoder. This option may appear up
526 to 1 times. This option must appear in combination with the
527 following options: verbose.
528
529 When enabling verbose mode (-v) you may also specify one or more
530 additional arguments to pass to tcpdump to modify the way pack‐
531 ets are decoded. By default, -n and -l are used. Be sure to
532 quote the arguments like: --verbose="-axxx" so that they are not
533 interpreted by tcpbridge. The following arguments are valid:
534 [ -aAeNqRStuvxX ]
535 [ -E spi@ipaddr algo:secret,... ]
536 [ -s snaplen ]
537
538 -V, --version
539 Print version information.
540
541
542 -h, --less-help
543 Display less usage information and exit.
544
545
546 -H, --help
547 Display usage information and exit.
548
549 -!, --more-help
550 Pass the extended usage information through a pager.
551
552 --save-opts [=cfgfile]
553 Save the option state to cfgfile. The default is the last con‐
554 figuration file listed in the OPTION PRESETS section, below.
555 The command will exit after updating the config file.
556
557 --load-opts=cfgfile, --no-load-opts
558 Load options from cfgfile. The no-load-opts form will disable
559 the loading of earlier config/rc/ini files. --no-load-opts is
560 handled early, out of order.
561
563 Any option that is not marked as not presettable may be preset by load‐
564 ing values from configuration ("RC" or ".INI") file(s). The homerc
565 file is "$$/", unless that is a directory. In that case, the file
566 ".tcpbridgerc" is searched for within that directory.
567
569 See OPTION PRESETS for configuration files.
570
572 One of the following exit values will be returned:
573
574 0 (EXIT_SUCCESS)
575 Successful program execution.
576
577 1 (EXIT_FAILURE)
578 The operation failed or the command syntax was not valid.
579
580 66 (EX_NOINPUT)
581 A specified configuration file could not be loaded.
582
583 70 (EX_SOFTWARE)
584 libopts had an internal operational error. Please report it to
585 autogen-users@lists.sourceforge.net. Thank you.
586
588 Copyright 2013-2018 Fred Klassen - AppNeta Copyright 2000-2012 Aaron
589 Turner For support please use the tcpreplay-users@lists.sourceforge.net
590 mailing list. The latest version of this software is always available
591 from: http://tcpreplay.appneta.com/
592
594 Copyright (C) 2000-2018 Aaron Turner and Fred Klassen all rights
595 reserved. This program is released under the terms of the GNU General
596 Public License, version 3 or later.
597
599 Please send bug reports to: tcpreplay-users@lists.sourceforge.net
600
602 This manual page was AutoGen-erated from the tcpbridge option defini‐
603 tions.
604
605
606
607tcpbridge 12 Mar 2019 tcpbridge(1)