<div dir="ltr">uodate 3:<div><br></div><div>seems changing xmark from INPUT chain to PREROUTING - did not help. Packets are still no matched, but everything works.</div><div><br></div><div>Maybe newer Linux versions (CentOS Linux release 7.7) already maps MARKs automatically ?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 1, 2021 at 11:06 PM Edvinas Kairys <<a href="mailto:edvinas.email@gmail.com">edvinas.email@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">as I digged more - it could be due to the marking configured not on the PREROUTING, but on INPUT chain. On Monday i will try to change the marking to PREROUTING chain.<div><br></div><div>Also, it's interesting why the connection works if INPUT chain marking doesnt..</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 1, 2021 at 10:39 PM Edvinas Kairys <<a href="mailto:edvinas.email@gmail.com" target="_blank">edvinas.email@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Hello, (sorry, resend to all)<br></div><div dir="ltr"><div><br></div><div>Thanks for opportunity to remind myself the processing order of Linux iptables. The tables are here, i;'ve bolded the places where 37.37.37.37 (my linux host) can be matched. As the theory says - Linux firstly consults mange input chain, and only after that the filter table.</div><div><br></div><div>So in mangle input we have that set-xmark thing where no matching occurs. Later in filter table i've had made some 'protection' entries to allow only Ipsec traffic to that IP address. Do you think that those entries on filter table can be the reason that mangle table entries is not matched ? As i understand it shouldnt be the case - because that filter table rulles just accepts the packet.</div><div><br></div><div>Anyhow, how it supposes to work if no match is occuring ?</div><div><br></div><div>Thanks !</div><div><br><i># Generated by iptables-save v1.4.21 on Sat May 1 20:43:46 2021<br>*raw<br>:PREROUTING ACCEPT [8243685689:8795975227546]<br>:OUTPUT ACCEPT [2553871359:2092598753320]<br>COMMIT<br># Completed on Sat May 1 20:43:46 2021<br># Generated by iptables-save v1.4.21 on Sat May 1 20:43:46 2021<br>*security<br>:INPUT ACCEPT [5496114822:5333472174263]<br>:FORWARD ACCEPT [2747543338:3462497328147]<br>:OUTPUT ACCEPT [2553871359:2092598753320]<br>COMMIT<br># Completed on Sat May 1 20:43:46 2021<br># Generated by iptables-save v1.4.21 on Sat May 1 20:43:46 2021<br>*mangle<br>:PREROUTING ACCEPT [8243685131:8795975030291]<br>:INPUT ACCEPT [5496114395:5333471981784]<br>:FORWARD ACCEPT [2747543338:3462497328147]<br>:OUTPUT ACCEPT [2553870669:2092598540842]<br>:POSTROUTING ACCEPT [5354687244:5605322818820]<br><b>-A INPUT -s <a href="http://18.138.204.63/32" target="_blank">18.138.204.63/32</a> -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -p esp -j MARK --set-xmark 0x64/0xffffffff<br>-A INPUT -s <a href="http://54.169.121.249/32" target="_blank">54.169.121.249/32</a> -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -p esp -j MARK --set-xmark 0xc8/0xffffffff</b><br>-A FORWARD -o VTI_awssg1 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu<br>-A FORWARD -o VTI_awssg2 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu<br>COMMIT<br># Completed on Sat May 1 20:43:46 2021<br># Generated by iptables-save v1.4.21 on Sat May 1 20:43:46 2021<br>*nat<br>:PREROUTING ACCEPT [2301275:280879334]<br>:INPUT ACCEPT [10207:14377342]<br>:OUTPUT ACCEPT [6610:19206827]<br>:POSTROUTING ACCEPT [2292533:266606871]<br>-A PREROUTING -p tcp -m tcp --dport 1266 -j DNAT --to-destination <a href="http://169.254.0.1:443" target="_blank">169.254.0.1:443</a><br>-A POSTROUTING -s <a href="http://10.130.0.0/16" target="_blank">10.130.0.0/16</a> -d <a href="http://10.130.0.0/16" target="_blank">10.130.0.0/16</a> -o GRE_+ -m comment --comment 400_exclude_change_dc_source -j ACCEPT<br>-A POSTROUTING -s <a href="http://10.130.0.0/16" target="_blank">10.130.0.0/16</a> -d <a href="http://10.0.0.0/8" target="_blank">10.0.0.0/8</a> -o GRE_+ -m comment --comment 450_change_dc_source -j SNAT --to-source 10.254.2.252<br>-A POSTROUTING -d <a href="http://169.254.0.1/32" target="_blank">169.254.0.1/32</a> -p tcp -m tcp --dport 443 -j SNAT --to-source 169.254.0.2<br>COMMIT<br># Completed on Sat May 1 20:43:46 2021<br># Generated by iptables-save v1.4.21 on Sat May 1 20:43:46 2021<br>*filter<br>:INPUT ACCEPT [0:0]<br>:FORWARD ACCEPT [0:0]<br>:OUTPUT ACCEPT [304442349:255435349641]<br>:OS2iDRAC - [0:0]<br><b>-A INPUT -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -m comment --comment 000 -m policy --dir in --pol ipsec -j ACCEPT<br>-A INPUT -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -p esp -m comment --comment 001 -j ACCEPT<br>-A INPUT -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -p udp -m multiport --sports 500 -m multiport --dports 500 -m comment --comment 002 -j ACCEPT<br>-A INPUT -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -p udp -m multiport --sports 4500 -m multiport --dports 4500 -m comment --comment 003 -j ACCEPT<br>-A INPUT -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -p icmp -m comment --comment 004 -j ACCEPT<br>-A INPUT -d <a href="http://37.37.37.37/32" target="_blank">37.37.37.37/32</a> -m comment --comment 005 -j DROP</b><br>-A INPUT -m comment --comment 006 -j ACCEPT<br>-A FORWARD -o GRE_+ -p tcp -m tcp --tcp-flags SYN,RST SYN -m comment --comment "6.5_set_tcp_mss" -m tcpmss --mss 1361:1541 -j TCPMSS --set-mss 1360<br>-A FORWARD -m comment --comment 007 -j ACCEPT<br>COMMIT<br># Completed on Sat May 1 20:43:46 2021<br></i><br> <br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 1, 2021 at 1:51 PM Noel Kuntze <noel.kuntze+strongswan-users-ml@thermi.consulting> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Provide output of iptables-save please.<br>
<br>
Kind regards<br>
Noel<br>
<br>
Am 01.05.21 um 12:43 schrieb Edvinas Kairys:<br>
> Hello,<br>
> <br>
> I've established BGP connection from my Centos Linux box to Amazon VPC - using this guide: <a href="https://www.edge-cloud.net/2019/07/18/aws-site-2-site-vpn-with-strongswan-frrouting/#strongswan-setup" rel="noreferrer" target="_blank">https://www.edge-cloud.net/2019/07/18/aws-site-2-site-vpn-with-strongswan-frrouting/#strongswan-setup</a> <<a href="https://www.edge-cloud.net/2019/07/18/aws-site-2-site-vpn-with-strongswan-frrouting/#strongswan-setup" rel="noreferrer" target="_blank">https://www.edge-cloud.net/2019/07/18/aws-site-2-site-vpn-with-strongswan-frrouting/#strongswan-setup</a>><br>
> <br>
> The only strange thing is that on IPtables mangle table - I don't see any matches on MARK f-ction which should set a MARK on incomming traffic. But IPSEC is still working (at least for now) don't know is it something i need to take care of or no.:<br>
> <br>
> |pkts bytes target prot opt in out source destination Chain INPUT (policy ACCEPT 207M packets, 207G bytes) pkts bytes target prot opt in out source destination ||*_0 0 MARK_*||__ esp -- * * xx.xx.204.63 xx.xx.xx.251 MARK set 0x64 __||*_0 0 MARK _*||esp -- * * xx.xx.121.249 xx.xx.xx.251 MARK set 0xc8 Chain FORWARD (policy ACCEPT 100M packets, 131G bytes) pkts bytes target prot opt in out source destination 78389 4702K TCPMSS tcp -- * <br>
VTI_awssg1 <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a> <<a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">http://0.0.0.0/0</a>> <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a> <<a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">http://0.0.0.0/0</a>> tcp flags:0x06/0x02 TCPMSS clamp to PMTU 807 48404 TCPMSS tcp -- * VTI_awssg2 <br>
<a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a> <<a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">http://0.0.0.0/0</a>> <a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">0.0.0.0/0</a> <<a href="http://0.0.0.0/0" rel="noreferrer" target="_blank">http://0.0.0.0/0</a>> tcp flags:0x06/0x02 TCPMSS clamp to PMTU Chain OUTPUT (policy ACCEPT 90M packets, 73G bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 192M packets, 205G bytes) pkts bytes target prot opt in <br>
out source destination |<br>
> <br>
> Any ideas ? Thanks.<br>
> <br>
<br>
</blockquote></div>
</div></div>
</blockquote></div>
</blockquote></div>