{"id":308433,"date":"2020-08-13T15:00:55","date_gmt":"2020-08-13T15:00:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308433"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308433","title":{"rendered":"\u041a\u0430\u043a \u0442\u0440\u0430\u0431\u043b\u0448\u0443\u0442\u0438\u0442\u044c \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 IPsec VPN. \u0427\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/514996\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7x\/m9\/kx\/7xm9kxzlrefuar3kzjkbmjvksio.png\"\/><\/p>\n<h3>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0412\u044b\u0445\u043e\u0434\u043d\u043e\u0439. \u041f\u044c\u044e \u043a\u043e\u0444\u0435. \u0421\u0442\u0443\u0434\u0435\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u0447\u0435\u0437. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e: \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c, \u043d\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0442\u0443\u043d\u043d\u0435\u043b\u0435 \u043d\u0435\u0442. \u041d\u0430 \u0437\u0432\u043e\u043d\u043a\u0438 \u0441\u0442\u0443\u0434\u0435\u043d\u0442 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442.<\/p>\n<p>  \u0421\u0442\u0430\u0432\u043b\u044e \u0447\u0430\u0439\u043d\u0438\u043a \u0438 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u044e\u0441\u044c \u0432 \u0442\u0440\u0430\u0431\u043b\u0448\u0443\u0442\u0438\u043d\u0433 \u0421-\u0422\u0435\u0440\u0440\u0430 \u0428\u043b\u044e\u0437. \u0414\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0435\u0439.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p>  \u0414\u0432\u0435 \u0442\u0435\u0440\u0440\u0438\u0442\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b GRE \u0442\u0443\u043d\u043d\u0435\u043b\u0435\u043c. GRE \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_w\/hg\/p3\/_whgp32yxonip_2vteikgmfydw8.png\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c GRE \u0442\u0443\u043d\u043d\u0435\u043b\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e ping \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 R1 \u0434\u043e GRE \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 R2. \u042d\u0442\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u0442\u0432\u0435\u0442\u0430 \u043d\u0435\u0442:<\/p>\n<pre><code class=\"plaintext\">root@R1:~# ping 1.1.1.2 -c 4 PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data.  --- 1.1.1.2 ping statistics --- 4 packets transmitted, 0 received, 100% packet loss, time 3057ms<\/code><\/pre>\n<p>  \u0421\u043c\u043e\u0442\u0440\u044e \u043b\u043e\u0433\u0438 \u043d\u0430 Gate1 \u0438 Gate2. \u041b\u043e\u0433 \u0440\u0430\u0434\u043e\u0441\u0442\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e IPsec \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u043b\u0441\u044f, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<pre><code class=\"plaintext\">root@Gate1:~# cat \/var\/log\/cspvpngate.log Aug  5 16:14:23 localhost  vpnsvc: 00100119 &lt;4:1&gt; IPSec connection 5 established, traffic selector 172.17.0.1-&gt;172.16.0.1, proto 47, peer 10.10.10.251, id &quot;10.10.10.251&quot;, Filter  IPsec:Protect:CMAP:1:LIST, IPsecAction IPsecAction:CMAP:1, IKERule IKERule:CMAP:1<\/code><\/pre>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 IPsec \u0442\u0443\u043d\u043d\u0435\u043b\u044f \u043d\u0430 Gate1 \u0432\u0438\u0436\u0443, \u0447\u0442\u043e \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c, \u043d\u043e \u0441\u0447\u0435\u0442\u0447\u0438\u043a R\u0441vd \u043e\u0431\u043d\u0443\u043b\u0435\u043d:<\/p>\n<pre><code class=\"plaintext\">root@Gate1:~# sa_mgr show ISAKMP sessions: 0 initiated, 0 responded  ISAKMP connections: Num Conn-id (Local Addr,Port)-(Remote Addr,Port) State Sent Rcvd 1 3 (10.10.10.251,500)-(10.10.10.252,500) active 1070 1014  IPsec connections: Num Conn-id (Local Addr,Port)-(Remote Addr,Port) Protocol Action Type Sent Rcvd 1 3 (172.16.0.1,*)-(172.17.0.1,*) 47 ESP tunn 480 0<\/code><\/pre>\n<p>  \u042f \u0442\u0440\u0430\u0431\u043b\u0448\u0443\u0447\u0443 \u0421-\u0422\u0435\u0440\u0440\u0443 \u0442\u0430\u043a: \u0438\u0449\u0443, \u0433\u0434\u0435 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430 \u043f\u0443\u0442\u0438 \u043e\u0442 R1 \u0434\u043e R2. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440) \u043d\u0430\u0439\u0434\u0443 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<h3>\u0422\u0440\u0430\u0431\u043b\u0448\u0443\u0442\u0438\u043d\u0433<\/h3>\n<p>  <b>\u0428\u0430\u0433 1. \u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 Gate1 \u043e\u0442 R1<\/b><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u0441\u043d\u0438\u0444\u0444\u0435\u0440 \u2013 tcpdump. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0441\u043d\u0438\u0444\u0444\u0435\u0440 \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c (Gi0\/1 \u0432 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 Cisco-like \u0438\u043b\u0438 eth1 \u0432 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u041e\u0421 Debian) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435:<\/p>\n<pre><code class=\"plaintext\">root@Gate1:~# tcpdump -i eth1  tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes 14:53:38.879525 IP 172.16.0.1 &gt; 172.17.0.1: GREv0, key=0x1, length 92: IP 1.1.1.1 &gt; 1.1.1.2: ICMP echo request, id 2083, seq 1, length 64 14:53:39.896869 IP 172.16.0.1 &gt; 172.17.0.1: GREv0, key=0x1, length 92: IP 1.1.1.1 &gt; 1.1.1.2: ICMP echo request, id 2083, seq 2, length 64 14:53:40.921121 IP 172.16.0.1 &gt; 172.17.0.1: GREv0, key=0x1, length 92: IP 1.1.1.1 &gt; 1.1.1.2: ICMP echo request, id 2083, seq 3, length 64 14:53:41.944958 IP 172.16.0.1 &gt; 172.17.0.1: GREv0, key=0x1, length 92: IP 1.1.1.1 &gt; 1.1.1.2: ICMP echo request, id 2083, seq 4, length 64<\/code><\/pre>\n<p>  \u0412\u0438\u0436\u0443, \u0447\u0442\u043e Gate1 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043e\u0442 R1 GRE \u043f\u0430\u043a\u0435\u0442\u044b. \u0414\u0432\u0438\u0433\u0430\u044e\u0441\u044c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  <b>\u0428\u0430\u0433 2. \u0427\u0442\u043e Gate1 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441 GRE \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438<\/b><\/p>\n<p>  \u0423\u0442\u0438\u043b\u0438\u0442\u043e\u0439 klogview \u0441\u043c\u043e\u0442\u0440\u044e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 GRE \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 VPN \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0421-\u0422\u0435\u0440\u0440\u0430:<\/p>\n<pre><code class=\"plaintext\">root@Gate1:~# klogview -f 0xffffffff  filtration result for out packet 172.16.0.1-&gt;172.17.0.1, proto 47, len 112, if eth0: chain 4 &quot;IPsecPolicy:CMAP&quot;, filter 8, event id IPsec:Protect:CMAP:1:LIST, status PASS encapsulating with SA 31: 172.16.0.1-&gt;172.17.0.1, proto 47, len 112, if eth0 passed out packet 10.10.10.251-&gt;10.10.10.252, proto 50, len 160, if eth0: encapsulated <\/code><\/pre>\n<p>  \u0412\u0438\u0436\u0443, \u0447\u0442\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 GRE \u0442\u0440\u0430\u0444\u0438\u043a (proto 47) 172.16.0.1 -&gt; 172.17.0.1 \u043f\u043e\u043f\u0430\u043b (PASS) \u043f\u043e\u0434 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f LIST \u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u043a\u0430\u0440\u0442\u0435 CMAP \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043b\u0441\u044f (encapsulated). \u0414\u0430\u043b\u0435\u0435 \u043f\u0430\u043a\u0435\u0442 \u0441\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f (passed out). \u041e\u0442\u0432\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 klogview \u043d\u0435\u0442.<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0441\u043f\u0438\u0441\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 Gate1. \u0412\u0438\u0436\u0443 \u043e\u0434\u0438\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430 LIST, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0430\u0432\u0438\u043b \u041c\u042d \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e:<\/p>\n<pre><code class=\"plaintext\">Gate1#show access-lists Extended IP access list LIST     10 permit gre host 172.16.0.1 host 172.17.0.1<\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434: \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 Gate1.<\/p>\n<p>  <b>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e klogview<\/b><\/p>\n<p>  VPN \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0412\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u043d\u044b \u0432 klogview, \u0435\u0441\u043b\u0438 VPN \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043b \u0435\u0433\u043e \u0432 \u043d\u0435\u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435:<\/p>\n<pre><code class=\"plaintext\">root@R1:~# ping 172.17.0.1 -c 4<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">root@Gate1:~# klogview -f 0xffffffff  filtration result for out packet 172.16.0.1-&gt;172.17.0.1, proto 1, len 84, if eth0: chain 4 &quot;IPsecPolicy:CMAP&quot;: no match passed out packet 172.16.0.1-&gt;172.17.0.1, proto 1, len 84, if eth0: filtered<\/code><\/pre>\n<p>  \u0412\u0438\u0436\u0443, \u0447\u0442\u043e ICMP \u0442\u0440\u0430\u0444\u0438\u043a (proto 1) 172.16.0.1-&gt;172.17.0.1 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b (no match) \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0440\u0438\u043f\u0442\u043e\u043a\u0430\u0440\u0442\u044b CMAP. \u041f\u0430\u043a\u0435\u0442 \u0441\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f (passed out) \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435.<\/p>\n<p>  <b>\u0428\u0430\u0433 3. \u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 Gate2 \u043e\u0442 Gate1<\/b><\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0441\u043d\u0438\u0444\u0444\u0435\u0440 \u043d\u0430 WAN (eth0) \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Gate2:<\/p>\n<pre><code class=\"plaintext\">root@Gate2:~# tcpdump -i eth0 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 16:05:45.104195 IP 10.10.10.251 &gt; 10.10.10.252: ESP(spi=0x30088112,seq=0x1), length 140 16:05:46.093918 IP 10.10.10.251 &gt; 10.10.10.252: ESP(spi=0x30088112,seq=0x2), length 140 16:05:47.117078 IP 10.10.10.251 &gt; 10.10.10.252: ESP(spi=0x30088112,seq=0x3), length 140 16:05:48.141785 IP 10.10.10.251 &gt; 10.10.10.252: ESP(spi=0x30088112,seq=0x4), length 140<\/code><\/pre>\n<p>  \u0412\u0438\u0436\u0443, \u0447\u0442\u043e Gate2 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 ESP \u043f\u0430\u043a\u0435\u0442\u044b \u043e\u0442 Gate1.<\/p>\n<p>  <b>\u0428\u0430\u0433 4. \u0427\u0442\u043e Gate2 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441 ESP \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438<\/b><\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 klogview \u043d\u0430 Gate2:<\/p>\n<pre><code class=\"plaintext\">root@Gate2:~# klogview -f 0xffffffff filtration result for in packet 10.10.10.251-&gt;10.10.10.252, proto 50, len 160, if eth0: chain 17 &quot;FilterChain:L3VPN&quot;, filter 21, status DROP dropped in packet 10.10.10.251-&gt;10.10.10.252, proto 50, len 160, if eth0: firewall <\/code><\/pre>\n<p>  \u0412\u0438\u0436\u0443, \u0447\u0442\u043e ESP \u043f\u0430\u043a\u0435\u0442\u044b (proto 50) \u0431\u044b\u043b\u0438 \u0434\u0440\u043e\u043f\u043d\u0443\u0442\u044b (DROP), \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c (L3VPN) \u043c\u0435\u0436\u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 (firewall). \u0423\u0431\u0435\u0436\u0434\u0430\u044e\u0441\u044c, \u0447\u0442\u043e \u043a Gi0\/0 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430 L3VPN:<\/p>\n<pre><code class=\"plaintext\">Gate2#show ip interface gi0\/0 GigabitEthernet0\/0 is up, line protocol is up   Internet address is 10.10.10.252\/24   MTU is 1500 bytes   Outgoing access list is not set   Inbound  access list is L3VPN<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b.<\/p>\n<p>  <b>\u0428\u0430\u0433 5. \u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430<br \/>  <\/b><br \/>  \u0421\u043c\u043e\u0442\u0440\u044e, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430 L3VPN:<\/p>\n<pre><code class=\"plaintext\">Gate2#show access-list L3VPN Extended IP access list L3VPN     10 permit udp host 10.10.10.251 any eq isakmp     20 permit udp host 10.10.10.251 any eq non500-isakmp     30 permit icmp host 10.10.10.251 any<\/code><\/pre>\n<p>  \u0412\u0438\u0436\u0443, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b ISAKMP \u043f\u0430\u043a\u0435\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f IPsec \u0442\u0443\u043d\u043d\u0435\u043b\u044c. \u0410 \u0432\u043e\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f ESP \u043d\u0435\u0442. \u0412\u0438\u0434\u0438\u043c\u043e, \u0441\u0442\u0443\u0434\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b icmp \u0438 esp.<\/p>\n<p>  \u041f\u0440\u0430\u0432\u043b\u044e \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430:<\/p>\n<pre><code class=\"plaintext\">Gate2(config)# ip access-list extended L3VPN no 30 30 permit esp host 10.10.10.251 any<\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 6. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c<\/b><\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0443\u0431\u0435\u0436\u0434\u0430\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u0430 L3VPN \u0432\u0435\u0440\u043d\u044b\u0439:<\/p>\n<pre><code class=\"plaintext\">Gate2#show access-list L3VPN Extended IP access list L3VPN     10 permit udp host 10.10.10.251 any eq isakmp     20 permit udp host 10.10.10.251 any eq non500-isakmp     30 permit esp host 10.10.10.251 any<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 R1 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a:<\/p>\n<pre><code class=\"plaintext\">root@R1:~# ping 1.1.1.2 -c 4 PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data. 64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=35.3 ms 64 bytes from 1.1.1.2: icmp_seq=2 ttl=64 time=3.01 ms 64 bytes from 1.1.1.2: icmp_seq=3 ttl=64 time=2.65 ms 64 bytes from 1.1.1.2: icmp_seq=4 ttl=64 time=2.87 ms  --- 1.1.1.2 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3006ms rtt min\/avg\/max\/mdev = 2.650\/10.970\/35.338\/14.069 ms<\/code><\/pre>\n<p>  \u041f\u043e\u0431\u0435\u0434\u0430. GRE \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f. \u0421\u0447\u0435\u0442\u0447\u0438\u043a \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435 IPsec \u043d\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439:<\/p>\n<pre><code class=\"plaintext\">root@Gate1:~# sa_mgr show ISAKMP sessions: 0 initiated, 0 responded  ISAKMP connections: Num Conn-id (Local Addr,Port)-(Remote Addr,Port) State Sent Rcvd 1 3 (10.10.10.251,500)-(10.10.10.252,500) active 1474 1350  IPsec connections: Num Conn-id (Local Addr,Port)-(Remote Addr,Port) Protocol Action Type Sent Rcvd 1 4 (172.16.0.1,*)-(172.17.0.1,*) 47 ESP tunn 1920 480<\/code><\/pre>\n<p>  \u041d\u0430 \u0448\u043b\u044e\u0437\u0435 Gate2 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 klogview \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a 172.16.0.1-&gt;172.17.0.1 \u0443\u0441\u043f\u0435\u0448\u043d\u043e (PASS) \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d (decapsulated) \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c LIST \u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u043a\u0430\u0440\u0442\u0435 CMAP:<\/p>\n<pre><code class=\"plaintext\">root@Gate2:~# klogview -f 0xffffffff filtration result for in packet 172.16.0.1-&gt;172.17.0.1, proto 47, len 112, if eth0: chain 18 &quot;IPsecPolicy:CMAP&quot;, filter 25, event id IPsec:Protect:CMAP:1:LIST, status PASS passed in packet 172.16.0.1-&gt;172.17.0.1, proto 47, len 112, if eth0: decapsulated<\/code><\/pre>\n<p>  <b>\u0418\u0442\u043e\u0433\u0438<\/b><\/p>\n<p>  \u0421\u0442\u0443\u0434\u0435\u043d\u0442 \u043f\u043e\u0434\u043f\u043e\u0440\u0442\u0438\u043b \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439. <br \/>  \u0410\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0435\u0435 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u041c\u042d.<\/p>\n<p>  <i>\u0410\u043d\u043e\u043d\u0438\u043c\u043d\u044b\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440<br \/>  t.me\/anonimous_engineer<\/i><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/514996\/\"> https:\/\/habr.com\/ru\/post\/514996\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/514996\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7x\/m9\/kx\/7xm9kxzlrefuar3kzjkbmjvksio.png\"\/><\/p>\n<h3>\u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0412\u044b\u0445\u043e\u0434\u043d\u043e\u0439. \u041f\u044c\u044e \u043a\u043e\u0444\u0435. \u0421\u0442\u0443\u0434\u0435\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b VPN \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u0447\u0435\u0437. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u044e: \u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c, \u043d\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0432 \u0442\u0443\u043d\u043d\u0435\u043b\u0435 \u043d\u0435\u0442. \u041d\u0430 \u0437\u0432\u043e\u043d\u043a\u0438 \u0441\u0442\u0443\u0434\u0435\u043d\u0442 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442.<\/p>\n<p>  \u0421\u0442\u0430\u0432\u043b\u044e \u0447\u0430\u0439\u043d\u0438\u043a \u0438 \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u044e\u0441\u044c \u0432 \u0442\u0440\u0430\u0431\u043b\u0448\u0443\u0442\u0438\u043d\u0433 \u0421-\u0422\u0435\u0440\u0440\u0430 \u0428\u043b\u044e\u0437. \u0414\u0435\u043b\u044e\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0435\u0439.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-308433","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308433"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308433\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}