ipsec site-to-site merge doar intr-un sens

Andrei-Florian Staicu <[email protected]>
Newsgroups gmane.org.user-groups.rlug.offtopic
Message-ID <CANK4U2qS9MJc0Ubpins+dz8Sc7qWsL5PjMjs8OOk=ga3jUEhKA@mail.gmail.com>
Salutare,

Am urmatoarele servere:
S1: centos 7
eth0 192.168.0.1
eth1 198.51.100.2, gw 198.51.100.2
iptables allow INPUT de la 203.0.113.2, UDP 4500 si 500

S2: ubuntu 16.04
eth0 10.200.1.2, gw 10.200.1.2, nat-uit in spatele lui 203.0.113.1
(forwardat UDP 4500 si 500)
iptables allow all

ipsec-ul zice pe amandoua ca totul e ok:
[root@S1 ~]# strongswan status
Security Associations (1 up, 0 connecting):
   S1-S2[40]: ESTABLISHED 47 minutes ago, 198.51.100.2[S1]...203.0.113.1[S2]
   S1-S2{105}:  INSTALLED, TUNNEL, reqid 36, ESP in UDP SPIs: c23ec2d5_i
ccc36949_o, IPCOMP CPIs: c755_i e5b8_o
   S1-S2{105}:   192.168.0.1/32 === 10.200.1.2/32
root@S2:~# ipsec status
Security Associations (1 up, 0 connecting):
   S1-S2[70]: ESTABLISHED 44 minutes ago, 10.200.1.2[S2]...198.51.100.2[S1]
   S1-S2{212}:  INSTALLED, TUNNEL, reqid 69, ESP in UDP SPIs: ccc36949_i
c23ec2d5_o, IPCOMP CPIs: e5b8_i c755_o
   S1-S2{212}:   10.200.1.2/32 === 192.168.0.1/32
Rutele sunt si ele ok:
root@S1:~# ip route list table 220
192.168.0.1 via 10.200.1.1 dev eth0  proto static  src 10.200.1.2
[root@S2 ~]# ip route list table 220
10.200.1.2 via 198.51.100.1 dev eth1  proto static  src 192.168.0.1

Dar de pe S2 merg conexiunile spre S1 (ping, tcp, samd; in ambele sensuri
), dar nu si invers. Adica nu ajung deloc pachetele initiate de S1 la S2,
dar ajung reply-urile lui S1 la query-urile lui S2:
[root@S1 ~]# ping -q -c 1 10.200.1.2
PING 10.200.1.2 (10.200.1.2) 56(84) bytes of data.

--- 10.200.1.2 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
root@S2:~# ping -q -c 1 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

--- 192.168.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 6.423/6.423/6.423/0.000 ms

Cum experienta mea cu ipsec e foarte limitat, puteti sa dati un ochi pe
conf-urile de ipsec, sa-mi spuneti daca am ratat ceva? Sau orice alt sfat?

Merci.

PS: numerele alea dintre paranteze drepte/acolade e normal sa creasca la
fiecare reuathentication/rekeying?

[root@S1 ~]# cat /etc/strongswan/ipsec.conf
config setup
  charondebug="ike 2, knl 2, cfg 2, net 2, esp 2, dmn 2,  mgr 2"

conn %default
  authby=secret
  auto=start
  compress=yes
  dpdaction=restart
  dpddelay=300s
  dpdtimeout=10s

esp=aes128-aes256-sha1-sha256-modp2048-modp4096-modp1024,aes128-sha1,aes128-sha1-modp1024,aes128-sha1-modp1536,aes128-sha1-modp2048,aes128-sha256,aes128-sha256-ecp256,aes128-sha256-modp1024,aes128-sha256-modp1536,aes128-sha256-modp2048,aes128gcm12-aes128gcm16-aes256gcm12-aes256gcm16-modp2048-modp4096-modp1024,aes128gcm16,aes128gcm16-ecp256,aes256-sha1,aes256-sha256,aes256-sha256-modp1024,aes256-sha256-modp1536,aes256-sha256-modp2048,aes256-sha256-modp4096,aes256-sha384,aes256-sha384-ecp384,aes256-sha384-modp1024,aes256-sha384-modp1536,aes256-sha384-modp2048,aes256-sha384-modp4096,aes256gcm16,aes256gcm16-ecp384,3des-sha1!

