TCPBRIDGE(1)
π TCPBRIDGE(1) β the tcpreplay suite's lil bridge baddie π
okay bestie, listen. this is tcpbridge, part of the Tcpreplay Suite, and she's giving network bridge energy. sit down, grab a strawberry, we're doing this. π
β¨ NAME β¨
tcpbridge β bridge network traffic across two interfaces π¦
πΈ SYNOPSIS πΈ
tcpbridge [OPTION]...
π DESCRIPTION π
so tcpbridge is a tool for selectively bridging network traffic across two interfaces, and optionally modifying the packets in between. yes she does both. main character behavior fr. π
the basic operation of tcpbridge is to be a network bridge between two subnets. all packets received on one interface are sent via the other. that's it. that's the whole vibe.
optionally, packets can be edited in a variety of ways according to your needs. lowkey that's where it gets fun.
for more details, please see the Tcpreplay Manual at: http://tcpreplay.appneta.com
β¨ OPTIONS β¨
-r,--portmap=stringβ rewrite TCP/UDP ports. may appear up to 9999 times. no cap, that many.
specify a list of comma delimited port mappings consisting of colon delimited port number pairs. each colon delimited port pair consists of the port to match followed by the port number to rewrite.
examples:
--portmap=80:8000 --portmap=8080:80 # 80->8000 and 8080->80
--portmap=8000,8080,88888:80 # 3 different ports become 80
--portmap=8000-8999:80 # ports 8000 to 8999 become 80
-s,--seed=numberβ randomize src/dst IPv4/v6 addresses w/ given seed. cannot be combined with:--fuzz-seed.
causes the source and destination IPv4/v6 addresses to be pseudo randomized but still maintain client/server relationships. and because the randomization is deterministic based on the seed, you can reuse the same seed value to recreate the traffic. it's giving reproducible chaos. π
-N,--pnat=stringβ rewrite IPv4/v6 addresses using pseudo-NAT. may appear up to 2 times. cannot be combined with:--srcipmap.
takes a comma delimited series of colon delimited CIDR netblock pairs. each netblock pair is evaluated in order against the IP addresses. if the IP address in the packet matches the first netblock, it is rewritten using the second netblock as a mask against the high order bits. slay.
IPv4 example:
--pnat=192.168.0.0/16:10.77.0.0/16,172.16.0.0/12:10.1.0.0/24
IPv6 example:
--pnat=[2001:db8::/32]:[dead::/16],[2001:db8::/32]:[::ffff:0:0/96]
-S,--srcipmap=stringβ rewrite source IPv4/v6 addresses using pseudo-NAT. cannot be combined with:--pnat.
works just like the --pnat option, but only affects the source IP addresses in the IPv4/v6 header. she's selective. π
-D,--dstipmap=stringβ rewrite destination IPv4/v6 addresses using pseudo-NAT. cannot be combined with:--pnat.
works just like the --pnat option, but only affects the destination IP addresses in the IPv4/v6 header.
-e,--endpoints=stringβ rewrite IP addresses to be between two endpoints. requires:--cachefile.
takes a pair of colon delimited IPv4/v6 addresses which will be used to rewrite all traffic to appear to be between the two IP addresses.
IPv4 example:
--endpoints=172.16.0.1:172.16.0.2
IPv6 example:
--endpoints=[2001:db8::dead:beef]:[::ffff:0:0:ac:f:0:2]
--tcp-sequence=numberβ change TCP Sequence (and ACK) numbers /w given seed. range: 1 to any. default: 0.
change all TCP sequence numbers, and related sequence-acknowledgement numbers. they will be shifted by a random amount based on the provided seed. iconic.
-b,--skipbroadcastβ skip rewriting broadcast/multicast IPv4/v6 addresses.
by default --seed, --pnat and --endpoints will rewrite broadcast and multicast IPv4/v6 and MAC addresses. setting this flag will keep broadcast/multicast IPv4/v6 and MAC addresses from being rewritten. protecting the broadcast girlies fr. π«Ά
-C,--fixcsumβ force recalculation of IPv4/TCP/UDP header checksums.
causes each IPv4/v6 packet to have their checksums recalculated and fixed. automatically enabled for packets modified with --seed, --pnat, --endpoints or --fixlen.
--fixhdrlenβ alter IP/TCP header len to match packet length.
by default, tcpreplay will send packets with the original packet length. however, you may want the packet length revised to minimum packet size. using this option, tcpreplay will rewrite (fix) the packet length, and recalculate checksums when packet length changes.
β οΈ caution: undesired packet changes may occur when this option is specified. like, she WILL mess with your packets bestie. be aware. π
-m,--mtu=numberβ override default MTU length (1500 bytes). range: 1 toMAX_SNAPLEN.
override the default 1500 byte MTU size for determining the maximum padding length (--fixlen=pad) or when truncating (--mtu-trunc).
--mtu-truncβ truncate packets larger then specified MTU.
similar to --fixlen, this option will truncate data in packets from Layer 3 and above to be no larger then the MTU.
-E,--efcsβ remove Ethernet checksums (FCS) from end of frames.
π note, this option is pretty dangerous! we do not actually check to see if a FCS actually exists in the frame, we just blindly delete the last 4 bytes. hence, you should only use this if you know know that your OS provides the FCS when reading raw packets. not me deleting bytes based on vibes. π
--ttl=stringβ modify the IPv4/v6 TTL/Hop Limit.
allows you to modify the TTL/Hop Limit of all the IPv4/v6 packets. specify a number to hard-code the value or +/-value to increase or decrease by the value provided (limited to 1-255).
examples:
--ttl=10
--ttl=+7
--ttl=-64
--tos=numberβ set the IPv4 TOS/DiffServ/ECN byte. range: 0 to 255.
allows you to override the TOS (also known as DiffServ/ECN) value in IPv4.
--tclass=numberβ set the IPv6 Traffic Class byte. range: 0 to 255.
allows you to override the IPv6 Traffic Class field.
--flowlabel=numberβ set the IPv6 Flow Label. range: 0 to 1048575.
allows you to override the 20bit IPv6 Flow Label field. has no effect on IPv4 packets. sorry IPv4 girlies. β¨
-F,--fixlen=stringβ pad or truncate packet data to match header length.
packets may be truncated during capture if the snaplen is smaller then the packet. this option allows you to modify the packet to pad the packet back out to the size stored in the IPv4/v6 header or rewrite the IP header total length to reflect the stored packet length.
padβ truncated packets will be padded out so that the packet length matches the IPv4 total lengthtruncβ truncated packets will have their IPv4 total length field rewritten to match the actual packet lengthdelβ delete the packet
--fuzz-seed=numberβ fuzz 1 in X packets. edit bytes, length, or emulate packet drop. range: 0 to any. default: 0.
this fuzzing was designed as to test layer 7 protocols such as voip protocols. it modifies randomly 1 out of X packets (where X = --fuzz-factor) in order for stateful protocols to cover more of their code. the random fuzzing actions focus on data start and end because it often is the part of the data application protocols base their decisions on.
possible fuzzing actions list: * drop packet * reduce packet size * edit packet Bytes:
* Not all Bytes have the same probability of appearance in real life.
Replace with 0x00, 0xFF, or a random byte with equal likelihood.
* Not all Bytes have the same significance in a packet.
Replace the start, the end, or the middle of the packet with equal likelihood.
- do nothing (7 out of 8 packets)
--fuzz-factor=numberβ set the Fuzz 1 in X packet ratio (default 1 in 8 packets). range: 1 to any. default: 8. requires:--fuzz-seed.
sets the ratio of for --fuzz-seed option. by default this value is 8, which means 1 in 8 packets are modified by fuzzing. note that this ratio is based on the random number generated by the supplied fuzz seed. therefore by default you cannot expect that exactly every eighth packet will be modified. it's random, bestie, that's the point. π²
--skipl2broadcastβ skip rewriting broadcast/multicast Layer 2 addresses.
by default, editing Layer 2 addresses will rewrite broadcast and multicast MAC addresses. setting this flag will keep broadcast/multicast MAC addresses from being rewritten.
--dlt=stringβ override output DLT encapsulation.
by default, no DLT (data link type) conversion will be made. to change the DLT type of the output pcap, select one of the following values:
enetβ Ethernet akaDLT_EN10MBhdlcβ Cisco HDLC akaDLT_C_HDLCjnpr_ethβ Juniper EthernetDLT_C_JNPR_ETHERpppserialβ PPP Serial akaDLT_PPP_SERIALuserβ User specified Layer 2 header and DLT type
--enet-dmac=stringβ override destination ethernet MAC addresses.
takes a pair of comma deliminated ethernet MAC addresses which will replace the destination MAC address of outbound packets. the first MAC address will be used for the server to client traffic and the optional second MAC address will be used for the client to server traffic.
example:
--enet-dmac=00:12:13:14:15:16,00:22:33:44:55:66
--enet-smac=stringβ override source ethernet MAC addresses.
takes a pair of comma deliminated ethernet MAC addresses which will replace the source MAC address of outbound packets. the first MAC address will be used for the server to client traffic and the optional second MAC address will be used for the client to server traffic.
example:
--enet-smac=00:12:13:14:15:16,00:22:33:44:55:66
--enet-subsmac=stringβ substitute MAC addresses. may appear up to 9999 times.
allows you to rewrite ethernet MAC addresses of packets. it takes comma delimited pair or MACs address and rewrites all occurrences of the first MAC with the value of the second MAC. example:
--enet-subsmac=00:12:13:14:15:16,00:22:33:44:55:66
--enet-mac-seed=numberβ randomize MAC addresses. cannot be combined with:--enet-smac,--enet-dmac,--enet-subsmac.
allows you to randomize ethernet MAC addresses of packets, mostly like what --seed option does for IPv4/IPv6 addresses. π
--enet-mac-seed-keep-bytes=numberβ randomize MAC addresses. range: 1 to 6. requires:--enet-mac-seed.
keep some bytes untouched when usinging --enet-mac-seed option. (yes, "usinging" β we keep it exactly as written, periodt.)
--enet-vlan=stringβ specify ethernet 802.1q VLAN tag mode.
allows you to rewrite ethernet frames to add a 802.1q header to standard 802.3 ethernet headers or remove the 802.1q VLAN tag information.
addβ slaps an 802.1q VLAN header onto the 802.3 ethernet header you already have. If there's already a VLAN header chilling there? The new one goes outside of it. π«Ά
Heads up bestie: you're technically allowed to run this multiple times and stack more than 2 VLAN headers, and per the page those packets will be valid. But you should cap it at 2 Γ 802.1q VLAN tags max β or one outer 802.1ad plus one inner 802.1q tag. That's the move. π
delβ rewrites the existing 802.1q VLAN header as a plain 802.3 ethernet header. Poof, tag gone. β¨
--enet-vlan-tag=numberβ the new ethernet 802.1q VLAN tag value. Range:0to4095. Requires:--enet-vlan.
Mandatory when --enet-vlan=add is used on packets that aren't already VLAN tagged. No tag value, no tag, babes.
--enet-vlan-cfi=numberβ the ethernet 802.1q VLAN CFI value. Range:0to1. Requires:--enet-vlan.
Skip it and the CFI bit of an existing VLAN header gets preserved; a newly added tag on a previously untagged packet defaults to 0 (and you get a one-time notice printed, so cute of it).
--enet-vlan-pri=numberβ the ethernet 802.1q VLAN priority. Range:0to7. Requires:--enet-vlan.
Skip it and the priority of an existing VLAN header gets preserved; a newly added tag on a previously untagged packet defaults to 0 (again with the one-time notice π).
--enet-vlan-proto=stringβ pick your VLAN tag protocol:802.1qor802.1ad. It's literally how you tell tcpbridge which protocol the added VLAN tags should be. π802.1qβ 802.1q VLAN headers get added. This is the default, the moment, the standard.802.1adβ 802.1ad Q-in-Q VLAN headers get added. For these packets to be valid, your input packets must already have 802.1q VLAN headers. No skipping steps. π
--hdlc-control=numberβ sets the HDLC control value.
The Cisco HDLC header has a 1 byte "control" field. Apparently it should always be 0, but you can use any 1 byte value. Do what you want, we're not your dad. π
--hdlc-address=numberβ sets the HDLC address.
The Cisco HDLC header has a 1 byte "address" field with two valid values:
0x0Fβ Unicast0xBFβ Broadcast
You can however specify any single byte value. Live your truth. π
--user-dlt=numberβ set the output file DLT type. It sets the DLT value of the output pcap file. Simple as that, fr fr.--user-dlink=stringβ rewrite the Data-Link layer with data you specify yourself. May appear up to 2 times.
Hand it a series of comma-deliminated hex values and it'll use them to rewrite or create the Layer 2 header of the packets. The first instance of this argument rewrites both server and client traffic, but if you specify it a second time, that second one is for the client traffic. π¦
Example:
--user-dlink=01,02,03,04,05,06,00,1A,2B,3C,4D,5E,6F,08,00
-d,--dbug=numberβ enable debugging output. Range:0to5. Default:0.
If it was configured with --enable-debug, then you can specify a verbosity level for debugging output. Higher numbers = more verbosity. Turn it up. π₯
-i,--intf1=stringβ primary interface (listen in uni-directional mode). This option is required. Not optional. Not a vibe. Required. π-I,--intf2=stringβ secondary interface (send in uni-directional mode).-u,--unidirβ send and receive in only one direction.
Normally tcpbridge sends and receives traffic in both directions (bi-directionally). But pick this option and the traffic goes uni-directionally. One-way street energy. πΆββοΈ
--listnicsβ lists the available network interfaces and exits. Window shopping, but for NICs. β¨-L,--limit=numberβ limit the number of packets to send. Range:1to any. Default:-1.
By default tcpbridge sends packets forever or until Ctrl-C. Alternatively, you can specify a maximum number of packets to send. Boundaries! We love them. π
-M,--mac=stringβ MAC addresses of local NIC's. May appear up to 2 times.
tcpbridge does not support detecting the MAC addresses of the local network interfaces under Windows. So please specify both MAC addresses of the interfaces used in the bridge: -M <intf1 mac> -M <intf2 mac>. Windows girlies, this one's on you. π«Ά
-x,--include=stringβ include only packets matching this rule. Cannot be combined with:--exclude.
Overrides the default of sending all packets stored in the capture file and only sends packets that match the rule you gave. Rules can be one of:
S:<CIDR1>,...β source IP must match specified CIDR(s)D:<CIDR1>,...β destination IP must match specified CIDR(s)B:<CIDR1>,...β both source and destination IP must match specified CIDR(s)E:<CIDR1>,...β either IP must match specified CIDR(s)P:<LIST>β must be one of the listed packets, where the list corresponds to the packet number in the capture file.
--include=P:1-5,9,15,72-
would send packets 1 through 5, the 9th and 15th packet, and packets 72 until the end of the file. Iconic range syntax tbh. π
F:'<bpf>'β BPF filter. See thetcpdump(8)man page for syntax.
-X,--exclude=stringβ exclude any packet matching this rule. Cannot be combined with:--include.
Overrides the default of sending all packets stored in the capture file and only sends packets which do not match the provided rule. Rules can be one of:
S:<CIDR1>,...β source IP must not match specified CIDR(s)D:<CIDR1>,...β destination IP must not match specified CIDR(s)B:<CIDR1>,...β both source and destination IP must not match specified CIDR(s)E:<CIDR1>,...β either IP must not match specified CIDR(s)P:<LIST>β must not be one of the listed packets, where the list corresponds to the packet number in the capture file.
--exclude=P:1-5,9,15,72-
would drop packets 1 through 5, the 9th and 15th packet, and packets 72 until the end of the file. Blocked and reported. π«
-P,--pidβ print the PID oftcpbridgeat startup. Know your process, bestie.-v,--verboseβ print decoded packets viatcpdumpto STDOUT.-A,--decode=stringβ arguments passed to thetcpdumpdecoder. Requires:--verbose.
When enabling verbose mode (-v) you may also specify one or more additional arguments to pass to tcpdump to modify the way packets are decoded. By default, -n and -l are used. Be sure to quote the arguments like: --verbose="-axxx" so that they are not interpreted by tcpbridge. The following arguments are valid:
[ -aAeNqRStuvxX ]
[ -E spi@ipaddr algo:secret,... ]
[ -s snaplen ]
-V,--versionβ print version information. Slay, what version are we on.-h,--less-helpβ display less usage information and exit.-w,--suppress-warningsβ suppress printing warning messages. Living in denial, but make it a flag. π-H,--helpβ display usage information and exit.--more-helpβ pass the extended usage information through a pager.--save-opts[=string]β save the current option state to a config file.--load-opts=string,--no-load-optsβ load options from a config file;--no-load-optsdisables this.
β¨ OPTION PRESETS β¨
Any option that isn't marked as not presettable may be preset by loading values from configuration ("RC" or ".INI") file(s). The homerc file is $$/, unless that is a directory; in that case .tcpbridgerc is searched for within it. Set it once, forget it forever. π
π FILES π
See OPTION PRESETS for configuration files. Yes, it's a scavenger hunt. Yes, it's intentional. π
πͺ EXIT STATUS πͺ
One of the following exit values will be returned:
0(EXIT_SUCCESS) β successful program execution. Ate. π1(EXIT_FAILURE) β the operation failed or the command syntax was not valid. Not the vibe. π66(EX_NOINPUT) β a specified configuration file could not be loaded.70(EX_SOFTWARE) βliboptshad an internal operational error. Please report it toautogen-users@lists.sourceforge.net. Thank you!
π AUTHORS π
Copyright 2013-2026 Fred Klassen - AppNeta by Broadcom
Copyright 2000-2012 Aaron Turner
For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
The latest version of this software is always available from: http://tcpreplay.appneta.com/
Β©οΈ COPYRIGHT Β©οΈ
Copyright Β© 2000-2026 Aaron Turner and Fred Klassen, all rights reserved. This program is released under the terms of the GNU General Public License, version 3 or later.
π BUGS π
Please send bug reports to: tcpreplay-users@lists.sourceforge.net
π NOTES π
This manual page was generated from the tcpbridge option definitions.
and that's a wrap on TCPBRIDGE(1), bestie!! πβ¨ It's from the Tcpreplay Suite, dated 2026-07-29 β so if you're reading this, you're reading the real one. Go bridge some packets, you absolute icon. ππ¦π
π¦ where this page comes from
- alpine 3.24: tcpreplay-doc 4.6.1-r0 Β· GPL-3.0-or-later
- arch rolling: tcpreplay 4.6.1-1 Β· GPL-3.0-only
- epel 10: tcpreplay 4.6.1-1.el10_3 Β· GPL-3.0-only
- epel 9: tcpreplay 4.6.1-1.el9 Β· GPL-3.0-only
- epel 9: tcpreplay 4.6.2-1.el9 Β· GPL-3.0-only
- fedora 43: tcpreplay 4.6.1-1.fc43 Β· GPL-3.0-only
- fedora 43: tcpreplay 4.6.1-1.fc43 Β· GPL-3.0-only
- fedora 44: tcpreplay 4.6.1-1.fc44 Β· GPL-3.0-only
- fedora 44: tcpreplay 4.6.1-1.fc44 Β· GPL-3.0-only
- nixpkgs unstable: tcpreplay 4.6.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms