Como passar apenas o tráfego do navegador para a conexão openvpn

6

Eu configurei com sucesso uma conexão openvpn. Usando os parâmetros

redirect-gateway def1
dhcp-option DNS 10.8.0.1

todo o tráfego passará pela VPN, mas eu quero apenas que uma aplicação específica (como um navegador (por exemplo, Firefox)) use a conexão openvpn. Todo o outro tráfego deve passar pelo gateway regular.

Posso usar as configurações socks / proxy para apontar para o link openvpn de alguma forma? Talvez eu possa usar massa para criar este link? Se sim, como?

A propósito, isso está no sistema operacional Windows.

    
por droidgren 25.02.2013 / 20:43

3 respostas

1

Eu tinha especificamente esse problema e não consegui encontrar uma solução fácil de usar. Basicamente, a abordagem ainda é configurar o servidor SOCKS no servidor VPN. Eu fiz essa imagem do Docker para torná-la realmente utilizável

link

Inicie isso e configure seu navegador para usar o proxy SOCKS em local.docker:1081

A maioria dos aplicativos pode ser forçada a passar por isso mesmo que não haja uma configuração de proxy incorporada. Veja proxies

    
por 11.06.2016 / 11:42
-1

Sim, você pode usar um proxy SOCKS (ou um proxy comum) e simplesmente verificar se o tráfego para esse proxy passa pela VPN. [Claro, se você estiver usando o SSH, uma VPN será redundante]. Você deseja remover a instrução "redirect-gateway def1", possivelmente deixando-a completamente ou substituindo-a por "redirect-private".

Você precisa estar ciente de que o tráfego DNS pode vazar sua rede existente se os servidores de nomes não estiverem no outro lado da VPN.

O Putty pode ser usado para criar uma conexão de meias.

A maneira Unix (aparentemente também funciona com Putty) - Na linha de comando

putty -D 8080 username@remotehost

(Onde 8080 é a porta SOCKS)

O caminho do Windows: De link (e repetido aqui caso o site desapareça)

  1. Open PuTTY.
  2. Where it says 'Host Name (or IP address)' and has a box underneath it, enter the name of your SSH host into the box.
  3. Under 'Saved Sessions' enter a name for this connection that will help you remember it later. For example, you could call it 'SSH Proxy' so you know this will be the proxy connection.
  4. In the 'Category:' menu on the left, expand the 'Connection' menu list if it is not expanded already. Expand the 'SSH' menu list if that one is not expanded already. Click 'Tunnels' (underneath 'SSH'). This opens the options where you will enter the settings for PuTTY to create the tunnel.
  5. Under 'Add new forwarded port:' enter 9853
  6. Where it says 'Destination' leave that field blank but be sure to select the 'Dynamic' option underneath it.
  7. Click the 'Add' button to add this port.
  8. In the 'Category:' menu on the left, click the click 'Connection'.
  9. Where it says 'Seconds between keepalives (0 to turn off)' enter 5 in the box. This will keep your connection alive and prevent it from timing out even when you walk away from the computer for a while.
  10. In the 'Category:' menu on the left, click 'Session' at the very top to go back to the first screen.
  11. Click the 'Save' button to save all of the settings you just entered. Later you will not have to enter these settings again in the future, you will only need to load up your saved profile (by double-clicking it after you open PuTTY) every time you wish to connect to the proxy.
  12. Click the 'Open' button to open the connection to the proxy.
  13. When connected you will be asked for your username and password. Enter the username and password for your account. Once connected the tunnel is open. After you are finished using the tunnel, type logout and press Enter.
    
por 25.02.2013 / 22:11
-2

Se, de fato, você está solicitando especificamente aplicativos que ofereçam suporte a servidores proxy, a resposta é bem simples: use um servidor proxy!

Sua conexão VPN deve ser configurada para não modificar o gateway padrão dos clientes. Dessa forma, todo o tráfego usa a rota regular para a internet.

Suponho que sua conexão VPN usa 10.20.30.0/24 como sub-rede, com 10.20.30.1 sendo o endereço IP do servidor.

Configure um proxy (squid, ou talvez algo mais leve) no seu servidor VPN e configure-o para ouvir os clientes em 10.20.30.1 . Aponte seu navegador (ou qualquer outro) para o proxy em 10.20.30.1 . O tráfego para este endereço IP será sempre encaminhado através da sua conexão VPN.

    
por 07.07.2014 / 14:58