Skip to content

Commit b5e3623

Browse files
committed
config-gw: Update comments
1 parent 05ea6cf commit b5e3623

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

scripts/config-fw.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,33 @@ set -e
77
# # How to Use
88
# This script can be used in a systemd service to set up firewall rules before starting VMs.
99
# Example systemd service configuration:
10-
#
10+
# ```
1111
# [Unit]
1212
# Description=Dstack Firewall Configuration
1313
# Before=dstack-vmm.service
1414
#
1515
# [Service]
1616
# Type=oneshot
17-
# ExecStart=/path/to/config-fw.sh -u dstack-vmm --allow-tcp 22 --allow-tcp 8080
17+
# ExecStart=/path/to/config-fw.sh -u dstack-vmm
1818
# RemainAfterExit=yes
1919
#
2020
# [Install]
2121
# WantedBy=multi-user.target
22+
# ```
2223
#
2324
# # Note
2425
# The dstack supervisor must be run with a dedicated user specified by USERNAME in this script.
2526
# For example, if dstack-gateway is running on the same host, it must use a different user account than USERNAME.
26-
#
27+
# To allow specific local ports to be accessed by CVMs, add --allow-tcp and --allow-udp.
28+
# For example, if dstack-gateway is running on local host and listening RPC on port 9001, wg on port 9182:
29+
# ```
30+
# ./config-fw.sh -u dstack-vmm --allow-tcp 9001 --allow-udp 9182
31+
# ```
32+
# If the KMS is also running on the same host and listening on port 9002:
33+
# ```
34+
# ./config-fw.sh -u dstack-vmm --allow-tcp 9001 --allow-udp 9182 --allow-tcp 9002
35+
# ```
36+
2737

2838
# Default values
2939
USERNAME=${USERNAME:-""}

0 commit comments

Comments
 (0)