HUmm....Bom desculpa perguntar, com certeza se já deve ter jeito isso, mas vc liberou a porta udp 500, e os protocolos 50 e 51 para se comunicarem entre os gateways, se já o problema é complicado mesmo.....
Versão Imprimível
HUmm....Bom desculpa perguntar, com certeza se já deve ter jeito isso, mas vc liberou a porta udp 500, e os protocolos 50 e 51 para se comunicarem entre os gateways, se já o problema é complicado mesmo.....
Oke tem dentro desse include? :P Comentai isso ai
Ai vai meu ipsec.conf ... que na verdade não está tão igual assim e vai tbem algumas informações adicionais :
_________________________________________________________
# vi ipsec.conf
version 2.0
config setup
interfaces=%defaultroute
klipsdebug=all
plutodebug=all
conn %default
authby=rsasig
conn sede-filial
left=172.21.0.100 (ip interno do modem )
leftsubnet=192.168.0.0/24
[email protected]
leftnexthop=200.XX.XX.25 ( é o ip fixo da conexão adsl (modem))
leftrsasigkey=0sAQ...
right=172.21.2.100 ( ip interno do outro modem )
rightsubnet=192.168.2.0/24
[email protected]
rightnexthop=200.XX.XX.38
rightrsasigkey=0sAQPb
auto=add
#Disable Opportunistic Encryption
include /etc/ipsec.d/examples/no_oe.conf
_______________________________________________________
# ipsec verify
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.4.4/K2.6.14 (netkey)
Checking for IPsec support in kernel [OK]
Checking for RSA private key (/etc/ipsec.secrets) [OK]
Checking that pluto is running [OK]
Two or more interfaces found, checking IP forwarding [OK]
Checking NAT and MASQUERADEing
Checking for 'ip' command [OK]
Checking for 'iptables' command [OK]
Checking for 'setkey' command for NETKEY IPsec stack support [OK]
Opportunistic Encryption Support [DISABLED]
_________________________________________________________
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.21.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.21.0.1 0.0.0.0 UG 1 0 0 eth1
É parceiro ... já liberei as portas que vc citou ... com as seguintes regras :
echo "T) Liberando Openswan - Porta UDP 500 aberta e os protocolos 50 e 51 tbem"
iptables -A INPUT -p udp --dport 500 -j ACCEPT
iptables -A INPUT -p udp --sport 500 -j ACCEPT
iptables -A INPUT -p 50 -j ACCEPT
iptables -A INPUT -p 51 -j ACCEPT
iptables -A FORWARD -p udp --dport 500 -j ACCEPT
iptables -A FORWARD -p udp --sport 500 -j ACCEPT
iptables -A FORWARD -p 50 -j ACCEPT
iptables -A FORWARD -p 51 -j ACCEPT
# liberando a transicao de pacotes da rede interna daqui com a rede interna de lá
iptables -A FORWARD -s $REDEINTERNA -d $REDEVPN1 -j ACCEPT
iptables -A FORWARD -d $REDEINTERNA -s $REDEVPN1 -j ACCEPT
Adicionei tbem essa regra, pois nao pode fazer mascaramento dos pacotes que passam pelo tunel :
iptables -t nat -A POSTROUTING -o eth1 -s $REDEINTERNA -d \! $REDEVPN1 -j MASQUERADE