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

    [Resolvido] OpenVPN X Client Ubuntu 12.04

    Scheduled Pinned Locked Moved Portuguese
    6 Posts 2 Posters 2.9k 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.
    • H
      hugo.andrade
      last edited by

      Boa tarde galera,

      Tenho uma VPN - Peer to Peer (shared Key) configurada em meu pfSense com outros clientes pfSense conectando belezinha. Agora preciso conectar um client que é Ubuntu Server 12.04 e gostaria da ajuda de vcs para faze-lo.
      Alguem poderia me ajudar com os procedimentos ou dicas de instalação e configuração desse client?

      PS: Esse client Ubuntu já está com o OpenVPN instalado mas ainda não foi configurado.

      Desde já agradeço a atenção dispensada por todos

      Att,

      Hugo Alexandre

      1 Reply Last reply Reply Quote 0
      • G
        gilmarcabral
        last edited by

        Bom dia.
        Primeiro passo e instalar o a openvpn no servidor ubuntu.
        Segundo passo e efetuar a configuração dentro do diretório /etc/openvpn.
        Neste diretório deve conter o arquivo de configuração, arquivo de rota e a chave.key.
        Segue abaixo um exemplo de configuração.

        Interface Virtual VPN

        dev tun1

        Cria Tunnel persistente

        persist-tun
        persist-key

        Endereco do Servidor VPN valido

        remote IP_PFSENSE PORTA

        Criptografia, conferir como esta no pfsense

        cipher AES-128-CBC

        Procolo

        proto udp

        Rede tunel VPN

        IP servidor tunel filial

        IP servidor tunel matriz

        ifconfig 10.2.2.2 10.2.2.1

        Rede tunel VPN

        IP servidor tunel filial

        IP servidor tunel matriz

        cd /etc/openvpn
        up ./rede2.up

        Chave da Criptografia gerada pelo Serv VPN

        secret cacu2.key

        Downgrade UID and GID to

        "nobody" after initialization

        for extra security.

        user nobody
        group nobody

        If you built OpenVPN with

        LZO compression, uncomment

        out the following line.

        comp-lzo

        Send a UDP ping to remote once

        every 15 seconds to keep

        stateful firewall connection

        alive.  Uncomment this

        out if you are using a stateful

        firewall.

        ping 15

        Uncomment this section for a more reliable detection when a system

        loses its connection.  For example, dial-ups or laptops that

        travel to other locations.

        ping-restart 45
        ping-timer-rem
        persist-tun
        persist-key

        Logs

        status /var/log/openvpn-status.log
        log /var/log/openvpn.log

        arquivo de rota.

        route add -net 192.168.1.0 netmask 255.255.255.0 gw 10.2.2.1

        Para subir o serviço utilize o comando abaixo.
        /usr/sbin/openvpn –config /etc/openvpn/cacu-pfsense.conf --script-security 3 system --daemon

        1 Reply Last reply Reply Quote 0
        • H
          hugo.andrade
          last edited by

          Olha como está meu arquivo conf no client

          dev tun
          persist-tun
          persist-key
          proto udp
          cipher AES-128-CBC
          client
          resolv-retry infinite
          remote xxx.xxx.xxx.xxx 1194
          route 131.195.2.0 255.255.255.0
          ifconfig 172.16.0.2 172.16.0.1
          keepalive 10 60
          ping-timer-rem
          secret server-firewall-udp-1194.secret
          status /var/log/openvpn-status.log
          log /var/log/openvpn.log

          Meu log está dando essa mensagem:
          Options error: specify only one of –tls-server, --tls-client, or --secret
          Use --help for more information.

          1 Reply Last reply Reply Quote 0
          • G
            gilmarcabral
            last edited by

            Tenta adaptar a configuração que lhe enviei para a sua e jogar no ubuntu.

            1 Reply Last reply Reply Quote 0
            • H
              hugo.andrade
              last edited by

              Perfeito gilmarcabral

              Adaptei meu conf ao que vc me enviou e conectou belezinha

              Olha como ele ficou ai
              Valeu pela grande ajuda
              Abraço

              ######## openvpn.conf ###############
              dev tun
              persist-tun
              persist-key
              remote xxx.xxx.xxx.xxx 1194
              cipher AES-128-CBC
              proto udp
              ifconfig 172.16.0.2 172.16.0.1
              secret server-firewall-udp-1194.secret
              comp-lzo
              ping 15
              ping-restart 45
              ping-timer-rem
              persist-tun
              persist-key
              status /var/log/openvpn-status.log
              log /var/log/openvpn.log
              route 131.195.2.0 255.255.255.0

              1 Reply Last reply Reply Quote 0
              • G
                gilmarcabral
                last edited by

                Blz então.

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