Подключение к FortiGate VPN через удаленная машина Linux через OpenSwan

Вот настройка:

У меня есть устройство FortiGate в бизнес-сети, в которой настроен FortiGate VPN. Машины в удаленной сети, на которых может работать FortiClient (машины Windows и Mac), не имеют проблем с подключением к этой VPN. Мне было поручено заставить Linux-машины подключаться к VPN, которая не поддерживается Fortigate.

Чтобы попытаться выяснить, как, у меня есть Ubuntu 16. 04, настроенный в удаленной сети, с запущенным OpenSwan, пытающимся подключиться к определенному туннелю, который я настроил для него на FortiGate.

На данный момент ближе всего к подключению я могу представить следующее:

002 "icms" #1: initiating Aggressive Mode #1, connection "icms"
113 "icms" #1: STATE_AGGR_I1: initiate
003 "icms" #1: received Vendor ID payload [RFC 3947] method set to=115 
003 "icms" #1: received Vendor ID payload [Dead Peer Detection]
003 "icms" #1: received Vendor ID payload [XAUTH]
003 "icms" #1: ignoring unknown Vendor ID payload [8299031757a36082c6a621de0005024d]
002 "icms" #1: Aggressive mode peer ID is ID_IPV4_ADDR: 'a.b.c.d'
003 "icms" #1: no suitable connection for peer 'a.b.c.d'
003 "icms" #1: initial Aggressive Mode packet claiming to be from a.b.c.d on a.b.c.d but no connection has been authorized
218 "icms" #1: STATE_AGGR_I1: INVALID_ID_INFORMATION
002 "icms" #1: sending notification INVALID_ID_INFORMATION to a.b.c.d:500

Где icms - это имя подключения, а abcd - это общедоступный IP-адрес FortiGate.

] Моя конфигурация /etc/ipsec.d/icms.conf:

conn icms  
    type=tunnel  
    authby=secret  
    pfs=no  
    ike=aes128-sha1;modp1536  
    phase2alg=aes128-sha1  
    aggrmode=yes  
    keylife=28800s  
    ikelifetime=1800s  
    right=a.b.c.d  
    rightnexthop=%defaultroute  
    rightsubnet=172.16.1.0/16
    left=e.f.g.h  
    leftnexthop=%defaultroute 
    auto=add  

'efgh' - это IP-адрес машины Ubuntu.

Мой /etc/ipsec.d/icms.secrets:

a.b.c.d : PSK "presharedsecret"

Любая помощь или совет вообще были бы признательны, и если я могу предоставить дополнительную информацию, пожалуйста, сообщите мне. Я пробовал несколько конфигураций туннелей OpenSwan и FortiGate, но пока безрезультатно.

РЕДАКТИРОВАТЬ 1: информация о конфигурации FortiGate!

config vpn ipsec phase1-interface
    edit "icms"
        set type static
        set interface "wan1"
        set ip-version 4
        set ike-version 1
        set local-gw 0.0.0.0
        set nattraversal enable
        set keylife 86400
        set authmethod psk
        set mode aggressive
        set peertype any
        set mode-cfg disable
        set proposal aes128-sha1 aes192-sha256
        set localid "icms"
        set localid-type auto
        set negotiate-timeout 30
        set fragmentation enable
        set dpd enable
        set forticlient-enforcement disable
        set comments "Phase1 to Remote Linux"
        set npu-offload enable
        set dhgrp 14 5
        set wizard-type custom
--More--                  set xauthtype disable
        set mesh-selector-type disable
        set remote-gw '<IP of Ubuntu Machine>'
        set monitor ''
        set add-gw-route disable
        set psksecret ENC <encrypted string>
        set keepalive 10
        set auto-negotiate enable
        set dpd-retrycount 3
        set dpd-retryinterval 5
    next
 end

И конфигурация fortigate для фазы 2:

config vpn ipsec phase2-interface

edit "@icms"
    set phase1name "icms"
    set proposal aes128-sha1 aes256-sha1 3des-sha1 aes128-sha256 aes256-sha256 3des-sha256
    set pfs disable
    set replay enable
    set keepalive disable
    set auto-negotiate enable
    set keylife-type seconds
    set encapsulation tunnel-mode
    set comments ''
    set protocol 0
    set src-addr-type subnet
    set src-port 0
    set dst-addr-type ip
    set dst-port 0
    set keylifeseconds 43200
    set src-subnet 172.16.1.0 255.255.255.248
    set dst-start-ip '<IP of Ubuntu Machine>'
next
end
3
задан 23 May 2016 в 17:15
3 ответа

Вы также можете загрузить клиент ssl vpn для Linux с их сайта поддержки, если у вас есть действующий контракт на поддержку, это может быть проще. Уже несколько лет пользуюсь разными версиями без проблем.

https://support.fortinet.com/Download/FirmwareImages.aspx

/ FortiGate / v5.00 / 5.2 / 5.2.7 / VPN / SSLVPNTools /

0
ответ дан 3 December 2019 в 08:01

Я занимался этим около трех дней. При включении IKEv1 возникает серьезная проблема между openswan и fortigate. Если вы переключите openswan на IKEv2 (используя ikev2 = insist) и, конечно же, фортигате на IKEv2 - все будет работать нормально.

ikev2=insist
keyexchange=ike
ike=aes256-sha1;modp1024
phase2=esp
phase2alg=aes256-sha1;modp1024
pfs=no
forceencaps=yes
aggrmode=yes
salifetime=3600s
ikelifetime=10800s
-1
ответ дан 3 December 2019 в 08:01

Если вы ' не привязан к OpenSwan, здесь обсуждение того, как подключиться к FortiGate через туннель IPsec VPN с помощью клиента strongSwan (хотя без DNS).

Аутентификация выполняется с использованием предварительный ключ и XAuth.

Соответствующая конфигурация из /etc/ipsec.conf :

# Introduction to IPsec: http://www.ipsec-howto.org/x202.html
config setup
  charondebug = "dmn 1, mgr 1, ike 2, chd 1, job 1, cfg 3, knl 2, net 2, lib 1"

conn myConn
  keyexchange = ikev1

  # Cipher used for the key exchange
  # modp3072 is Diffie Hellman group 15. Refer to this for other groups:
  # http://www.omnisecu.com/tcpip/what-is-diffie-hellman-group.php
  ike = aes128-sha256-modp3072
  esp = aes128-sha256-modp3072

  # You'll have to find out whether your FortiGate uses aggressive mode for
  # authentication. If it does, you must set "aggressive = yes" here to
  # connect successfully
  aggressive = yes

  right = 83.xxx.xxx.xx
  #right = vpn.the-vpn-server.com
  rightsubnet = 10.7.0.0/24
  rightid = %any
  rightauth = psk

  left = %defaultroute
  leftauth = psk
  leftauth2 = xauth
  # The user name used for authentication
  xauth_identity = "theuser"

  auto = start

/etc/ipsec.secrets :

# ipsec.secrets - strongSwan IPsec secrets file
: PSK "secret_preshared_key"
: XAUTH "secret_xauth_password"

Создайте туннель, используя sudo ipsec start --nofork .


Ресурсы о strongSwan:

1
ответ дан 3 December 2019 в 08:01

Теги

Похожие вопросы