+ Responder ao Tópico



  1. #1

    Padrão Openswan: Não consigo pingar a rede interna depois d VPN fechada

    Olá Senhores,

    Fechei uma VPN usando o Openswan com um equipamento Sonicwall NSA E5500.

    VPN fechada aparentemente funcionando. Quando tento pingar a rede interna de onde se encontra o equipamento Sonicwall eu não consigo.

    Adicionei na tabela de roteamento o ip da rede interna do sonicawall que é 172.16.60.114/32 e lá ele fez a mesma coisa adicionou o endereço da minha rede interna na tabela de roteamento dele 192.168.2.10/32.

    Abaixo meu arquivo de conf da VPN:

    conn busca
    keyexchange=ike
    aggrmode=no
    type=tunnel
    ike=aes256-sha1-modp1024
    phase2=esp
    phase2alg=aes256-sha1
    pfs=no
    ikelifetime=24h
    keylife=1h
    left=200.98.164.XXX
    leftsubnet=192.168.2.10/32
    leftnexthop=%defaultroute
    right=189.125.42.XXX
    rightsubnet=172.16.60.114/32
    rightnexthop=%defaultroute
    authby=secret
    auto=add

    Tabela de roteamento:

    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    172.16.60.144 * 255.255.255.255 UH 0 0 0 eth2
    200.98.160.0 * 255.255.248.0 U 0 0 0 eth2
    default 200-98-160-1.cl 0.0.0.0 UG 100 0 0 eth2




    abaixo vou listar minhas regras no iptables:

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT esp -- anywhere anywhere
    ACCEPT udp -- anywhere anywhere udp spt:4500 dpt:4500
    ACCEPT udp -- anywhere anywhere udp spt:isakmp dpt:isakmp
    ACCEPT udp -- anywhere anywhere udp spt:isakmp dpt:isakmp
    ACCEPT esp -- anywhere anywhere
    ACCEPT ah -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere tcp spt:2020 dpt:2020
    ACCEPT all -- anywhere buscape
    root@200-98-164-172:~# iptables -L
    Chain INPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT all -- 172.16.60.114 anywhere
    ACCEPT esp -- anywhere anywhere
    ACCEPT udp -- anywhere anywhere udp spt:4500 dpt:4500
    ACCEPT udp -- anywhere anywhere udp spt:isakmp dpt:isakmp
    ACCEPT udp -- anywhere anywhere udp spt:isakmp dpt:isakmp
    ACCEPT esp -- anywhere anywhere
    ACCEPT ah -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere tcp spt:2020 dpt:2020

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination
    ACCEPT icmp -- 192.168.2.10 anywhere
    ACCEPT all -- anywhere 172.16.60.114

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination
    ACCEPT esp -- anywhere anywhere
    ACCEPT udp -- anywhere anywhere udp spt:4500 dpt:4500
    ACCEPT udp -- anywhere anywhere udp spt:isakmp dpt:isakmp
    ACCEPT udp -- anywhere anywhere udp spt:isakmp dpt:isakmp
    ACCEPT esp -- anywhere anywhere
    ACCEPT ah -- anywhere anywhere
    ACCEPT tcp -- anywhere anywhere tcp spt:2020 dpt:2020
    ACCEPT all -- anywhere 172.16.60.114



    Não tenho nenhuma regra de NAT.

    Na rede do sonicwall está liberado ping etc etc. Quando dou um tracepath ele não sai do meu endereço.

    Acredito que esteja faltando alguma regra que não estou sabendo qual é.

    Meu objetivo é a rede 192.168.2.10/32 pingar a 172.16.60.114/32.

    Fazendo alguns testes quando filtro o tcpdump com ICMP ele só da resquest e não vem nenhum reply.

    # tcpdump -i eth2 -n net 172.16.60.114 and icmp
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on eth2, link-type EN10MB (Ethernet), capture size 96 bytes
    09:14:27.950115 IP 172.16.60.114 > 192.168.2.10: ICMP echo request, id 1, seq 21861, length 40
    09:14:27.950176 IP 172.16.60.114 > 192.168.2.10: ICMP echo request, id 1, seq 21861, length 40
    09:14:28.449981 IP 172.16.60.114 > 192.168.2.10: ICMP echo request, id 1, seq 21862, length 40
    09:14:28.450043 IP 172.16.60.114 > 192.168.2.10: ICMP echo request, id 1, seq 21862, length 40


    Desde já agradeço a ajuda.

    Vitor Alves

  2. #2

    Padrão Re: Openswan: Não consigo pingar a rede interna depois d VPN fechada

    Olha, faz uns 8 anos que uso openswan, mas me lembro muito bem de como era chato colocar para funcionar. Mude estas linhas na sua configuracao:

    De:
    left=200.98.164.XXX
    leftsubnet=192.168.2.10/32
    leftnexthop=%defaultroute
    right=189.125.42.XXX
    rightsubnet=172.16.60.114/32
    rightnexthop=%defaultroute

    Para:
    left=200.98.164.XXX
    leftsubnet=192.168.2.0/24
    leftnexthop=%defaultroute
    right=189.125.42.XXX
    rightsubnet=172.16.60.0/24
    rightnexthop=%defaultroute

    Assim deve permitir que os hosts de uma rede pinguem os hosts da outra rede, como vc colocou esta limitando a comunicao somente aos gateways.
    Outra coisa, da epoca de eu usava openswan, eu usava a opcao de road warrior para os pontos dos clientes, assim quando adicionava um novo ponto, ou me conectava de casa, nao precisava de configuracao especifica.

  3. #3

    Padrão Re: Openswan: Não consigo pingar a rede interna depois d VPN fechada

    Para essa alteração preciso trocar na outra ponta tb essa informação, sendo que a outra ponta eu nao tenho acesso tenho que pedir para um técnico de lá.

    Minha dúvida é se pode ser alguma coisa de firewall bloqueando? Sendo que eu faço um tracepath e não saio do meu roteador e ele lá tb faz um tracepath e tb não sai do roteador dele.

    Estou ficando maluco com esse problema.

  4. #4

    Padrão Re: Openswan: Não consigo pingar a rede interna depois d VPN fechada (RESOLVIDO)

    Consegui resolver.

    Criei uma interface virtual com o ip 192.168.2.10/32

    e fiz as seguintes regras:

    iptables -t nat -I PREROUTING -d 192.168.2.10 -p tcp --dport 80 -l DNAT --to 200.98.164.xxx

    iptables -t nat -I POSTROUTING -s 200.98.164.xxx -j SNAT --to 192.168.2.10


    Abraços.

  5. #5

    Unhappy Re: Openswan: Não consigo pingar a rede interna depois d VPN fechada

    Depois de ter adicionado as regras ai de cima fiquei sem navegar na internet.

  6. #6

    Padrão Re: Openswan: Não consigo pingar a rede interna depois d VPN fechada

    bom dia

    após eu conectar na VPN ( usando rb 750 ) eu não consigo usar a internet local..

    vc sabe como liberar as 2 ?

    preciso desse serviço

    skype: siqueiranet