当前位置: 首页 > news >正文

基于LAC拨号的L2TP VPN实验

二.实验需求

​ 让FW1(PPPoE Client)模拟拨号用户,向内部服务器发送建立拨号连接的请求,并保证连通。

三.实验配置

接口配置

[PPPoE Client]int g 0/0/0
[PPPoE Client-GigabitEthernet0/0/0]service-manage all permit 

#LAC
[USG6000V1-GigabitEthernet0/0/0]ip address  192.168.0.2 24
[USG6000V1-GigabitEthernet0/0/0]service-manage all permit 
[USG6000V1-GigabitEthernet0/0/0]int g 1/0/1
[USG6000V1-GigabitEthernet1/0/1]ip address 20.1.1.1 24

[LNS-GigabitEthernet0/0/0]ip address 192.168.0.3 24
[LNS-GigabitEthernet0/0/0]service-manage all permit 
[LNS-GigabitEthernet0/0/0]int g 1/0/0
[LNS-GigabitEthernet1/0/0]ip address 20.1.1.2 24
[LNS-GigabitEthernet1/0/0]int g 1/0/1
[LNS-GigabitEthernet1/0/1]ip add 192.168.1.254 24

区域划分

[PPPoE Client]firewall zone trust 
[PPPoE Client-zone-trust]add int g 1/0/0

[LNS]firewall zone untrust 
[LNS-zone-untrust]add int g 1/0/0	
[LNS]firewall zone trust 
[LNS-zone-trust]add int g 1/0/1

[nas]firewall zone untrust 
[nas-zone-untrust]add int g 1/0/1
[nas]firewall zone trust 
[nas-zone-trust]add int g  1/0/0

L2TP配置

1、建立PPPoE连接,设定拨号接口VT接口

Client(PPPoE Client)
[PPPoE Client]interface Dialer 1
[PPPoE Client-Dialer1]dialer user user1     ----- 设定拨号用户名
[PPPoE Client-Dialer1]dialer-group 1     ---- 创建拨号组
[PPPoE Client-Dialer1]dialer bundle 1     ------ 设定拨号程序捆绑包
[PPPoE Client-Dialer1]ip address ppp-negotiate      ------ 设定IP地址获取方式为PPP邻居分配,PPP邻居通过IPCP协议进行分配,即PPP的NCP协商过程所用协议
[PPPoE Client-Dialer1]ppp chap user user1
[PPPoE Client-Dialer1]ppp chap password cipher Password123

[PPPoE Client]dialer-rule 1 ip permit       ------ 配置拨号访问控制列表,允许所有IPv4报文通过拨号口,数字1必须与拨号组编号相同。

[PPPoE Client]int g 1/0/0
[PPPoE Client-GigabitEthernet1/0/0]pppoe-client dial-bundle-number 1 ---在物理接口上启动PPPoE Client程序,绑定拨号程序包,编号为1

server
[NAS]interface Virtual-Template 1
[NAS-Virtual-Template1]ppp authentication-mode chap      ----- 修改认证模式
[NAS-Virtual-Template1]ip address 2.2.2.2 24      ---- (配置的IP地址仅是为了激活该接口)

[NAS]firewall zone dmz
[NAS-zone-dmz]add interface Virtual-Template 1

[NAS]interface GigabitEthernet 1/0/0	
[NAS-GigabitEthernet1/0/0]pppoe-server bind virtual-template 1     ----- 将VT接口绑定在物理接口

[NAS]aaa	
[NAS-aaa]domain default 
[NAS-aaa-domain-default]service-type l2tp       ----- 设定认证域的服务类型为L2TP

设定用户名和密码信息:
[NAS]user-manage user user1 domain default 
[NAS-localuser-user1]password Password123

2.建立L2TP隧道

NAS(LAC)配置
[NAS]l2tp enable        ----- 启动L2TP协议
[NAS]l2tp-group 1       ----- 设置L2TP组名
[NAS-l2tp-1]tunnel authentication       ----- 开启隧道认证
[NAS-l2tp-1]tunnel password cipher Hello123      ---- 配置隧道密码信息
[NAS-l2tp-1]tunnel name lac     ----- 设置隧道名称
[NAS-l2tp-1]start l2tp ip 20.1.1.2 fullusername user1      ---- 设定LAC模式和LNS地址,以及设置认证用户的方式为“完全用户认证”,并指定用户名

LNS配置
[LNS]ip pool l2tp     --- 创建地址池
[LNS-ip-pool-l2tp]section 0 172.16.1.2 172.16.1.100

