После заполнения необходимых полей нажимаем Keep.
root@racoon:~# ifconfig eth0:1 | grep inet
inet 10.255.255.1 netmask 255.255.255.0 broadcast 0.0.0.0
root@racoon:~# ping -c1 -I 10.255.255.1 192.168.0.10
PING 192.168.0.10 (192.168.0.10) from 10.255.255.1 : 56(84) bytes of data.
64 bytes from 192.168.0.10: icmp_seq=1 ttl=63 time=59.9 ms
--- 192.168.0.10 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 59.941/59.941/59.941/0.000 ms
Конфигурационные файлы и дополнительные команды для диагностики со стороны удаленного Linux-сервера:
root@racoon:~# cat /etc/racoon/racoon.conf
log debug;
path pre_shared_key "/etc/racoon/psk.txt";
path certificate "/etc/racoon/certs";
listen {
isakmp 80.211.43.73 [500];
strict_address;
}
remote 185.148.83.16 {
exchange_mode main,aggressive;
proposal {
encryption_algorithm aes256;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group modp1536;
}
generate_policy on;
}
sainfo address 10.255.255.0/24 any address 192.168.0.0/24 any {
encryption_algorithm aes256;
authentication_algorithm hmac_sha1;
compression_algorithm deflate;
}
===
root@racoon:~# cat /etc/racoon/psk.txt
185.148.83.16 testkey
===
root@racoon:~# cat /etc/ipsec-tools.conf
#!/usr/sbin/setkey -f
flush;
spdflush;
spdadd 192.168.0.0/24 10.255.255.0/24 any -P in ipsec
esp/tunnel/185.148.83.16-80.211.43.73/require;
spdadd 10.255.255.0/24 192.168.0.0/24 any -P out ipsec
esp/tunnel/80.211.43.73-185.148.83.16/require;
===
root@racoon:~# racoonctl show-sa isakmp
Destination Cookies Created
185.148.83.16.500 2088977aceb1b512:a4c470cb8f9d57e9 2019-05-22 13:46:13
===
root@racoon:~# racoonctl show-sa esp
80.211.43.73 185.148.83.16
esp mode=tunnel spi=1646662778(0x6226147a) reqid=0(0x00000000)
E: aes-cbc 00064df4 454d14bc 9444b428 00e2296e c7bb1e03 06937597 1e522ce0 641e704d
A: hmac-sha1 aa9e7cd7 51653621 67b3b2e9 64818de5 df848792
seq=0x00000000 replay=4 flags=0x00000000 state=mature
created: May 22 13:46:13 2019 current: May 22 14:07:43 2019
diff: 1290(s) hard: 3600(s) soft: 2880(s)
last: May 22 13:46:13 2019 hard: 0(s) soft: 0(s)
current: 72240(bytes) hard: 0(bytes) soft: 0(bytes)
allocated: 860 hard: 0 soft: 0
sadb_seq=1 pid=7739 refcnt=0
185.148.83.16 80.211.43.73
esp mode=tunnel spi=88535449(0x0546f199) reqid=0(0x00000000)
E: aes-cbc c812505a 9c30515e 9edc8c4a b3393125 ade4c320 9bde04f0 94e7ba9d 28e61044
A: hmac-sha1 cd9d6f6e 06dbcd6d da4d14f8 6d1a6239 38589878
seq=0x00000000 replay=4 flags=0x00000000 state=mature
created: May 22 13:46:13 2019 current: May 22 14:07:43 2019
diff: 1290(s) hard: 3600(s) soft: 2880(s)
last: May 22 13:46:13 2019 hard: 0(s) soft: 0(s)
current: 72240(bytes) hard: 0(bytes) soft: 0(bytes)
allocated: 860 hard: 0 soft: 0
sadb_seq=0 pid=7739 refcnt=0
В этом примере мы использовали PSK для аутентификации пира, но возможен также вариант с аутентификацией по сертификатам. Для этого нужно перейти во вкладку Global Configuration, включить аутентификацию по сертификатам и выбрать сам сертификат.
Кроме того, в настройках сайта необходимо будет поменять метод аутентификации.
Отмечу, что количество IPsec-туннелей зависит от размера развернутого Edge Gateway (об этом читайте в нашей статье).