luizbueno
(usa CentOS)
Enviado em 11/12/2012 - 13:39h
Abaixo segue o arquivo de configuração
# /etc/ipsec.conf - Openswan IPsec configuration file
# RCSID $Id: ipsec.conf.in,v 1.15.2.6 2006-10-19 03:49:46 paul Exp $
# This file: /usr/share/doc/openswan/ipsec.conf-sample
#
# Manual: ipsec.conf.5
version 2.0 # conforms to second version of ipsec.conf specification
# basic configuration
config setup
# plutodebug / klipsdebug = "all", "none" or a combation from below:
# "raw crypt parsing emitting control klips pfkey natt x509 private"
# eg: plutodebug="control parsing"
#
# ONLY enable plutodebug=all or klipsdebug=all if you are a developer !!
#
# NAT-TRAVERSAL support, see README.NAT-Traversal
#nat_traversal=yes
# virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/24,%v4:172.16.0.0/12
#
#
# enable this if you see "failed to find any available worker"
#nhelpers=0
#klipsdebug=all
#plutodebug=all
protostack=netkey
nat_traversal=yes
virtual_private=
oe=off
# Enable this if you see "failed to find any available worker"
nhelpers=0
# Add connections here
conn nome da conexao
auth=esp
authby=secret
auto=start
esp=3des-md5-128
ikelifetime=86400s
keyexchange=ike
keylife=86400s
left=200.x.x.x
leftnexthop=200.x.x.x
leftsubnet=192.168.0.0/24
pfs=no
right=200.x.x.x
#rightsubnet=172.28.170.16/28
rightsubnets={172.28.170.16/28,172.28.171.96/28}
type=tunnel
# sample VPN connections, see /etc/ipsec.d/examples/
#Disable Opportunistic Encryption
#include /etc/ipsec.d/examples/no_oe.conf
abaixo segue as regras de firewall
#$iptables -t nat -I PREROUTING -s 172.28.170.16/28 -j ACCEPT
#$iptables -t nat -I POSTROUTING -d 172.28.170.16/28 -j ACCEPT
#$iptables -I FORWARD -s 172.28.170.16/28 -j ACCEPT
#$iptables -I FORWARD -d 172.28.170.16/28 -j ACCEPT
#$iptables -I INPUT -s 172.28.170.16/28 -j ACCEPT
#$iptables -I FORWARD -d 172.28.171.96/28 -j ACCEPT
#$iptables -I FORWARD -s 172.28.171.96/28 -j ACCEPT
#$iptables -I FORWARD -d 172.28.171.96/28 -j ACCEPT
#$iptables -t nat -I POSTROUTING -d 172.28.171.96/28 -j ACCEPT
#$iptables -t nat -I PREROUTING -s 172.28.171.96/28 -j ACCEPT