当前位置:网站首页>Deploy L2TP in VPN (Part 1)
Deploy L2TP in VPN (Part 1)
2022-06-24 07:31:00 【Chen Bucheng I】
One . brief introduction
L2TP(Layer 2 Tunneling Protocol) VPN It is used to carry PPP Message tunneling technology , This technology is mainly used in the remote office scenario to provide access services for travel employees to remotely access enterprise intranet resources .
Software required
openswan(ipsec) : Provide a key ppp : Provide user name and password xl2tpd : Provide L2TP service sysctl : Provide server internal forwarding iptables : Provide requests from inside the server to outside , The external response turns to the internal dependent environment of the server
Two . Deploy
ipsec
1. Installation dependency yum install -y make gcc gmp-devel xmlto bison flex xmlto libpcap-devel lsof vim-enhanced man
2.openswan(ipsec) install OpenSWan,Linux Next IPsec The best way to implement , It's powerful , It ensures the security of data transmission to the greatest extent 、 Integrity issues . yum install openswan
3. Next configure ipsec.ipsec The configuration file is /etc/ipsec.conf, Install well openswan after , The configuration file is the default . Make a backup before changing the file . mkdir ~/~etcmv /etc/ipsec.conf ~/~etc/ipsec.conf
vim ~/~etc/ipsec.conf
version 2.0
config setup
protostack=netkey
nhelpers=0
uniqueids=no
interfaces=%defaultroute
virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:!192.168.2.0/24
conn l2tp-psk
rightsubnet=vhost:%priv
also=l2tp-psk-nonat
conn l2tp-psk-nonat
authby=secret
pfs=no
auto=add
keyingtries=3
rekey=no
ikelifetime=8h
keylife=1h
type=transport
left=%defaultroute
leftid=xxx.xx.xx.xx
leftprotoport=17/1701
right=%any
rightprotoport=17/%any
dpddelay=40
dpdtimeout=130
dpdaction=clear
sha2-truncbug=yes
There is a line on it leftid=xxx.xx.xx.xx, Here we have to put leftid The value of is changed to that of the server ip Address , Internet accessible IP Address .
4. Next, configure the key .L2TP Than PPTP One more key entry , It's also better than that PPTP One of the safer reasons . This key is actually a password , Different from the user's login password , It is equivalent to a key for communication between devices . Its configuration file is /etc/ipsec.secrets, In the same way , Let's back it up first , Then create a new one of our own : mv /etc/ipsec.secrets ~/~etc/ipsec.secretsvim /etc/ipsec.secrets
%any %any : PSK "RZSJ.COM"
Empathy ,%any Is all addresses , It can also be specified individually , And then there's ”YourPsk” Medium YourPsk Is the content of the key . You can change it to any string of your own . Anyway, when you connect to log in VPN When , I need this PSK Of .
5. function ipsec: systemctl restart ipsecsystemctl enable ipsec
边栏推荐
- How to select a third-party software testing company? 2022 ranking of domestic software testing institutions
- 什么是CC攻击?如何判断网站是否被CC攻击? CC攻击怎么防御?
- What is a CC attack? How to judge whether a website is attacked by CC? How to defend against CC attacks?
- 【pointNet】基于pointNet的三维点云目标分类识别matlab仿真
- 自动化测试是什么?什么软件项目适合自动化测试?
- Bjdctf 2020 Bar _ Babystack
- 选择器(>,~,+,[])
- 華為雲數據庫進階學習
- [cnpm] tutorial
- Mysql---三张表(student,课程,分数) 查询课程为数学的学生姓名,编号,成绩
猜你喜欢

利用微搭低代码实现级联选择

Win11 points how to divide disks? How to divide disks in win11 system?

Étalonnage de la caméra (objectif et principe d'étalonnage)
![[image fusion] image fusion based on NSST and PCNN with matlab code](/img/b4/61a5adde0d0bfc5a339ef8ab948d43.png)
[image fusion] image fusion based on NSST and PCNN with matlab code
![[GUET-CTF2019]zips](/img/79/22ff5d4a3cdc3fa9e0957ccc9bad4b.png)
[GUET-CTF2019]zips

bjdctf_2020_babystack
![[image feature extraction] image feature extraction based on pulse coupled neural network (PCNN) including Matlab source code](/img/b3/26cfa385aa357c3a7a77e9db47e94c.png)
[image feature extraction] image feature extraction based on pulse coupled neural network (PCNN) including Matlab source code

How can genetic testing help patients fight disease?
![(cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]](/img/33/d601a6f92b1b73798dceb027263223.png)
(cve-2020-11978) command injection vulnerability recurrence in airflow DAG [vulhub range]

【WordPress建站】5. 设置代码高亮
随机推荐
湖北专升本-湖师计科
电脑如何打开软键盘,教大家Win10如何打开软键盘的方法
Deploy loglistener in tke container to collect logs to CLS
前缀和专题训练
Étalonnage de la caméra (objectif et principe d'étalonnage)
Selector (>, ~, +, [])
Spark stage and shuffle for daily data processing
Research on redis High Availability Mechanism
bjdctf_2020_babystack
Prefix and topic training
Huawei Cloud Database Advanced Learning
What is an intrusion detection system?
(CVE-2020-11978)Airflow dag中的命令注入漏洞复现【vulhub靶场】
Common coding and encryption in penetration testing
【小技巧】使用matlab的深度学习工具箱deepNetworkDesigner快速设计
[WordPress website] 5 Set code highlight
第三方软件测试公司如何选择?2022国内软件测试机构排名
MySQL enable binlog
利用微搭低代码实现级联选择
蓝牙耳机怎么连接电脑使用,win10电脑如何连接蓝牙耳机