Chinaunix首页 | 论坛 | 博客
  • 博客访问: 241295
  • 博文数量: 36
  • 博客积分: 1495
  • 博客等级: 上尉
  • 技术积分: 412
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-09 13:34
文章分类

全部博文(36)

文章存档

2016年(1)

2015年(12)

2014年(2)

2012年(4)

2011年(1)

2009年(6)

2008年(10)

我的朋友

分类: LINUX

2012-10-19 20:41:17

strongswan下载地址: 文档和软件都可以在这里下载

主要配置文件:ipsec.conf

# ipsec.conf - strongSwan IPsec configuration file

# basic configuration

config setup
     #strictcrlpolicy=yes
    # uniqueids = no
         #charondebug=1

# Add connections here.

# Sample VPN connections
conn %default
    ikelifetime=1440m
        keylife=200m
    rekeymargin=30m
    keyingtries=1
    keyexchange=ikev1
    authby=secret
        ike=des-md5-modp1024
        esp=des-md5
conn Indonesia_vpn
      left=xxxxx IP地址
      leftsubnet=xxxxx 内网加密的IP地址
      leftid=xxx  标识:这里是IP地址
      leftfirewall=yes
      right=112.215.81.4 对端设备地址
      rightsubnet=xxxx 对端内网地址
      rightid=xxxx 标识:这里是IP地址
      auto=route

共享密码配置
[root@vpn strongswan]# cat ipsec.secrets
# /etc/ipsec.secrets - strongSwan IPsec secrets fil
XXX XX : PSK p0w3rPL@yToXl!
XXX XXX : PSK p0w3rPL@yToXl!    (XX代表隧道两边的地址)

[root@vpn strongswan]# cat strongswan.conf
charon {
  load = aes des sha1 sha2 md5 gmp random nonce hmac stroke kernel-netlink socket-default updown
}

libstrongswan {
  dh_exponent_ansi_x9_42 = no
}
配置完成后就./sbin/ipsec start 启动(如果有防火墙别忘了开启相应的端口放行IPSEC必要端口)

net.ipv4.ip_forward = 1 这个需要开启。

再去ping 对应的内网地址就可以了



阅读(5915) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~