ike=aes128-sha1-modp1024,aes128-sha1-modp1536,aes128-sha1-modp2048,aes128-sha256-ecp256,aes128-sha256-modp1024,aes128-sha256-modp1536,aes128-sha256-modp2048,aes256-aes128-sha256-sha1-modp2048-modp4096-modp1024,aes256-sha1-modp1024,aes256-sha256-modp1024,aes256-sha256-modp1536,aes256-sha256-modp2048,aes256-sha256-modp4096,aes256-sha384-ecp384,aes256-sha384-modp1024,aes256-sha384-modp1536,aes256-sha384-modp2048,aes256-sha384-modp4096,aes256gcm16-aes256gcm12-aes128gcm16-aes128gcm12-sha256-sha1-modp2048-modp4096-modp1024,3des-sha1-modp1024!
  ikelifetime=60m
  keylife=30m
  keyexchange=ikev2
  keingtries=%forever
  margintime=3m
  mobike=no

conn ICI-MSADO
  left=198.51.100.2
  leftsubnet=192.168.0.1/32
  leftid=@S1
  leftid2=@S1
  leftfirewall=yes
  right=203.0.113.1
  rightsubnet=10.200.1.2/32
  rightid=@S2
  rightid2=@S2
  rightfirewall=yes


root@gw-01:~# cat /etc/ipsec.conf
config setup
  charondebug="ike 2, knl 2, cfg 2, net 2, esp 2, dmn 2,  mgr 2"

conn %default
  authby=secret
  auto=start
  compress=yes
  dpdaction=clear
  dpddelay=300s
  dpdtimeout=10s

esp=aes128-aes256-sha1-sha256-modp2048-modp4096-modp1024,aes128-sha1,aes128-sha1-modp1024,aes128-sha1-modp1536,aes128-sha1-modp2048,aes128-sha256,aes128-sha256-ecp256,aes128-sha256-modp1024,aes128-sha256-modp1536,aes128-sha256-modp2048,aes128gcm12-aes128gcm16-aes256gcm12-aes256gcm16-modp2048-modp4096-modp1024,aes128gcm16,aes128gcm16-ecp256,aes256-sha1,aes256-sha256,aes256-sha256-modp1024,aes256-sha256-modp1536,aes256-sha256-modp2048,aes256-sha256-modp4096,aes256-sha384,aes256-sha384-ecp384,aes256-sha384-modp1024,aes256-sha384-modp1536,aes256-sha384-modp2048,aes256-sha384-modp4096,aes256gcm16,aes256gcm16-ecp384,3des-sha1!

ike=aes128-sha1-modp1024,aes128-sha1-modp1536,aes128-sha1-modp2048,aes128-sha256-ecp256,aes128-sha256-modp1024,aes128-sha256-modp1536,aes128-sha256-modp2048,aes256-aes128-sha256-sha1-modp2048-modp4096-modp1024,aes256-sha1-modp1024,aes256-sha256-modp1024,aes256-sha256-modp1536,aes256-sha256-modp2048,aes256-sha256-modp4096,aes256-sha384-ecp384,aes256-sha384-modp1024,aes256-sha384-modp1536,aes256-sha384-modp2048,aes256-sha384-modp4096,aes256gcm16-aes256gcm12-aes128gcm16-aes128gcm12-sha256-sha1-modp2048-modp4096-modp1024,3des-sha1-modp1024!
  ikelifetime=60m
  keylife=30m
  keyexchange=ikev2
  keingtries=%forever
  margintime=3m
  mobike=no

conn ICI-MSADO
  left=10.200.1.2
  leftsubnet=10.200.1.2/32
  leftid=@S2
  leftid2=@S2
  leftnexthop=%defaultroute
  rightfirewall=yes
  right=198.51.100.2
  rightsubnet=192.168.0.1/32
  rightid=@S1
  rigthid2=@S1
  rightfirewall=yes

-- 
Beware of programmers who carry screwdrivers.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.