Skip to content

Instantly share code, notes, and snippets.

@pm-hwks
Created August 21, 2019 07:03
Show Gist options
  • Save pm-hwks/3c8c55f8e31c1c02b45d32d269379171 to your computer and use it in GitHub Desktop.
Save pm-hwks/3c8c55f8e31c1c02b45d32d269379171 to your computer and use it in GitHub Desktop.
[Netcat network test] Netcat commands to test bandwidth between 2 linux servers #netcat #perf-test #linux #network
## Netcat server command
nc -l <unused port # > /dev/null
eg:
nc -l 1122 > /dev/null
## Netcat Client command
dd if=/dev/zero bs=9100004096 count=1 | nc <netcat server> <netcat port>
eg:
dd if=/dev/zero bs=9100004096 count=1 | nc 10.0.1.251 1122
## You should the following output as an examples
2147479552 bytes (2.1 GB) copied, 4.23416 s, 507 MB/s
@IgorLeMasson
Copy link

Nice example with dd and netcat!

@michail-nikolaev
Copy link

Thanks!

@ledlamp
Copy link

ledlamp commented Mar 22, 2023

it not work even though nc works why

@clemisch
Copy link

Instead of the manual bs=9100004096 you can just write bs=1GB or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment