Skip to content

Instantly share code, notes, and snippets.

@joshschmelzle
Created September 20, 2022 01:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshschmelzle/8c56569620b2468d2dcbbe71f104e21b to your computer and use it in GitHub Desktop.
Save joshschmelzle/8c56569620b2468d2dcbbe71f104e21b to your computer and use it in GitHub Desktop.
iPerf3 systemd.unit

iPerf3 service with systemd

  • Create file at /etc/systemd/system/iperf3.service with contents from iperf3.service

systemctl

  • To start a service at boot, use the enable command: sudo systemctl enable iperf3.service
  • To view the service status, use the status command: sudo systemctl status iperf3.service
  • To start the service, use the start command: sudo systemctl start iperf3.service
  • To stop the service, use the stop command: sudo systemctl stop iperf3.service

iptables

View iptables rules:

sudo iptables -S
sudo iptables -nvL

Allow udp/tcp on 5201:

sudo iptables -A INPUT -p tcp --dport 5201 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 5201 -j ACCEPT
# /etc/systemd/system/iperf3.service
[Unit]
Description=iperf3 server
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/iperf3 -s -1 -p 5201
Restart=always
RestartSec=3
RuntimeMaxSec=3600
[Install]
WantedBy=multi-user.target
@joshschmelzle
Copy link
Author

Links:

Maintainers site: https://software.es.net/iperf/#
Source: https://github.com/esnet/iperf

Binaries:

Binaries built by Makotom: https://github.com/makotom/iperf3-binaries/releases
Windows Binaries built by Budman: https://files.budman.pw/
macOS binaries via brew: https://formulae.brew.sh/formula/iperf3

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