fff-gateway: Send ICMP errors using inbound ifaddr

Submitted by Fabian Blaese on Aug. 2, 2020, 5:55 p.m.

Details

Message ID 20200802175502.451663-5-fabian@blaese.de
State Accepted
Headers show

Commit Message

Fabian Blaese Aug. 2, 2020, 5:55 p.m.
When using NATs and tunnels at the same time, the correct
source address has to be used so the ICMP errors is sent
through the NAT. This is necessary so the NAT can modify
the ICMP payload so it is correctly identified by the
destination host, which is required for PMTUD

Fixes: #142
Signed-off-by: Fabian Bläse <fabian@blaese.de>
---
 .../fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf     | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
index 62bda1b..885afb7 100644
--- a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
+++ b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
@@ -3,3 +3,6 @@  net.ipv4.conf.all.forwarding=1
 net.ipv4.ip_forward=1
 net.ipv6.conf.all.forwarding=1
 net.ipv6.conf.default.forwarding=1
+
+# Use inbound ifaddr for icmp errors to ensure correct PMTUD when using far-away NAT
+net.ipv4.icmp_errors_use_inbound_ifaddr=1

Comments

Christian Dresel Aug. 2, 2020, 6:25 p.m.
Reviewed-by: Christian Dresel <fff@chrisi01.de>

On 02.08.20 19:55, Fabian Bläse wrote:
> When using NATs and tunnels at the same time, the correct
> source address has to be used so the ICMP errors is sent
> through the NAT. This is necessary so the NAT can modify
> the ICMP payload so it is correctly identified by the
> destination host, which is required for PMTUD
> 
> Fixes: #142
> Signed-off-by: Fabian Bläse <fabian@blaese.de>
> ---
>  .../fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf     | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
> index 62bda1b..885afb7 100644
> --- a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
> +++ b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
> @@ -3,3 +3,6 @@ net.ipv4.conf.all.forwarding=1
>  net.ipv4.ip_forward=1
>  net.ipv6.conf.all.forwarding=1
>  net.ipv6.conf.default.forwarding=1
> +
> +# Use inbound ifaddr for icmp errors to ensure correct PMTUD when using far-away NAT
> +net.ipv4.icmp_errors_use_inbound_ifaddr=1
>
Robert Langhammer Aug. 2, 2020, 6:59 p.m.
Reviewed-by: Robert Langhammer <rlanghammer@web.de>

Am 02.08.20 um 19:55 schrieb Fabian Bläse:
> When using NATs and tunnels at the same time, the correct
> source address has to be used so the ICMP errors is sent
> through the NAT. This is necessary so the NAT can modify
> the ICMP payload so it is correctly identified by the
> destination host, which is required for PMTUD
>
> Fixes: #142
> Signed-off-by: Fabian Bläse <fabian@blaese.de>
> ---
>  .../fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf     | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
> index 62bda1b..885afb7 100644
> --- a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
> +++ b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
> @@ -3,3 +3,6 @@ net.ipv4.conf.all.forwarding=1
>  net.ipv4.ip_forward=1
>  net.ipv6.conf.all.forwarding=1
>  net.ipv6.conf.default.forwarding=1
> +
> +# Use inbound ifaddr for icmp errors to ensure correct PMTUD when using far-away NAT
> +net.ipv4.icmp_errors_use_inbound_ifaddr=1
Adrian Schmutzler Sept. 15, 2020, 11:03 a.m.
Merged.

> -----Original Message-----
> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf
> Of Fabian Bläse
> Sent: Sonntag, 2. August 2020 19:55
> To: franken-dev@freifunk.net
> Subject: [PATCH] fff-gateway: Send ICMP errors using inbound ifaddr
> 
> When using NATs and tunnels at the same time, the correct source address
> has to be used so the ICMP errors is sent through the NAT. This is necessary
> so the NAT can modify the ICMP payload so it is correctly identified by the
> destination host, which is required for PMTUD
> 
> Fixes: #142
> Signed-off-by: Fabian Bläse <fabian@blaese.de>
> ---
>  .../fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf     | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-
> gateway.conf b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-
> gateway.conf
> index 62bda1b..885afb7 100644
> --- a/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.conf
> +++ b/src/packages/fff/fff-gateway/files/etc/sysctl.d/60-fff-gateway.con
> +++ f
> @@ -3,3 +3,6 @@ net.ipv4.conf.all.forwarding=1
>  net.ipv4.ip_forward=1
>  net.ipv6.conf.all.forwarding=1
>  net.ipv6.conf.default.forwarding=1
> +
> +# Use inbound ifaddr for icmp errors to ensure correct PMTUD when using
> +far-away NAT
> +net.ipv4.icmp_errors_use_inbound_ifaddr=1
> --
> 2.28.0