From 4c604b98737a018f5d8e79dad9e503a50d877a07 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 30 Jun 2023 09:45:24 +0200 Subject: [PATCH] sysctl.conf: Allow inet free binds Allow inet free binds (bind to any ip address) so that services which bind to specific ip addresses (e.g. $MX_IPADDR) don't need to wait for network setup. This simplifies our startup, because we can avoid to pull network-online.target or order units after network.service just to to be able to listen to a specific address. Note, that we still need network to resolve names to addresses. --- misc_etc_files/sysctl.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc_etc_files/sysctl.conf b/misc_etc_files/sysctl.conf index 242ef18..0f4c7a6 100644 --- a/misc_etc_files/sysctl.conf +++ b/misc_etc_files/sysctl.conf @@ -45,3 +45,9 @@ kernel.shmall = 34359738368 # user request: Allow CPU event access by users without CAP_SYS_ADMIN kernel.perf_event_paranoid = -1 + +# allow inet free binds (bind to any ip address) so that services which bind to +# specific ip addresses (e.g. $MX_IPADDR) don't need to wait for network setup + +net.ipv4.ip_nonlocal_bind = 1 +net.ipv6.ip_nonlocal_bind = 1