Skip to content

Commit 9bfb151

Browse files
authored
Restrict standard local port range
Using a local port range of 1024-65535 is risky because etcd listens on port 2379 and 2380, pgbouncer on port 6432, PostgreSQL on port 5432 and Patroni on 8008. This can lead to collision. In my case, etcd established a connection to another cluster member on port 8008, which meant that Patroni wasn't able to start because port 8008 was already in use. 10000 stays clear of all predefined ports.
1 parent dc49266 commit 9bfb151

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vars/system.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ sysctl_conf:
5151
- {name: "kernel.sched_autogroup_enabled", value: "0"}
5252
- {name: "net.ipv4.ip_nonlocal_bind", value: "1"}
5353
- {name: "net.ipv4.ip_forward", value: "1"}
54-
- {name: "net.ipv4.ip_local_port_range", value: "1024 65535"}
54+
- {name: "net.ipv4.ip_local_port_range", value: "10000 65535"}
5555
- {name: "net.netfilter.nf_conntrack_max", value: "1048576"}
5656
- {name: "net.core.netdev_max_backlog", value: "10000"}
5757
- {name: "net.ipv4.tcp_max_syn_backlog", value: "8192"}
@@ -60,7 +60,7 @@ sysctl_conf:
6060
balancers:
6161
- {name: "net.ipv4.ip_nonlocal_bind", value: "1"}
6262
- {name: "net.ipv4.ip_forward", value: "1"}
63-
- {name: "net.ipv4.ip_local_port_range", value: "1024 65535"}
63+
- {name: "net.ipv4.ip_local_port_range", value: "10000 65535"}
6464
- {name: "net.netfilter.nf_conntrack_max", value: "1048576"}
6565
- {name: "net.core.netdev_max_backlog", value: "10000"}
6666
- {name: "net.ipv4.tcp_max_syn_backlog", value: "8192"}

0 commit comments

Comments
 (0)