Visite também: Br-Linux ·  VivaOLinux ·  LinuxSecurity ·  Dicas-L ·  NoticiasLinux ·  SoftwareLivre.org ·  [mais]
Voltar   Under-Linux.org > Sistemas Operacionais > Serviços > Redes/Protocolos
Fóruns Wiki Videos Grupos Sociais RSS Feeds FAQ Termos de Uso Contato Sobre Twitter
Registrar Blogs Calendário Marcar Fóruns Como Lidos

OpenVPN + Roteamento,

Tópico Trancado
 
Ferramentas do Tópico Avaliar Tópico
  #1 (permalink)  
Antigo 15-08-2008, 17:24
Avatar de Pupolin
 
Registrado em: Oct 2005
Posts: 1
Agradeceu: 0
Agradecido 0 vez(es) em 0 Posts
Reputação: 0
Pupolin não é muito famoso por essas bandas
Padrão OpenVPN + Roteamento,

Estou montando dois servers com OPENVpn, e tenho as seguitnes configuracoes:

Matrix - ip

eth0 172.17.0.1/24
eth1 201.50.245.129/26
tun1 10.17.0.1

matriz.conf
--dev tun1
--port 5001
############## 10.17.0.1 - Empresa - VIT ##############
############## 10.17.0.2 - Empresa - RJO ##############
--ifconfig 10.17.0.1 10.17.0.2
--secret /etc/openvpn/Key/key
--route-up "route add -net 172.17.1.0/24 gw 10.17.0.1"
--log /etc/openvpn/OpenvpnVIT.log
--comp-lzo
--ping-restart 15
--verb 3

Filial - IP

eth0 172.17.0.2/24
eth1 201.210.10.191/26
tun1 10.17.0.2

Filial.conf

--remote 201.50.245.129
--dev tun1
--port 5001
############## 10.17.0.1 - Empresa - VIT ##############
############## 10.17.0.2 - Empresa - RJO ##############
--ifconfig 10.17.0.2 10.17.0.1
--secret /etc/openvpn/Key/key
--route-up "route add -net 172.17.0.0/24 gw 10.17.0.2"
--log /etc/openvpn/OpenvpnRJO.log
--comp-lzo
--ping-restart 15
--verb 3


em ambas as maquinas dei o comando

echo >1 /proc/sys/net/ipv4/ip_forward

consigo fazer a conexao entre as duas, da filial pingo a interface tun1 e a da rede interna da Matriz e Vice-versa, porem nao consigo pingar as maquinas da rede interna, estou utilizando oTuxfrw 2.62, mesmo eu desativando o Tuxfrw, nao consigo pingar as maquinas, alguem pode me ajudar,

grato

Marcelo
  #2 (permalink)  
Antigo 16-08-2008, 13:40
Avatar de zenun
 
Registrado em: Sep 2005
Localização: Santa Catarina
Idade: 26
Posts: 496
Agradeceu: 3
Agradecido 77 vez(es) em 70 Posts
Envios no Blog: 10
Reputação: 110
zenun não é muito famoso por essas bandaszenun não é muito famoso por essas bandas
Padrão

Amigo...
Da uma olhadinha aqui nessa documentação do OpenVPN --> HOWTO

Ela fala exatamente do que você esta precisando!
Falta alguma configuração para que o que você quer funcione!
Faloww
__________________
Tecnol. André Marascalchi Zenun
andre.zenun@gmail.com (GoogleTalk)
CCNA (CSCO 11017645)

Blogs:
Yet Another Linux Blog
Under-linux.org Blog
Leia a FAQ da Under-linux.org
  #3 (permalink)  
Antigo 17-08-2008, 15:01
Avatar de amaia
 
Registrado em: Jan 2007
Localização: Paraíba
Posts: 162
Agradeceu: 8
Agradecido 33 vez(es) em 30 Posts
Reputação: 91
amaia não é muito famoso por essas bandasamaia não é muito famoso por essas bandasamaia não é muito famoso por essas bandasamaia não é muito famoso por essas bandasamaia não é muito famoso por essas bandas
Padrão roteamento openvpn

Ola,

Para que sua configuracao funcione com os ips que vc tem na eth0 da matriz e da filial, seria necessario que o openvpn estivesse configurado para funcionar em modo bridge, pois a os ips estao na mesma rede 172.17.0.0/24. Observando que neste caso nao pode existir duplicadade de ips entre os computadores da matriz e os computadores da filial.

Matriz - ip

eth0 172.17.0.1/24 -------> mesma rede usada na filial
eth1 201.50.245.129/26

Filial - IP

eth0 172.17.0.2/24 -------> mesma rede usada na matriz
eth1 201.210.10.191/26

Agora se for o caso, vc pode mudar a configuracao da rede ip ou da matriz ou da filial. Neste caso sera preciso adicionar na configuracao do openvpn uma opcao chamada ccd, em que vc determina a rede por traz de um ponto da vpn. O servidor faz a rota entre as duas redes de forma transparente.

Os passos para fazer este tipo de configuracao estao explicados na documentacao do Openvpn.
  #4 (permalink)  
Antigo 17-08-2008, 17:06
Avatar de zenun
 
Registrado em: Sep 2005
Localização: Santa Catarina
Idade: 26
Posts: 496
Agradeceu: 3
Agradecido 77 vez(es) em 70 Posts
Envios no Blog: 10
Reputação: 110
zenun não é muito famoso por essas bandaszenun não é muito famoso por essas bandas
Padrão

