netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Berizzi <pupilla@libero.it>
To: netdev@vger.kernel.org
Subject: icmp redirect sent when an active ipsec child_sa exist
Date: Tue, 9 Oct 2018 14:09:26 +0200 (CEST)	[thread overview]
Message-ID: <998698700.1694138.1539086966729@mail.libero.it> (raw)

Hi Folks,

I'm running strongSwan on Slackware with linux 4.18
This is the output from 'ip route show':

default via isp_router dev eth0 metric 1 
10.0.0.0/8 via 10.68.63.3 dev eth1 
10.68.63.0/26 dev eth1 proto kernel scope link src 10.68.63.62 
127.0.0.0/8 dev lo scope link 
172.16.0.0/12 via 10.68.63.3 dev eth1 
192.168.0.0/16 via 10.68.63.3 dev eth1 

and 'ip a s':

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 [trimmed]
    link/ether fc:4d:d4:2e:dc:6a brd ff:ff:ff:ff:ff:ff
    inet 10.68.63.62/26 brd 10.68.63.63 scope global eth1
       valid_lft forever preferred_lft forever

Connected to the eth1 there is also a 10.68.63.55 host:
the default gateway for this host is 10.68.63.62

This is the relevant configuration from stronSwan:

children {
         networks {
                  local_ts  = 10.68.63.54/31
                  remote_ts = 10.82.43.0/24
                  start_action = trap
                  }
         }

The value trap installs a trap policy, which is going
to trigger the tunnel as soon as matching traffic will
be detected.

When I issue a ping from 10.68.63.55 host to a 10.82.43.0/24
network's host, I get this behaviour:

12:24:40.219185 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 43, length 64
12:24:41.235072 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 44, length 64
12:24:42.251095 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 45, length 64
12:24:43.267007 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 46, length 64
12:24:44.282948 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 47, length 64
12:24:45.298873 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 48, length 64
12:24:46.314840 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 49, length 64
12:24:47.330767 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 50, length 64
12:24:48.346708 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 51, length 64
12:24:49.362627 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 52, length 64
12:24:49.362686 IP (tos 0xc0, ttl 64, id 11631, offset 0, flags [none], proto ICMP (1), length 112)
    10.68.63.62 > 10.68.63.55: ICMP redirect 10.82.43.10 to host 10.68.63.3, length 92
        IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 52, length 64
12:24:50.379051 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 53, length 64
12:24:50.379113 IP (tos 0xc0, ttl 64, id 12190, offset 0, flags [none], proto ICMP (1), length 112)
    10.68.63.62 > 10.68.63.55: ICMP redirect 10.82.43.10 to host 10.68.63.3, length 92
        IP (tos 0x0, ttl 62, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 53, length 64
12:24:51.398707 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto ICMP (1), length 84)
    10.68.63.55 > 10.82.43.10: ICMP echo request, id 12199, seq 54, length 64

Linux is sending those icmp redirects *after* the
CHILD_SA has been established. When the CHILD_SA
is not yet established linux will not send any icmp
redirect.

Is this the expected behavior?

Obviously if I remove the following static route:

10.0.0.0/8 via 10.68.63.3 dev eth1 

linux will not send anymore the icmp redirect.

Any feedback are welcome.

Thanks in advance

                 reply	other threads:[~2018-10-09 19:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=998698700.1694138.1539086966729@mail.libero.it \
    --to=pupilla@libero.it \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).