• HCIP【GRE VPN、MGRE VPN与PPP验证综合实验】


    目录

    实验要求:

    实验拓扑图:

    实验思路:

    实验步骤:

    一、配IP地址

    (1)配置所有设备接口的IP地址:

    (2)配置私网与公网接口的缺省路由使得公网可通:

    二、PPP验证的PAP和CHAP认证 与 DHLC 认证

    (1)R1和R5间使用PPP的PAP认证,R5为主认证方。

    (2)R2与R5之间使用ppp的CHAP认证,R5为主认证方。

    (3)R3与R5之间使用HDLC封装。

    三、再创建GRE VPN和MGRE VPN

    (1)R1、R2、R3构建一个MGRE环境,R1为中心站点。

    (2)R1、R4间为点到点的GRE。

    (3)在R1到R5上配置路由协议(RIP)传递两端私网路由

    四、配置NAT协议(easy IP)使得所有的PC可以访问R5环回


    实验要求:

    1、R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址。

    2、(1)R1和R5间使用PPP的PAP认证,R5为主认证方。

       (2)R2与R5之间使用ppp的CHAP认证,R5为主认证方。

       (3)R3与R5之间使用HDLC封装。

    3、R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE。

    4、整个私有网络基于RIP全网可达。

    5、所有PC设置私有IP为源IP,可以访问R5环回,实现全网通。

    实验拓扑图:

    实验思路:

    1. 根据拓扑图配置所有设备的IP地址
    2. 将私网与公网分别搞通
    3. 在公网搞通的基础上进行PPP的pap和chap认证,以及DHLC验证
    4. 再创建GRE VPN和MGRE VPN
    5. 配置NAT协议使得所有的PC可以访问R5环回,实现全网通

    实验步骤:

    一、配IP地址

    (1)配置所有设备接口的IP地址:

    PC1:

    PC3:

    PC6:

    PC7:

    1. R1:
    2. <Huawei>sys
    3. [Huawei]sysn R1
    4. [R1]int g 0/0/0
    5. [R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
    6. [R1-GigabitEthernet0/0/0]q
    7. [R1]int Serial 4/0/0
    8. [R1-Serial4/0/0]ip add 15.1.1.1 24
    9. [R1-Serial4/0/0]q
    10. [R1]dis ip int bri
    11. R2:
    12. <Huawei>sys
    13. [Huawei]sysn R2
    14. [R2]int g0/0/0
    15. [R2-GigabitEthernet0/0/0]ip add 192.168.2.254 24
    16. [R2-GigabitEthernet0/0/0]q
    17. [R2]int Serial 4/0/0
    18. [R2-Serial4/0/0]ip add 25.1.1.2 24
    19. [R2-Serial4/0/0]q
    20. [R2]dis ip int bri
    21. R3:
    22. <Huawei>sys
    23. [Huawei]sysn R3
    24. [R3]int g0/0/0
    25. [R3-GigabitEthernet0/0/0]ip add 192.168.3.254 24
    26. [R3-GigabitEthernet0/0/0]q
    27. [R3]int Serial 4/0/0
    28. [R3-Serial4/0/0]ip add 35.1.1.3 24
    29. [R3-Serial4/0/0]q
    30. [R3]dis ip int bri
    31. R4:
    32. <Huawei>sys
    33. [Huawei]sysn R4
    34. [R4]int g 0/0/0
    35. [R4-GigabitEthernet0/0/0]ip add 45.1.1.4 24
    36. [R4-GigabitEthernet0/0/0]int g 0/0/1
    37. [R4-GigabitEthernet0/0/1]ip add 192.168.4.254 24
    38. [R4-GigabitEthernet0/0/1]q
    39. [R4]dis ip int bri
    40. R5:
    41. <Huawei>sys
    42. [Huawei]sysn R5
    43. [R5]int g0/0/0
    44. [R5-GigabitEthernet0/0/0]ip add 45.1.1.5 24
    45. [R5-GigabitEthernet0/0/0]q
    46. [R5]int Serial 4/0/1
    47. [R5-Serial4/0/1]ip add 15.1.1.5 24
    48. [R5-Serial4/0/1]q
    49. [R5]int Serial 3/0/1
    50. [R5-Serial3/0/1]ip add 25.1.1.5 24
    51. [R5-Serial3/0/1]q
    52. [R5]int Serial 4/0/0
    53. [R5-Serial4/0/0]ip add 35.1.1.5 24
    54. [R5-Serial4/0/0]q
    55. [R5]int l0
    56. [R5-LoopBack0]ip add 5.5.5.5 24
    57. [R5]dis ip int bri

    (2)配置私网与公网接口的缺省路由使得公网可通:

    1. R1
    2. [R1]ip route-static 0.0.0.0 0 15.1.1.5
    3. R2
    4. [R2]ip route-static 0.0.0.0 0 25.1.1.5
    5. R3:
    6. [R3]ip route-static 0.0.0.0 0 35.1.1.5
    7. R4:
    8. [R4]ip route-static 0.0.0.0 0 45.1.1.5

    测试一下:

    1. 示例:
    2. R1的serial 4/0/0接口 ping R2 的serial 4/0/0接口
    3. <R1>ping -a 15.1.1.1 25.1.1.2
    4.   PING 25.1.1.2: 56  data bytes, press CTRL_C to break
    5.     0.00% packet loss
    6. R3的serial 4/0/0接口 ping R4 的g 0/0/0接口
    7. <R3>ping -a 35.1.1.3 45.1.1.4
    8.   PING 45.1.1.4: 56  data bytes, press CTRL_C to break
    9. 0.00% packet loss

    测试通过!!!

    二、PPP验证的PAP和CHAP认证 与 DHLC 认证

    (1)R1和R5间使用PPP的PAP认证,R5为主认证方。

    1. R5(主验证方):
    2. [R5]aaa
    3. [R5-aaa]local-user gxc password cipher gxc12345
    4. [R5-aaa]local-user gxc service-type ppp
    5. [R5-aaa]q
    6. [R5]int Serial 4/0/1
    7. [R5-Serial4/0/1]ppp authentication-mode pap
    8. [R5-Serial4/0/1]q
    9. [R5]
    10. R1(被验证方):
    11. [R1-Serial4/0/0]ppp pap local-user gxc password cipher gxc12345
    12. [R1-Serial4/0/0]shutdown
    13. [R1-Serial4/0/0]undo shutdown

    (2)R2与R5之间使用ppp的CHAP认证,R5为主认证方。

    1. R5(主验证方):
    2. [R5-aaa]aaa
    3. [R5-aaa]local-user gxc password cipher gxc12345
    4. [R5-aaa]local-user gxc service-type ppp
    5. [R5-aaa]q
    6. [R5]int Serial 3/0/1
    7. [R5-Serial3/0/1]ppp authentication-mode chap
    8. [R5-Serial3/0/1]q
    9. [R5]
    10. R2(被验证方):
    11. [R2-Serial4/0/0]ppp chap user gxc
    12. [R2-Serial4/0/0]ppp chap password cipher gxc12345
    13. [R2-Serial4/0/0]undo shutdown
    14. [R2-Serial4/0/0]shutdown

    (3)R3与R5之间使用HDLC封装。

    1. R5:
    2. [R5-Serial4/0/0]link-protocol hdlc
    3. R3:
    4. [R3-Serial4/0/0]link-protocol hdlc

    三、再创建GRE VPN和MGRE VPN

    MGRE VPN:10.1.2.0/24

    GRE VPN:10.1.1.0/24

    (1)R1、R2、R3构建一个MGRE环境,R1为中心站点。

    1. 隧道接口配置:
    2. R1:
    3. [R1]int Tunnel 0/0/0
    4. [R1-Tunnel0/0/0]ip add 10.1.2.1 24
    5. [R1-Tunnel0/0/0]tunnel-protocol gre p2mp
    6. [R1-Tunnel0/0/0]source 15.1.1.1
    7. # 配置NHRP(下一跳解析协议)
    8. [R1-Tunnel0/0/0]nhrp network-id 100
    9. [R1-Tunnel0/0/0]q
    10. [R1]dis nhrp peer all
    11. R2:
    12. [R2]int Tunnel 0/0/0
    13. [R2-Tunnel0/0/0]ip add 10.1.2.2 24
    14. [R2-Tunnel0/0/0]tunnel-protocol gre p2mp
    15. [R2-Tunnel0/0/0]source Serial 4/0/0
    16. # 设置与NHRP服务器(Next Hop Resolution Protocol)的条目
    17. [R2-Tunnel0/0/0]nhrp network-id 100
    18. [R2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
    19. [R2-Tunnel0/0/0]q
    20. [R2]dis nhrp peer all
    21. R3:
    22. [R3]int Tunnel 0/0/0
    23. [R3-Tunnel0/0/0]ip add 10.1.2.3 24
    24. [R3-Tunnel0/0/0]tunnel-protocol gre p2mp
    25. [R3-Tunnel0/0/0]source Serial 4/0/0.
    26. [R3-Tunnel0/0/0]nhrp network-id 100
    27. [R3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
    28. [R3-Tunnel0/0/0]q
    29. [R3]dis nhrp peer all

    (2)R1、R4间为点到点的GRE。

    1. R1:
    2. [R1]int Tunnel 0/0/1
    3. [R1-Tunnel0/0/1]ip add 10.1.1.1 24
    4. [R1-Tunnel0/0/1]tunnel-protocol gre
    5. [R1-Tunnel0/0/1]source 15.1.1.1
    6. [R1-Tunnel0/0/1]destination 45.1.1.4
    7. R4:
    8. [R4]int Tunnel 0/0/1
    9. [R4-Tunnel0/0/1]ip add 10.1.1.4 24
    10. [R4-Tunnel0/0/1]tunnel-protocol gre
    11. [R4-Tunnel0/0/1]source 45.1.1.4
    12. [R4-Tunnel0/0/1]destination 15.1.1.1

    (3)在R1到R5上配置路由协议(RIP)传递两端私网路由

    1. R1:
    2. [R1]rip 1
    3. [R1-rip-1]version 2
    4. [R1-rip-1]network 192.168.1.0
    5. [R1-rip-1]network 10.0.0.0
    6. [R1-rip-1]undo summary
    7. [R1-rip-1]q
    8. 查看路由表中的rip信息
    9. [R1]dis ip routing-table protocol rip
    10. [R1]int Serial 4/0/0
    11. 关闭RIP水平分割:
    12. [R1-Serial4/0/0]undo rip split-horizon
    13. [R1]int tunnel 0/0/0
    14. 开启伪广播 :
    15. [R1-Tunnel0/0/0]nhrp entry multicast dynamic
    16. R2:
    17. [R2]rip 1
    18. [R2-rip-1]v 2
    19. [R2-rip-1]undo summary
    20. [R2-rip-1]network 192.168.2.0
    21. [R2-rip-1]network 10.0.0.0
    22. [R2-rip-1]q
    23. [R2]dis ip routing-table protocol rip
    24. [R2]int t0/0/0
    25. [R2-Tunnel0/0/0]undo rip split-horizon
    26. [R2-Tunnel0/0/0]q
    27. [R2]
    28. R3:
    29. [R3]rip 1
    30. [R3-rip-1]v  2
    31. [R3-rip-1]undo summary
    32. [R3-rip-1]network 192.168.3.0
    33. [R3-rip-1]network 10.0.0.0
    34. [R3-rip-1]q
    35. [R3]dis ip routing-table protocol rip
    36. [R3]int t0/0/0
    37. [R3-Tunnel0/0/0]undo rip sp
    38. [R3-Tunnel0/0/0]undo rip split-horizon
    39. [R3-Tunnel0/0/0]q
    40. [R3]
    41. R4:
    42. [R4]rip 1
    43. [R4-rip-1]v 2
    44. [R4-rip-1]undo summary
    45. [R4-rip-1]network 192.168.4.0
    46. [R4-rip-1]network 10.0.0.0
    47. [R4-rip-1]q
    48. [R4]

    测试一下私网与公网是否已经是可通:

    1. 示例:
    2. PC1 ping PC3
    3. PC>ping 192.168.2.3
    4. Ping 192.168.2.3: 32 data bytes, Press Ctrl_C to break
    5.   20.00% packet loss
    6. PC1 ping PC6
    7.   PC>ping 192.168.3.6
    8. Ping 192.168.3.6: 32 data bytes, Press Ctrl_C to break
    9.   0.00% packet loss

    测试通过!!!

    四、配置NAT协议(easy IP)使得所有的PC可以访问R5环回

    1. R1:
    2. <R1>sys
    3. [R1]acl 2000
    4. [R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
    5. [R1-acl-basic-2000]q
    6. [R1]int Serial 4/0/0
    7. [R1-Serial4/0/0]nat outbound 2000
    8. [R1-Serial4/0/0]q
    9. [R1]
    10. R2:
    11. [R2]acl 2000
    12. [R2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
    13. [R2-acl-basic-2000]q
    14. [R2]int Serial 4/0/0
    15. [R2-Serial4/0/0]nat outbound 2000
    16. [R2-Serial4/0/0]q
    17. [R2]
    18. R3:
    19. <R3>sys
    20. [R3]acl 2000
    21. [R3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
    22. [R3-acl-basic-2000]q
    23. [R3]int Serial 4/0/0
    24. [R3-Serial4/0/0]nat outbound 2000
    25. [R3-Serial4/0/0]q
    26. [R3]
    27. R4:
    28. <R4>sys
    29. [R4]acl 2000
    30. [R4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
    31. [R4-acl-basic-2000]q
    32. [R4]int g0/0/0
    33. [R4-GigabitEthernet0/0/0]nat outbound 2000
    34. [R4-GigabitEthernet0/0/0]q
    35. [R4]

    测试一下:

    1. 示例:
    2. PC1 ping R5的环回路由:
    3. PC>ping 5.5.5.5
    4.   0.00% packet loss
    5. PC7 ping R5 的环回路由:
    6. PC>ping 5.5.5.5
    7. Ping 5.5.5.5: 32 data bytes, Press Ctrl_C to break
    8.   20.00% packet loss

    测试通过!!!

  • 相关阅读:
    OpenCV9-窗口交互操作
    操作系统学习- 4. 内存管理
    Vue-组件通信6种方式
    设计模式: 建造者模式
    计算机毕业设计(附源码)python自习室管理系统
    原来服务器这么有用-Docker安装
    Python中的函数和模块
    Java并发-满老师
    学习如何使用最强大的 JavaScript 函数
    Upper and lower bounds
  • 原文地址:https://blog.csdn.net/miss_copper/article/details/137186495