Você pode fazer essa configuração funcionar em modo ROTEADO também!
Não é preciso ser em modo bridge!
É preciso acrescentar um parametro na configuração do cliente chamado iroute!
Que irá indicar a rede interna! O OpenVPN saberá então que essa rede precisa ser roteada para um
determinado local!
__________________
Tecnol. André Marascalchi Zenun
andre.zenun@gmail.com (GoogleTalk)
CCNA (CSCO 11017645)

Blogs:
Yet Another Linux Blog
Under-linux.org Blog
Leia a FAQ da Under-linux.org

Última edição por zenun; 17-08-2008 às 17:08.. Motivo: Mais informação...
  #5 (permalink)  
Antigo 17-08-2008, 17:12
Avatar de zenun
 
Registrado em: Sep 2005
Localização: Santa Catarina
Idade: 26
Posts: 496
Agradeceu: 3
Agradecido 77 vez(es) em 70 Posts
Envios no Blog: 10
Reputação: 110
zenun não é muito famoso por essas bandaszenun não é muito famoso por essas bandas
Padrão

Aqui está o procedimento completo para fazer isso...
Tirado do site do OpenVPN:

Código:
Including multiple machines on the client side when using a routed VPN (dev tun)

  In a typical road-warrior or remote access scenario, the client machine connects to the VPN as a single machine. But suppose the client machine is a gateway for a local LAN (such as a home office), and you would like each machine on the client LAN to be able to route through the VPN.
  For this example, we will assume that the client LAN is using the 192.168.4.0/24 subnet, and that the VPN client is using a certificate with a common name of client2. Our goal is to set up the VPN so that any machine on the client LAN can communicate with any machine on the server LAN through the VPN.
  Before setup, there are some basic prerequisites which must be followed:
  
  • The client LAN subnet (192.168.4.0/24 in our example) must not be exported to the VPN by the server or any other client sites which are using the same subnet. Every subnet which is joined to the VPN via routing must be unique.
  • The client must have a unique Common Name in its certificate ("client2" in our example), and the duplicate-cn flag must not be used in the OpenVPN server configuration file.
First, make sure that IP and TUN/TAP forwarding is enabled on the client machine. Next, we will deal with the necessary configuration changes on the server side. If the server configuration file does not currently reference a client configuration directory, add one now:
client-config-dir ccd
In the above directive, ccd should be the name of a directory which has been pre-created in the default directory where the OpenVPN server daemon runs. On Linux this tends to be /etc/openvpn and on Windows it is usually \Program Files\OpenVPN\config. When a new client connects to the OpenVPN server, the daemon will check this directory for a file which matches the common name of the connecting client. If a matching file is found, it will be read and processed for additional configuration file directives to be applied to the named client. The next step is to create a file called client2 in the ccd directory. This file should contain the line:
iroute 192.168.4.0 255.255.255.0
This will tell the OpenVPN server that the 192.168.4.0/24 subnet should be routed to client2. Next, add the following line to the main server config file (not the ccd/client2 file):
route 192.168.4.0 255.255.255.0
Why the redundant route and iroute statements, you might ask? The reason is that route controls the routing from the kernel to the OpenVPN server (via the TUN interface) while iroute controls the routing from the OpenVPN server to the remote clients. Both are necessary. Next, ask yourself if you would like to allow network traffic between client2's subnet (192.168.4.0/24) and other clients of the OpenVPN server. If so, add the following to the server config file.
client-to-client push "route 192.168.4.0 255.255.255.0"
This will cause the OpenVPN server to advertise client2's subnet to other connecting clients. The last step, and one that is often forgotten, is to add a route to the server's LAN gateway which directs 192.168.4.0/24 to the OpenVPN server box (you won't need this if the OpenVPN server box is the gateway for the server LAN). Suppose you were missing this step and you tried to ping a machine (not the OpenVPN server itself) on the server LAN from 192.168.4.8? The outgoing ping would probably reach the machine, but then it wouldn't know how to route the ping reply, because it would have no idea how to reach 192.168.4.0/24. The rule of thumb to use is that when routing entire LANs through the VPN (when the VPN server is not the same machine as the LAN gateway), make sure that the gateway for the LAN routes all VPN subnets to the VPN server machine. Similarly, if the client machine running OpenVPN is not also the gateway for the client LAN, then the gateway for the client LAN must have a route which directs all subnets which should be reachable through the VPN to the OpenVPN client machine.
Falowww
__________________
Tecnol. André Marascalchi Zenun
andre.zenun@gmail.com (GoogleTalk)
CCNA (CSCO 11017645)

Blogs:
Yet Another Linux Blog
Under-linux.org Blog
Leia a FAQ da Under-linux.org
Tópico Trancado

Publicidade


Ferramentas do Tópico
Avaliar esse Tópico
Avaliar esse Tópico:

Regras para Posts
Você não pode postar novos tópicos
Você pode postar respostas
Você não pode postar anexos
Você não pode editar seus posts

Código [IMG] Sim
Código HTML Não
Trackbacks are Sim
Pingbacks are Sim
Refbacks are Não


Tópicos Similares
Tópico Tópico Iniciado Por Fórum Respostas Última Mensagem
Openvpn linux X Openvpn Windows -> Problema analistaslack Redes/Protocolos 2 29-11-2007 13:52
Openvpn 2.0.9 gilmarcabral Redes/Protocolos 3 21-11-2006 10:49
openvpn slackrio Adm. em Geral 6 04-03-2006 15:29
fight roteamento vs gsiena - roteamento 10 gsiena 0 gsiena Proxy/NAT/Firewall 0 14-11-2005 00:53
openvpn ianczyk Adm. em Geral 4 10-03-2005 17:03

Patrocinio

Horários baseados na GMT -3. Agora são 12:20.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 ©2009, Crawlability, Inc.