[LNS]aaa
[LNS-aaa]service-scheme l2tp
[LNS-aaa-service-l2tp]ip-pool l2tp
[LNS-aaa]domain default 	
[LNS-aaa-domain-default]service-type l2tp 

[LNS]user-manage user user1 domain default 
[LNS-localuser-user1]password Password123

[LNS]interface Virtual-Template 1
[LNS-Virtual-Template1]ppp authentication-mode chap
[LNS-Virtual-Template1]ip address 172.16.0.1 24
[LNS-Virtual-Template1]remote service-scheme l2tp

[LNS]firewall zone dmz 	
[LNS-zone-dmz]add interface Virtual-Template 1

[LNS]l2tp enable 
[LNS]l2tp-group 1
[LNS-l2tp-1]allow l2tp virtual-template 1 remote lac domain default
[LNS-l2tp-1]tunnel authentication 
[LNS-l2tp-1]tunnel password cipher Hello123

3.路由补充

[PPPoE Client]ip route-static 0.0.0.0 0 Dialer 1       ---- 出接口方式
# 将Dialer 1接口划分到dmz区域,方便发包:
[PPPoE Client]firewall zone dmz 
[PPPoE Client-zone-dmz]add interface Dialer 1

安全配置

sdfvfgs

[PPPoE Client]security-policy
[PPPoE Client-policy-security]default action permit

[NAS]security-policy
[NAS-policy-security]default action permit

[LNS]security-policy
[LNS-policy-security]default action permit 

[PPPoE Client]ping 192.168.1.1
  PING 192.168.1.1: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=3 ms
    Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=2 ms
    Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=2 ms
    Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=3 ms

NAS
[NAS]security-policy 
[NAS-policy-security]default action deny     ----- 先恢复默认策略为拒绝
[NAS-policy-security]rule name local_to_untrust
  source-zone local
  destination-zone untrust
  source-address 20.1.1.1 mask 255.255.255.255
  destination-address 20.1.1.2 mask 255.255.255.255
  service l2tp
  service protocol udp source-port 0 to 65535 destination-port 1701
  action permit

LNS
[LNS]security-policy 	
[LNS-policy-security]default action deny 
[LNS-policy-security]dis this
security-policy
 rule name untrust_to_local
  source-zone untrust
  destination-zone local
  source-address 20.1.1.1 mask 255.255.255.255
  destination-address 20.1.1.2 mask 255.255.255.255
  service l2tp
  service protocol udp destination-port 1701
  action permit
 rule name dmz_to_trust
  source-zone dmz
  destination-zone trust
  source-address 172.16.1.0 mask 255.255.255.0
  destination-address 192.168.1.0 mask 255.255.255.0
  action permit

相关文章:

  • stock-pandas,一个易用的talib的替代开源库。
  • Cyber Weekly #49
  • 用LLama factory时报类似Process 2504721 got signal: 1的解决方法
  • 基于javaweb的SpringBoot水果生鲜商城系统设计与实现(源码+文档+部署讲解)
  • 645.错误的集合
  • 扩散模型总结
  • resnet网络迁移到昇腾执行(OM上篇)
  • ERP、MES和CRM三大企业系统的详细介绍及对比分析
  • 生成树和VRRP实验
  • 【keil】单步调试
  • python学习笔记(3)——元组
  • 【云服务器】在Linux CentOS 7上快速搭建我的世界 Minecraft Fabric 服务器搭建,Fabric 模组详细搭建教程
  • 2. client.chat.completions.create 简单使用
  • 【C++标准IO库】文件的输入输出
  • 批量合并 PDF 文档,支持合并成单个文档,也支持按文件夹合并 PDF 文档
  • 测试模版12
  • springboot453-基于协同过滤推荐算法的食品推荐系统(源码+数据库+纯前后端分离+部署讲解等)
  • GAMES101-现代计算机图形学入门(Animation/simulation)
  • 16-字符串/贪心-相同的字符串
  • docker启动nacos+redis
  • 国际锐评:菲律宾“狐假虎威”把戏害的是谁?
  • 80后共青团云南省委副书记许思思已任迪庆州委副书记
  • 书业观察|一本书的颜值革命:从毛边皮面到爆火的刷边书
  • 杜前任宁波中院代理院长,卸任宁波海事法院院长
  • 外交部:印度香客赴中国西藏神山圣湖朝圣将于今年夏季恢复
  • 朝鲜证实出兵俄罗斯协助收复库尔斯克