Masquerade clients as the StrongServer in order to access resource through the IPSEC tunnel

                                                                                                                +----------+
                                                                                                        +-------+ Client 1 |
    +--------------+             +---------------+         +----------+           +------------+        |       +----------+
    |  Web Server  +-------------+ Cisco ASA5585 +---------+ Internet +-----------+ StrongSwan +--------+       IP: 10.2.0.1
    +--------------+             +---------------+         +----------+           +------------+        |
                                                                                                        |       +----------+
                                                                                                        +-------+ Client 2 |
   Internal Web server          External IP: 1.1.1.1                           External IP: 2.2.2.2             +----------+
   https://some.webservice.net                                                 Internal IP: 10.1.0.1            IP: 10.3.0.1
   192.168.0.1:443
  • Clients 1 and 2 are in different /20 subnets and need to access the internal web server on the remote side through the host to host IPSEC VPN tunnel between the StrongSwan server and a remote Cisco ASA device.

  • We don't have any control over the remote side.

  • We have routing in place to allow client 1 and client 2 to reach the StrongSwan server.

  • We have the tunnel established between the StrongSwan server and the Cisco ASA device.

  • We have IP forwarding enabled on the StrongSwan server.

I'm trying to find out whether its feasible to use iptunnel to masquerade clients 1 and 2 as the StrongSwan server itself in order to allow them to access the internal web server at the remote side of the tunnel.

0
задан 28 September 2017 в 16:00
2 ответа

Простой способ подключения к веб-серверу с машины StrongSwan будет заключаться в установке прокси-сервера, например squid , и использовании его от клиентов вместо прямого подключения к веб-серверу.

В зависимости от того, к какому типу ресурсов клиенты хотят получить доступ на веб-сервере, полностью развернутый кальмар может оказаться излишним. Если это только порт 443,и вам не нужен порт 443 на StronSwan для других целей, вы можете использовать опцию перенаправления для xinetd на StrongSwan. Это сделает необходимые записи etc / hosts в ваших клиентах, в противном случае сертификат веб-сервера будет отклонен из-за очевидного несоответствия имени. Есть и другие TCP-прокси, кроме xinetd redirect, но вы поняли идею.

0
ответ дан 5 December 2019 в 07:25

Вы можете сделать это с помощью iptables , настроенного в окне StrongSwan.

iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth0 -m policy --dir out --pol ipsec -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE

предполагая, что eth0 - это ваш исходящий эфир (Ethernet в Интернет)

0
ответ дан 5 December 2019 в 07:25

Теги

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