Giter Club home page Giter Club logo

openswan's Introduction

#安装openswan
yum -y install openswan
#启动
systemclt start ipsec
#检查配置
ipsec verify

#根据失败提示修改内核参数
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1  # 开启转发
net.ipv4.conf.default.rp_filter = 0

# 关闭icmp重定向
sysctl -a | egrep "ipv4.*(accept|send)_redirects" | awk -F "=" '{print$1"= 0"}' >> /etc/sysctl.conf
sysctl -p


#连接配置
vim /etc/ipsec.conf

config setup
#	plutodebug=all
	plutostderrlog=/var/log/pluto.log
	virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.25.0.0/12

conn dianxin-1-30m
	authby=secret
	type=tunnel
	auto=add  //add 代表手动  start代表自动
	pfs=yes

	left=10.14.240.234  //本机IP
	leftsubnet=10.0.0.0/8

	right=180.169.233.181  //对端IP
	rightsubnet=192.168.0.0/16

	esp=aes256-sha1;modp1024
	keyexchange=ike
	ike=aes256-sha1;modp1024
	salifetime=28800s

#	dpdaction=restart
#	dpddelay=10
#	dpdtimeout=30

conn liantong-1-100m
        authby=secret
        type=tunnel
        auto=add
        pfs=yes

        left=10.14.240.234
        leftsubnet=10.0.0.0/8

        right=140.206.62.210
        rightsubnet=192.168.0.0/16

        esp=aes256-sha1;modp1024
        keyexchange=ike
        ike=aes256-sha1;modp1024
        salifetime=28800s

#       dpdaction=restart
#       #       dpddelay=10
#       #       dpdtimeout=30


conn liantong-2-100m
        authby=secret
        type=tunnel
        auto=add
        pfs=yes

        left=10.14.240.234
        leftsubnet=10.0.0.0/8

        right=140.206.62.214
        rightsubnet=192.168.0.0/16

        esp=aes256-sha1;modp1024
        keyexchange=ike
        ike=aes256-sha1;modp1024
        salifetime=28800s

#       dpdaction=restart
#       #       #       dpddelay=10
#       #       #       dpdtimeout=30


#secrets配置
vim /etc/ipsec.secrets
# 本机IP     对端IP             预共享key
10.14.240.234 180.169.233.181 : PSK "runxsports"
10.14.240.234 140.206.62.210 : PSK "runxsports"
10.14.240.234 140.206.62.214 : PSK "runxsports"



#ipsec auto --up net-to-net      /当配置的auto=add 时,才需要手动启动,配置为start则不需要。

openswan's People

Contributors

hu0514 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.