allow_all_ext_traffic_to_local_service: accept extern interface instead of address.

If an extern interface (e.g. $ext_if_static_1) is given as first field,
only an INPUT rule for traffic to the gateway itself on that interface
is created - no address lookup needed. Implemented for IPv4 and IPv6.

Also:
- ip6t-firewall-gateway: check gateway_ipv6_address_arr (was
  gateway_ipv4_address_arr) when detecting own gateway addresses.
- main_ipv*.conf.sample: document how to allow incoming traffic for a
  reverse proxy in 'allow_gw_to_local_service', fix example parameter
  name of 'allow_all_ext_traffic_to_local_service'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrisandClaude Opus 5.5 committed 2026-11-19 01:27:55 +01:00
1 parent 954dce1bf0
commit a57980f3f2
4 files changed
+77 -7

No files matched your search

+30 -3
View File
@@ -104,6 +104,11 @@ any_access_from_inet_networks=""
# -
# - allow_all_ext_traffic_to_local_service="local-address:port:protocol [local-address:port:protocol] .."
# -
# - Instead of 'local-address' an extern interface (e.g. $ext_if_static_1) can
# - be given. Then traffic coming in on that interface to the given port of the
# - gateway itself is allowed (INPUT chain, no address needed). Useful e.g. if
# - the gateway acts as reverse proxy (see also 'allow_gw_to_local_service').
# -
# - Note:
# - =====
# - - Only 'tcp' and 'udp' are allowed valuse for protocol.
@@ -111,10 +116,12 @@ any_access_from_inet_networks=""
# - Example:
# - allow extern traffic to service at 83.223.73.210 on port 1036
# - allow extern traffic to https service at 83.223.73.204
# - allow extern traffic on interface $ext_if_static_1 to port 9443 of the gateway
# -
# - allow_ext_net_to_local_service="
# - allow_all_ext_traffic_to_local_service="
# - 83.223.73.210:1036:tcp
# - 83.223.73.204:$standard_https_port:tcp
# - $ext_if_static_1:9443:tcp
# - "
# -
# - Blank separated list
@@ -470,13 +477,33 @@ allow_to_ext_net=""
# - connection from the gateway to the local service is dropped by the OUTPUT
# - chain and the reverse proxy answers with '502 Bad Gateway'.
# -
# - Note: Incoming traffic to the reverse proxy on the gateway itself (e.g. port
# - 443) must be allowed separately.
# - Note: This parameter only covers the connection gateway -> local server.
# - Incoming traffic to the reverse proxy on the gateway itself must be
# - allowed separately:
# -
# - - Standard ports (80/443): set 'local_http_service=true'.
# -
# - - Any other port (e.g. 9443): use parameter
# - 'allow_all_ext_traffic_to_local_service' with the extern interface,
# - so that the port is only opened on that interface:
# -
# - allow_all_ext_traffic_to_local_service="$ext_if_static_1:9443:tcp"
# -
# - Do NOT add such a port to 'http_ports': that parameter is used in
# - many rules (FORWARD to local web servers, ..) and would open the
# - port far beyond what is needed.
# -
# - Only 'tcp' and 'udp' are allowed values for protocol. A port range
# - can be given as 'from-to'.
# -
# - Example:
# - nginx on the gateway listens on port 9443 and forwards requests to
# - http://192.168.10.13:9663:
# -
# - allow_all_ext_traffic_to_local_service="$ext_if_static_1:9443:tcp"
# - allow_gw_to_local_service="192.168.10.13:9663:tcp"
# -
# - Further example with a port range:
# - allow_gw_to_local_service="192.168.10.13:9663:tcp
# - 192.168.10.20:8000-8010:tcp"
# -
+30 -3
View File
@@ -101,6 +101,11 @@ any_access_from_inet_networks=""
# -
# - allow_all_ext_traffic_to_local_service="local-address,port,protocol [local-address,port,protocol] .."
# -
# - Instead of 'local-address' an extern interface (e.g. $ext_if_static_1) can
# - be given. Then traffic coming in on that interface to the given port of the
# - gateway itself is allowed (INPUT chain, no address needed). Useful e.g. if
# - the gateway acts as reverse proxy (see also 'allow_gw_to_local_service').
# -
# - Note:
# - =====
# - - Only 'tcp' and 'udp' are allowed valuse for protocol.
@@ -108,10 +113,12 @@ any_access_from_inet_networks=""
# - Example:
# - allow extern traffic to service at 2a01:30:1fff:fd00::210 on port 1036
# - allow extern traffic to https service at 2a01:30:1fff:fd00::204
# - allow extern traffic on interface $ext_if_static_1 to port 9443 of the gateway
# -
# - allow_ext_net_to_local_service="
# - allow_all_ext_traffic_to_local_service="
# - 2a01:30:1fff:fd00::210,1036,tcp
# - 2a01:30:1fff:fd00::204,$standard_https_port,tcp
# - $ext_if_static_1,9443,tcp
# - "
# -
# - Blank separated list
@@ -457,8 +464,21 @@ allow_to_ext_net=""
# - connection from the gateway to the local service is dropped by the OUTPUT
# - chain and the reverse proxy answers with '502 Bad Gateway'.
# -
# - Note: Incoming traffic to the reverse proxy on the gateway itself (e.g. port
# - 443) must be allowed separately.
# - Note: This parameter only covers the connection gateway -> local server.
# - Incoming traffic to the reverse proxy on the gateway itself must be
# - allowed separately:
# -
# - - Standard ports (80/443): set 'local_http_service=true'.
# -
# - - Any other port (e.g. 9443): use parameter
# - 'allow_all_ext_traffic_to_local_service' with the extern interface,
# - so that the port is only opened on that interface:
# -
# - allow_all_ext_traffic_to_local_service="$ext_if_static_1,9443,tcp"
# -
# - Do NOT add such a port to 'http_ports': that parameter is used in
# - many rules (FORWARD to local web servers, ..) and would open the
# - port far beyond what is needed.
# -
# - Only 'tcp' and 'udp' are allowed values for protocol. A port range
# - can be given as 'from-to'.
@@ -466,6 +486,13 @@ allow_to_ext_net=""
# - Note: Fields are separated by comma (not colon) because of IPv6 addresses.
# -
# - Example:
# - nginx on the gateway listens on port 9443 and forwards requests to
# - http://[fd2c:d4d1:4f03:10::13]:9663:
# -
# - allow_all_ext_traffic_to_local_service="$ext_if_static_1,9443,tcp"
# - allow_gw_to_local_service="fd2c:d4d1:4f03:10::13,9663,tcp"
# -
# - Further example with a port range:
# - allow_gw_to_local_service="fd2c:d4d1:4f03:10::13,9663,tcp
# - fd2c:d4d1:4f03:10::20,8000-8010,tcp"
# -