Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    IPsec Проблема с подключением

    Scheduled Pinned Locked Moved Russian
    3 Posts 2 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      k0tb3g3m0t
      last edited by

      В двух офисах в качестве пограничного устройства установлен pfSense.
      Офис 1
      WAN 1.1.1.1
      LAN 10.10.0.0/16
      Офис 2
      WAN 2.2.2.2
      LAN 10.20.0.0/16

      Пытаюсь поднять IPsec. Все по инструкции.

      Конфиг Офис 1
      <ipsec>
      <vtimaps></vtimaps>
      <client></client>
      <logging>
      <dmn>1</dmn>
      <mgr>1</mgr>
      <ike>2</ike>
      <chd>2</chd>
      <job>1</job>
      <cfg>2</cfg>
      <knl>1</knl>
      <net>1</net>
      <asn>1</asn>
      <enc>1</enc>
      <imc>1</imc>
      <imv>1</imv>
      <pts>1</pts>
      <tls>1</tls>
      <esp>1</esp>
      <lib>1</lib>
      </logging>
      <async_crypto>disabled</async_crypto>
      <uniqueids>replace</uniqueids>
      <filtermode>enc</filtermode>
      <bypassrules></bypassrules>
      <phase1>
      <ikeid>1</ikeid>
      <iketype>ikev2</iketype>
      <interface>wan</interface>
      <remote-gateway>2.2.2.2</remote-gateway>
      <protocol>inet</protocol>
      <myid_type>myaddress</myid_type>
      <myid_data></myid_data>
      <peerid_type>peeraddress</peerid_type>
      <peerid_data>2.2.2.2</peerid_data>
      <encryption>
      <item>
      <encryption-algorithm>
      <name>3des</name>
      <keylen></keylen>
      </encryption-algorithm>
      <hash-algorithm>md5</hash-algorithm>
      <prf-algorithm>sha256</prf-algorithm>
      <dhgroup>2</dhgroup>
      </item>
      </encryption>
      <lifetime>3600</lifetime>
      <rekey_time></rekey_time>
      <reauth_time></reauth_time>
      <rand_time></rand_time>
      <pre-shared-key>1111</pre-shared-key>
      <private-key></private-key>
      <certref></certref>
      <pkcs11certref></pkcs11certref>
      <pkcs11pin></pkcs11pin>
      <caref></caref>
      <authentication_method>pre_shared_key</authentication_method>
      <descr><![CDATA[TUNNEL]]></descr>
      <nat_traversal>force</nat_traversal>
      <mobike>off</mobike>
      <startaction></startaction>
      <closeaction></closeaction>
      <dpd_delay>10</dpd_delay>
      <dpd_maxfail>5</dpd_maxfail>
      </phase1>
      <phase2>
      <ikeid>1</ikeid>
      <uniqid>xxx</uniqid>
      <mode>tunnel</mode>
      <reqid>1</reqid>
      <localid>
      <type>lan</type>
      </localid>
      <remoteid>
      <type>network</type>
      <address>10.20.0.0</address>
      <netbits>16</netbits>
      </remoteid>
      <protocol>esp</protocol>
      <encryption-algorithm-option>
      <name>3des</name>
      </encryption-algorithm-option>
      <hash-algorithm-option>hmac_md5</hash-algorithm-option>
      <pfsgroup>2</pfsgroup>
      <lifetime>3600</lifetime>
      <rekey_time></rekey_time>
      <rand_time></rand_time>
      <pinghost></pinghost>
      <descr></descr>
      </phase2>
      <noshuntlaninterfaces></noshuntlaninterfaces>
      <enableinterfacesuse></enableinterfacesuse>
      <acceptunencryptedmainmode></acceptunencryptedmainmode>
      </ipsec>

      Конфиг Офис 2

      <ipsec>
      <vtimaps></vtimaps>
      <client></client>
      <phase1>
      <ikeid>2</ikeid>
      <iketype>ikev2</iketype>
      <interface>wan</interface>
      <remote-gateway>1.1.1.1</remote-gateway>
      <protocol>inet</protocol>
      <myid_type>myaddress</myid_type>
      <myid_data></myid_data>
      <peerid_type>peeraddress</peerid_type>
      <peerid_data>1.1.1.1</peerid_data>
      <encryption>
      <item>
      <encryption-algorithm>
      <name>3des</name>
      <keylen></keylen>
      </encryption-algorithm>
      <hash-algorithm>md5</hash-algorithm>
      <prf-algorithm>sha256</prf-algorithm>
      <dhgroup>2</dhgroup>
      </item>
      </encryption>
      <lifetime>3600</lifetime>
      <rekey_time></rekey_time>
      <reauth_time></reauth_time>
      <rand_time></rand_time>
      <pre-shared-key>1111</pre-shared-key>
      <private-key></private-key>
      <certref></certref>
      <pkcs11certref></pkcs11certref>
      <pkcs11pin></pkcs11pin>
      <caref></caref>
      <authentication_method>pre_shared_key</authentication_method>
      <descr><![CDATA[TUNNEL]]></descr>
      <nat_traversal>force</nat_traversal>
      <mobike>off</mobike>
      <startaction>none</startaction>
      <closeaction></closeaction>
      <dpd_delay>10</dpd_delay>
      <dpd_maxfail>5</dpd_maxfail>
      </phase1>
      <phase2>
      <ikeid>2</ikeid>
      <uniqid>xxx</uniqid>
      <mode>tunnel</mode>
      <reqid>2</reqid>
      <localid>
      <type>lan</type>
      </localid>
      <remoteid>
      <type>network</type>
      <address>10.10.00.0</address>
      <netbits>16</netbits>
      </remoteid>
      <protocol>esp</protocol>
      <encryption-algorithm-option>
      <name>3des</name>
      </encryption-algorithm-option>
      <hash-algorithm-option>hmac_md5</hash-algorithm-option>
      <pfsgroup>2</pfsgroup>
      <lifetime>3600</lifetime>
      <rekey_time></rekey_time>
      <rand_time></rand_time>
      <pinghost></pinghost>
      <descr></descr>
      </phase2>
      <logging>
      <dmn>1</dmn>
      <mgr>1</mgr>
      <ike>2</ike>
      <chd>2</chd>
      <job>1</job>
      <cfg>2</cfg>
      <knl>1</knl>
      <net>1</net>
      <asn>1</asn>
      <enc>1</enc>
      <imc>1</imc>
      <imv>1</imv>
      <pts>1</pts>
      <tls>1</tls>
      <esp>1</esp>
      <lib>1</lib>
      </logging>
      <noshuntlaninterfaces></noshuntlaninterfaces>
      <async_crypto>disabled</async_crypto>
      <uniqueids>replace</uniqueids>
      <filtermode>enc</filtermode>
      <bypassrules></bypassrules>
      <enableinterfacesuse></enableinterfacesuse>
      <acceptunencryptedmainmode></acceptunencryptedmainmode>
      </ipsec>

      В правилах файрволла для IPsec разрешен любой трафик IPv4
      Добавлены разрешающие правила для LAN (указаны удаленные сети)

      Соединение устанавливается, но почему то статус IPsec информирует что не отправляются пакеты со стороны Офиса 1:
      Bytes-In: 31,784 (31 KiB)
      Packets-In: 1,096
      Bytes-Out: 0 (0 B)
      Packets-Out: 0

      Также, пинг с pfSense Офиса 2 доходит с положительным ответом до pfSense Офиса 1, а в обратную сторону нет.
      MTR с указанием IP адреса pfSense Офиса 2 говорит, что трафик уходит в интернет.

      В чем может быть проблема?

      werterW 1 Reply Last reply Reply Quote 0
      • werterW
        werter @k0tb3g3m0t
        last edited by werter

        Добрый.
        @k0tb3g3m0t
        Рекомендую ipsec vti.
        И внимательно с конфигом https://docs.netgate.com/pfsense/en/latest/vpn/performance.html

        Ps. Проверьте ЛС.

        K 1 Reply Last reply Reply Quote 2
        • K
          k0tb3g3m0t @werter
          last edited by

          @werter
          Спасибо,
          Проблема решилась VTI + Routing

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.