弹性路由网络设计 、 双出口Internet访问实现 、 设备远程管理 、 内网服务器发布 、 网络冗余方案实施

1 案例:园区网项目建设 – 网络冗余方案实施

1.1 需求

  1. 为了增强网关稳定性和冗余性,每个部门都使用了网关冗余技术
  2. 在交换机之间添加多根链路,提高链路稳定性,提高链路利用率
  3. 要求每个部门的主机互相访问时,使用的都是最优的转发路径

1.2 方案

使用eNSP搭建实验环境,如图-1所示。

弹性路由网络设计 、 双出口Internet访问实现 、 设备远程管理 、 内网服务器发布 、 网络冗余方案实施图-1

1.3 步骤

实现此案例需要按照如下步骤进行。[hidecontent type=”payshow”]

在SW5上配置 VLAN10/20/30/40的网关IP

  1. [SW5]interface vlanif 10
  2. [SW5Vlanif10]ip address 192.168.10.252 24
  3. [SW5Vlanif10]quit
  4. [SW5]interface vlanif 20
  5. [SW5Vlanif20]ip address 192.168.20.252 24
  6. [SW5Vlanif20]quit
  7. [SW5]interface vlanif 30
  8. [SW5Vlanif30]ip address 192.168.30.252 24
  9. [SW5Vlanif30]quit
  10. [SW5]interface vlanif 40
  11. [SW5Vlanif40]ip address 192.168.40.252 24
  12. [SW5Vlanif40]quit

在DHCP服务器上,排除SW5上的网关IP地址

  1. [DHCP]ip pool VLAN10
  2. [DHCPippoolVLAN10]excludedipaddress 192.168.10.251
  3. [DHCPippoolVLAN10]quit
  4. [DHCP]ip pool VLAN20
  5. [DHCPippoolVLAN20]excludedipaddress 192.168.20.251
  6. [DHCPippoolVLAN20]quit
  7. [DHCP]ip pool VLAN30
  8. [DHCPippoolVLAN30]excludedipaddress 192.168.30.251
  9. [DHCPippoolVLAN30]quit
  10. [DHCP]ip pool VLAN40
  11. [DHCPippoolVLAN40]excludedipaddress 192.168.40.251
  12. [DHCPippoolVLAN40]quit

配置VRRP,SW5是VLAN10/20的主网关,VLAN30/40的备份网关

  1. [SW5]interface Vlanif 10
  2. [SW5Vlanif10]vrrp vrid 10 virtualip 192.168.10.254
  3. [SW5Vlanif10]vrrp vrid 10 priority 200
  4. [SW5Vlanif10]quit
  5. [SW5]interface Vlanif 20
  6. [SW5Vlanif20]vrrp vrid 20 virtualip 192.168.20.254
  7. [SW5Vlanif20]vrrp vrid 20 priority 200
  8. [SW5Vlanif20]quit
  9. [SW5]interface Vlanif 30
  10. [SW5Vlanif30]vrrp vrid 30 virtualip 192.168.30.254
  11. [SW5Vlanif30]quit
  12. [SW5]interface Vlanif 40
  13. [SW5Vlanif40]vrrp vrid 40 virtualip 192.168.40.254
  14. [SW5Vlanif40]quit

配置 VRRP,SW6是VLAN30/40的主网关,VLAN10/20的备份网关

  1. [SW6]interface Vlanif 30
  2. [SW6Vlanif30]vrrp vrid 30 virtualip 192.168.30.254
  3. [SW6Vlanif30]vrrp vrid 30 priority 200
  4. [SW6Vlanif30]quit
  5. [SW6]interface Vlanif 40
  6. [SW6Vlanif40]vrrp vrid 40 virtualip 192.168.40.254
  7. [SW6Vlanif40]vrrp vrid 40 priority 200
  8. [SW6Vlanif40]quit
  9. [SW6]interface Vlanif 10
  10. [SW6Vlanif10]vrrp vrid 10 virtualip 192.168.10.254
  11. [SW6Vlanif10]quit
  12. [SW6]interface Vlanif 20
  13. [SW6Vlanif20]vrrp vrid 20 virtualip 192.168.20.254
  14. [SW6Vlanif20]quit

配置 SW5 为 DHCP中继,确保与 DHCP 服务器互通

  1. [SW5]dhcp enable
  2. [SW5]interface Vlanif 10
  3. [SW5Vlanif10]dhcp select relay
  4. [SW5Vlanif10]dhcp relay serverip 192.168.66.1
  5. [SW5Vlanif10]quit
  6. [SW5]interface Vlanif 20
  7. [SW5Vlanif20]dhcp select relay
  8. [SW5Vlanif20]dhcp relay serverip 192.168.66.1
  9. [SW5Vlanif20]quit
  10. [SW5]interface Vlanif 30
  11. [SW5Vlanif30]dhcp select relay
  12. [SW5Vlanif30]dhcp relay serverip 192.168.66.1
  13. [SW5Vlanif30]quit
  14. [SW5]interface Vlanif 40
  15. [SW5Vlanif40]dhcp select relay
  16. [SW5Vlanif40]dhcp relay serverip 192.168.66.1
  17. [SW5Vlanif40]quit
  18. [SW5]interface Vlanif 66 #确保SW5与DHCP服务器互通
  19. [SW5Vlanif66]ip address 192.168.66.2 24
  20. [SW5Vlanif66]quit

配置SW6的 vlanif 88,确保 VLAN30/40的PC可以访问 Web服务器

  1. [SW6]interface Vlanif 88
  2. [SW6Vlanif88]ip address 192.168.88.2 24
  3. [SW6Vlanif88]quit

配置MSTP,确保每个网段的PC互相访问时,数据转发路径最优

  1. [SW1]stp mode mstp
  2. [SW1]stp regionconfiguration
  3. [SW1mstregion]regionname HCIP
  4. [SW1mstregion]instance 10 vlan 10
  5. [SW1mstregion]instance 20 vlan 20
  6. [SW1mstregion]instance 30 vlan 30
  7. [SW1mstregion]instance 40 vlan 40
  8. [SW1mstregion]active regionconfiguration
  9. [SW1mstregion]quit
  10. [SW2]stp mode mstp
  11. [SW2]stp regionconfiguration
  12. [SW2mstregion]regionname HCIP
  13. [SW2mstregion]instance 10 vlan 10
  14. [SW2mstregion]instance 20 vlan 20
  15. [SW2mstregion]instance 30 vlan 30
  16. [SW2mstregion]instance 40 vlan 40
  17. [SW2mstregion]active regionconfiguration
  18. [SW2mstregion]quit
  19. [SW3]stp mode mstp
  20. [SW3]stp regionconfiguration
  21. [SW3mstregion]regionname HCIP
  22. [SW3mstregion]instance 10 vlan 10
  23. [SW3mstregion]instance 20 vlan 20
  24. [SW3mstregion]instance 30 vlan 30
  25. [SW3mstregion]instance 40 vlan 40
  26. [SW3mstregion]active regionconfiguration
  27. [SW3mstregion]quit
  28. [SW4]stp mode mstp
  29. [SW4]stp regionconfiguration
  30. [SW4mstregion]regionname HCIP
  31. [SW4mstregion]instance 10 vlan 10
  32. [SW4mstregion]instance 20 vlan 20
  33. [SW4mstregion]instance 30 vlan 30
  34. [SW4mstregion]instance 40 vlan 40
  35. [SW4mstregion]active regionconfiguration
  36. [SW4mstregion]quit
  37. [SW5]stp mode mstp
  38. [SW5]stp regionconfiguration
  39. [SW5mstregion]regionname HCIP
  40. [SW5mstregion]instance 10 vlan 10
  41. [SW5mstregion]instance 20 vlan 20
  42. [SW5mstregion]instance 30 vlan 30
  43. [SW5mstregion]instance 40 vlan 40
  44. [SW5mstregion]active regionconfiguration
  45. [SW5mstregion]quit
  46. [SW6]stp mode mstp
  47. [SW6]stp regionconfiguration
  48. [SW6mstregion]regionname HCIP
  49. [SW6mstregion]instance 10 vlan 10
  50. [SW6mstregion]instance 20 vlan 20
  51. [SW6mstregion]instance 30 vlan 30
  52. [SW6mstregion]instance 40 vlan 40
  53. [SW6mstregion]active regionconfiguration
  54. [SW6mstregion]quit
  55. [SW5]stp instance 10 priority 0 #配置SW5为 vlan10的根交换机
  56. [SW5]stp instance 20 priority 0 #配置SW5为 vlan20的根交换机
  57. [SW6]stp instance 30 priority 0 #配置SW6为 vlan30的根交换机
  58. [SW6]stp instance 40 priority 0 #配置SW6为 vlan40的根交换机

2 案例:园区网项目建设 – 弹性路由网络设计

2.1 需求

  1. 合理配置OSPF区域,确保各部门之间的互相访问
  2. 不同部门分别属于不同的OSPF区域,要求 web/dhcp 服务器所在的区域不能受到外部链路以及其他区域的链路的影响
  3. 在骨干区域中,设备之间能够快速建立邻接关系

2.2 方案

使用eNSP搭建实验环境,如图-2所示。

弹性路由网络设计 、 双出口Internet访问实现 、 设备远程管理 、 内网服务器发布 、 网络冗余方案实施图-2

2.3 步骤

实现此案例需要按照如下步骤进行。

1)现网中添加SW7和SW8,并增加 VLAN 15 和 16,与 R1 相连

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname SW7
  4. [SW7]vlan batch 10 20 30 40 66 88 15 16
  5. [SW7]portgroup groupmember gi0/0/10 gi0/0/20 gi0/0/21
  6. [SW7portgroup]port linktype trunk
  7. [SW7portgroup]port trunk allowpass vlan all
  8. [SW7portgroup]quit
  9. [SW7]interface GigabitEthernet 0/0/1
  10. [SW7GigabitEthernet0/0/1]port link access
  11. [SW7GigabitEthernet0/0/1]port default vlan 15
  12. [SW7GigabitEthernet0/0/1]quit
  13. [SW7]stp mode mstp
  14. [SW7]stp regionconfiguration
  15. [SW7mstregion]regionname HCIP
  16. [SW7mstregion]instance 10 vlan 10
  17. [SW7mstregion]instance 20 vlan 20
  18. [SW7mstregion]instance 30 vlan 30
  19. [SW7mstregion]instance 40 vlan 40
  20. [SW7mstregion]active regionconfiguration
  21. [SW7mstregion]quit
  22. <Huawei>undo terminal monitor
  23. <Huawei>systemview
  24. [Huawei]sysname SW8
  25. [SW8]vlan batch 10 20 30 40 66 88 15 16
  26. [SW8]portgroup groupmember gi0/0/10 gi0/0/20 gi0/0/21
  27. [SW8portgroup]port linktype trunk
  28. [SW8portgroup]port trunk allowpass vlan all
  29. [SW8portgroup]quit
  30. [SW8]interface GigabitEthernet 0/0/2
  31. [SW8GigabitEthernet0/0/1]port link access
  32. [SW8GigabitEthernet0/0/1]port default vlan 16
  33. [SW8GigabitEthernet0/0/1]quit
  34. [SW8]stp mode mstp
  35. [SW8]stp regionconfiguration
  36. [SW8mstregion]regionname HCIP
  37. [SW8mstregion]instance 10 vlan 10
  38. [SW8mstregion]instance 20 vlan 20
  39. [SW8mstregion]instance 30 vlan 30
  40. [SW8mstregion]instance 40 vlan 40
  41. [SW8mstregion]active regionconfiguration
  42. [SW8mstregion]quit
  43. [SW1]vlan batch 15 16
  44. [SW2]vlan batch 15 16
  45. [SW3]vlan batch 15 16
  46. [SW4]vlan batch 15 16
  47. [SW5]vlan batch 15 16
  48. [SW6]vlan batch 15 16

2)配置SW5/6 与 SW7/8 的互联 Trunk 接口

  1. [SW5]portgroup groupmember gi0/0/20 gi0/0/21
  2. [SW5portgroup]port linktype trunk
  3. [SW5portgroup]port trunk allowpass vlan all
  4. [SW5portgroup]quit
  5. [SW6]portgroup groupmember gi0/0/20 gi0/0/21
  6. [SW6portgroup]port linktype trunk
  7. [SW6portgroup]port trunk allowpass vlan all
  8. [SW6portgroup]quit

3)配置R1的接口IP地址,并启用 OSPF以及优化接口网络类型

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R1
  4. [R1]interface GigabitEthernet 0/0/1
  5. [R1GigabitEthernet0/0/1]ip address 192.168.15.1 24
  6. [R1GigabitEthernet0/0/1]quit
  7. [R1]interface GigabitEthernet 0/0/2
  8. [R1GigabitEthernet0/0/2]ip address 192.168.16.1 24
  9. [R1GigabitEthernet0/0/2]quit
  10. [R1]ospf 1 routerid 1.1.1.1
  11. [R1ospf-1]area 0
  12. [R1ospf-1area-0.0.0.0]network 192.168.15.0 0.0.0.255
  13. [R1ospf-1area-0.0.0.0]network 192.168.16.0 0.0.0.255
  14. [R1ospf-1area-0.0.0.0]quit
  15. [R1]interface GigabitEthernet 0/0/1
  16. [R1GigabitEthernet0/0/1]ospf networktype p2p
  17. [R1GigabitEthernet0/0/1]quit
  18. [R1]interface GigabitEthernet 0/0/2
  19. [R1GigabitEthernet0/0/2]ospf networktype p2p
  20. [R1GigabitEthernet0/0/2]quit

4)配置SW5/6的接口IP地址,并启用 OSPF以及优化接口网络类型

  1. [SW5]interface Vlanif 15
  2. [SW5Vlanif15]ip address 192.168.15.5 24
  3. [SW5Vlanif15]ospf networktype p2p
  4. [SW5Vlanif15]quit
  5. [SW5]ospf 1 routerid 5.5.5.5
  6. [SW5ospf-1]area 0
  7. [SW5ospf-1area-0.0.0.0]network 192.168.15.0 0.0.0.255
  8. [SW5ospf-1area-0.0.0.0]quit
  9. [SW5ospf-1]area 10
  10. [SW5ospf-1area-0.0.0.10]network 192.168.10.0 0.0.0.255
  11. [SW5ospf-1area-0.0.0.10]quit
  12. [SW5ospf-1]area 20
  13. [SW5ospf-1area-0.0.0.20]network 192.168.20.0 0.0.0.255
  14. [SW5ospf-1area-0.0.0.20]quit
  15. [SW5ospf-1]area 30
  16. [SW5ospf-1area-0.0.0.30]network 192.168.30.0 0.0.0.255
  17. [SW5ospf-1area-0.0.0.30]quit
  18. [SW5ospf-1]area 40
  19. [SW5ospf-1area-0.0.0.40]network 192.168.40.0 0.0.0.255
  20. [SW5ospf-1area-0.0.0.40]quit
  21. [SW5ospf-1]area 88
  22. [SW5ospf-1area-0.0.0.88]network 192.168.88.0 0.0.0.255
  23. [SW5ospf-1area-0.0.0.88]stub nosummary
  24. [SW5ospf-1area-0.0.0.88]quit
  25. [SW6]interface Vlanif 16
  26. [SW6Vlanif16]ip address 192.168.16.6 24
  27. [SW6Vlanif16]ospf networktype p2p
  28. [SW6Vlanif16]quit
  29. [SW6]ospf 1 routerid 6.6.6.6
  30. [SW6ospf-1]area 0
  31. [SW6ospf-1area-0.0.0.0]network 192.168.16.0 0.0.0.255
  32. [SW6ospf-1area-0.0.0.0]quit
  33. [SW6ospf-1]area 10
  34. [SW6ospf-1area-0.0.0.10]network 192.168.10.0 0.0.0.255
  35. [SW6ospf-1area-0.0.0.10]quit
  36. [SW6ospf-1]area 20
  37. [SW6ospf-1area-0.0.0.20]network 192.168.20.0 0.0.0.255
  38. [SW6ospf-1area-0.0.0.20]quit
  39. [SW6ospf-1]area 30
  40. [SW6ospf-1area-0.0.0.30]network 192.168.30.0 0.0.0.255
  41. [SW6ospf-1area-0.0.0.30]quit
  42. [SW6ospf-1]area 40
  43. [SW6ospf-1area-0.0.0.40]network 192.168.40.0 0.0.0.255
  44. [SW6ospf-1area-0.0.0.40]quit
  45. [SW6ospf-1]area 66
  46. [SW6ospf-1area-0.0.0.66]network 192.168.66.0 0.0.0.255
  47. [SW6ospf-1area-0.0.0.66]stub nosummary
  48. [SW6ospf-1area-0.0.0.66]quit

3 案例:园区网项目建设 – 双出口Internet访问实现

3.1 需求

  1. 公司有两个出口设备 R1 和 R2,R1是主出口,R2是备份出口
  2. 内网大量主机都需要访问 Internet ,要求使用最节省IP地址的方案
  3. 内网中财务部的主机属于敏感业务部门,不能访问互联

3.2 方案

使用eNSP搭建实验环境,如图-3所示。

弹性路由网络设计 、 双出口Internet访问实现 、 设备远程管理 、 内网服务器发布 、 网络冗余方案实施图-3

3.3 步骤

实现此案例需要按照如下步骤进行。

1)添加备份出口设备 R2,并通过 VLAN25/26 与SW5/6 建立 OSPF邻居

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R2
  4. [R2]interface GigabitEthernet 0/0/1
  5. [R2GigabitEthernet0/0/1]ip address 192.168.25.2 24
  6. [R2GigabitEthernet0/0/1]quit
  7. [R2]interface GigabitEthernet 0/0/2
  8. [R2GigabitEthernet0/0/2]ip address 192.168.26.2 24
  9. [R2GigabitEthernet0/0/2]quit
  10. [R2]ospf 1 routerid 2.2.2.2
  11. [R2ospf-1]area 0
  12. [R2ospf-1area-0.0.0.0]network 192.168.25.0 0.0.0.255
  13. [R2ospf-1area-0.0.0.0]network 192.168.26.0 0.0.0.255
  14. [R2ospf-1area-0.0.0.0]quit
  15. [R2]interface GigabitEthernet 0/0/1
  16. [R2GigabitEthernet0/0/1]ospf networktype p2p
  17. [R2GigabitEthernet0/0/1]quit
  18. [R2]interface GigabitEthernet 0/0/2
  19. [R2GigabitEthernet0/0/2]ospf networktype p2p
  20. [R2GigabitEthernet0/0/2]quit

2)在交换机网络中添加 VLAN25/26

  1. [SW1]vlan batch 25 26
  2. [SW2]vlan batch 25 26
  3. [SW3]vlan batch 25 26
  4. [SW4]vlan batch 25 26
  5. [SW5]vlan batch 25 26
  6. [SW6]vlan batch 25 26
  7. [SW7]vlan batch 25 26
  8. [SW8]vlan batch 25 26
  9. [SW7]interface GigabitEthernet 0/0/2
  10. [SW7GigabitEthernet0/0/2]port link access
  11. [SW7GigabitEthernet0/0/2]port default vlan 25
  12. [SW7GigabitEthernet0/0/2]quit
  13. [SW8]interface GigabitEthernet 0/0/1
  14. [SW8GigabitEthernet0/0/1]port link access
  15. [SW8GigabitEthernet0/0/1]port default vlan 26
  16. [SW8GigabitEthernet0/0/1]quit

3)在SW5/6上通过 VLAN25/26 与 R2 建立 OSPF 邻居关系,优化OSPF

  1. [SW5]interface Vlanif 25
  2. [SW5Vlanif25]ip address 192.168.25.5 24
  3. [SW5Vlanif25]ospf networktype p2p
  4. [SW5Vlanif25]quit
  5. [SW5]ospf 1
  6. [SW5ospf-1]area 0
  7. [SW5ospf-1area-0.0.0.0]network 192.168.25.0 0.0.0.255
  8. [SW5ospf-1area-0.0.0.0]quit
  9. [SW6]interface Vlanif 26
  10. [SW6Vlanif26]ip address 192.168.26.6 24
  11. [SW6Vlanif26]ospf networktype p2p
  12. [SW6Vlanif26]quit
  13. [SW6]ospf 1
  14. [SW6ospf-1]area 0
  15. [SW6ospf-1area-0.0.0.0]network 192.168.26.0 0.0.0.255
  16. [SW6ospf-1area-0.0.0.0]quit

4)R1/R2配置默认路由访问外网,并通过 OSPF 下发给内网SW5/6

  1. [R1]interface GigabitEthernet 0/0/0
  2. [R1GigabitEthernet0/0/0]ip address 100.1.1.1 24
  3. [R1GigabitEthernet0/0/0]quit
  4. [R1]ip routestatic 0.0.0.0 0 100.1.1.3 # 100.1.1.3是运营商设备的接口IP地址
  5. [R1]ospf 1
  6. [R1ospf-1]defaultrouteadvertise #产生OSPF默认路由,cost 为1
  7. [R1ospf-1]quit
  8. [R2]interface GigabitEthernet 0/0/0
  9. [R2GigabitEthernet0/0/0]ip address 200.1.1.2 24
  10. [R2GigabitEthernet0/0/0]quit
  11. [R2]ip routestatic 0.0.0.0 0 200.1.1.3 # 200.1.1.3是运营商设备的接口IP地址
  12. [R2]ospf 1
  13. [R2ospf-1]defaultrouteadvertise cost 10 #产生OSPF默认路由,cost为10
  14. [R2ospf-1]quit

5)配置R1/R2的 ACL 和 NAT(EasyIP)

  1. [R1]acl 2000
  2. [R1aclbasic-2000]rule 10 deny source 192.168.40.0 0.0.0.255
  3. [R1aclbasic-2000]rule 20 permit source any
  4. [R1aclbasic-2000]quit
  5. [R1]interface GigabitEthernet 0/0/0
  6. [R1GigabitEthernet0/0/0]nat outbound 2000
  7. [R1GigabitEthernet0/0/0]quit
  8. [R2]acl 2000
  9. [R2aclbasic-2000]rule 10 deny source 192.168.40.0 0.0.0.255
  10. [R2aclbasic-2000]rule 20 permit source any
  11. [R2aclbasic-2000]quit
  12. [R2]interface GigabitEthernet 0/0/0
  13. [R2GigabitEthernet0/0/0]nat outbound 2000
  14. [R2GigabitEthernet0/0/0]quit

6)配置运营商的设备以及测试设备

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname DianXin
  4. [DianXin]interface GigabitEthernet 0/0/1
  5. [DianXinGigabitEthernet0/0/1]ip address 100.1.1.3 24
  6. [DianXinGigabitEthernet0/0/1]quit
  7. [DianXin]interface GigabitEthernet 0/0/2
  8. [DianXinGigabitEthernet0/0/1]ip address 200.1.1.3 24
  9. [DianXinGigabitEthernet0/0/1]quit
  10. [DianXin]interface GigabitEthernet 0/0/0
  11. [DianXinGigabitEthernet0/0/1]ip address 110.1.1.254 24
  12. [DianXinGigabitEthernet0/0/1]quit
  13. Client1:
  14. 110.1.1.11
  15. 255.255.255.0
  16. 110.1.1.254

4 案例:园区网项目建设 – 内网服务器发布

4.1 需求

  1. 内网中 的 web 服务器,可以被互联网设备访问
  2. 内网中 的 交换机设备,可以被互联网设备远程访问

4.2 方案

使用eNSP搭建实验环境,如图-4所示。

弹性路由网络设计 、 双出口Internet访问实现 、 设备远程管理 、 内网服务器发布 、 网络冗余方案实施图-4

4.3 步骤

实现此案例需要按照如下步骤进行。

配置 Web服务器IP,开启Web服务

在边界设备 R1 配置 NAT Server

  1. [R1]interface GigabitEthernet 0/0/0
  2. [R1GigabitEthernet0/0/0] nat server protocol tcp global 100.1.1.100 2008 inside 192.168.88.1 80
  3. [R2]interface GigabitEthernet 0/0/0
  4. [R2GigabitEthernet0/0/0] nat server protocol tcp global 200.1.1.200 2008 inside 192.168.88.1 80

5 案例:园区网项目建设 – 设备远程管理

5.1 需求

  1. 为内网中的交换机单独划分一个IP网段,作为设备的管理IP地址
  2. 内网中的 交换机设备的远程用户名和密码为:HuaWei / HCIE
  3. 内网用户中,只有技术部的 PC-2 可以远程登录内网的所有设备

5.2 方案

使用eNSP搭建实验环境,如图-5所示。

弹性路由网络设计 、 双出口Internet访问实现 、 设备远程管理 、 内网服务器发布 、 网络冗余方案实施图-5

5.3 步骤

实现此案例需要按照如下步骤进行。

1)在交换机上配置管理 vlan 199,并设置管理IP地址,开启远程登录功能

  1. [SW1]vlan 199
  2. [SW1vlan199]quit
  3. [SW1]interface vlanif 199
  4. [SW1Vlanif199]ip address 192.168.199.1 24
  5. [SW1Vlanif199]quit
  6. [SW1]aaa
  7. [SW1aaa]localuser HuaWei password cipher HCIE
  8. [SW1aaa]localuser HuaWei servicetype telnet
  9. [SW1aaa]quit
  10. [SW1]userinterface vty 0 4
  11. [SW1uivty0-4]authenticationmode aaa
  12. [SW1uivty0-4]quit
  13. [SW2]vlan 199
  14. [SW2vlan199]quit
  15. [SW2]interface vlanif 199
  16. [SW2Vlanif199]ip address 192.168.199.2 24
  17. [SW2Vlanif199]quit
  18. [SW2]aaa
  19. [SW2aaa]localuser HuaWei password cipher HCIE
  20. [SW2aaa]localuser HuaWei servicetype telnet
  21. [SW2aaa]quit
  22. [SW2]userinterface vty 0 4
  23. [SW2uivty0-4]authenticationmode aaa
  24. [SW2uivty0-4]quit
  25. [SW3]vlan 199
  26. [SW3vlan199]quit
  27. [SW3]interface vlanif 199
  28. [SW3Vlanif199]ip address 192.168.199.3 24
  29. [SW3Vlanif199]quit
  30. [SW3]aaa
  31. [SW3aaa]localuser HuaWei password cipher HCIE
  32. [SW3aaa]localuser HuaWei servicetype telnet
  33. [SW3aaa]quit
  34. [SW3]userinterface vty 0 4
  35. [SW3uivty0-4]authenticationmode aaa
  36. [SW3uivty0-4]quit
  37. [SW4]vlan 199
  38. [SW4vlan199]quit
  39. [SW4]interface vlanif 199
  40. [SW4Vlanif199]ip address 192.168.199.4 24
  41. [SW4Vlanif199]quit
  42. [SW4]aaa
  43. [SW4aaa]localuser HuaWei password cipher HCIE
  44. [SW4aaa]localuser HuaWei servicetype telnet
  45. [SW4aaa]quit
  46. [SW4]userinterface vty 0 4
  47. [SW4uivty0-4]authenticationmode aaa
  48. [SW4uivty0-4]quit
  49. [SW5]vlan 199
  50. [SW5vlan]quit
  51. [SW6]vlan 199
  52. [SW6vlan]quit
  53. [SW7]vlan 199
  54. [SW7vlan]quit
  55. [SW8]vlan 199
  56. [SW8vlan]quit

2)配置 vlan 199 的网关冗余,将SW5配置为主网关,SW6配置为备份网关

  1. [SW5]interface vlanif 199
  2. [SW5Vlanif199]ip address 192.168.199.251 24
  3. [SW5Vlanif199]vrrp vrid 199 virtualip 192.168.199.254
  4. [SW5Vlanif199]vrrp vrid 199 priority 200
  5. [SW5Vlanif199]quit
  6. [SW6]interface vlanif 199
  7. [SW6Vlanif199]ip address 192.168.199.252 24
  8. [SW6Vlanif199]vrrp vrid 199 virtualip 192.168.199.254
  9. [SW6Vlanif199]quit

3)为每个交换机添加默认路由,指向 vlan 199 的虚拟网关

  1. [SW1]ip routestatic 0.0.0.0 0.0.0.0 192.168.199.254
  2. [SW2]ip routestatic 0.0.0.0 0.0.0.0 192.168.199.254
  3. [SW3]ip routestatic 0.0.0.0 0.0.0.0 192.168.199.254
  4. [SW4]ip routestatic 0.0.0.0 0.0.0.0 192.168.199.254

4)在SW5和SW6的OSPF协议中,宣告 vlan199 ,通告给 R1和R2

  1. [SW5]ospf 1
  2. [SW5ospf-1]area 199
  3. [SW5ospf-1area-0.0.0.199]network 192.168.199.0 0.0.0.255
  4. [SW5ospf-1area-0.0.0.199]quit
  5. [SW6]ospf 1
  6. [SW6ospf-1]area 199
  7. [SW6ospf-1area-0.0.0.199]network 192.168.199.0 0.0.0.255
  8. [SW6ospf-1area-0.0.0.199]quit

5)在边界设备调整 OSPF cost,确保去往 vlan199 时,优先走 SW5的路径

  1. [R1]interface GigabitEthernet 0/0/2
  2. [R1GigabitEthernet0/0/2]ospf cost 6
  3. [R1GigabitEthernet0/0/2]quit
  4. [R2]interface GigabitEthernet 0/0/1
  5. [R2GigabitEthernet0/0/1]ospf cost 6
  6. [R2GigabitEthernet0/0/1]quit

6)在边界设备配置 NAT server,确保外网可以远程登录内网交换机

  1. [R1]interface GigabitEthernet 0/0/0
  2. [R1GigabitEthernet0/0/0]nat server protocol tcp global 100.1.1.100 2001 inside 192.168.199.1 23
  3. [R1GigabitEthernet0/0/0]nat server protocol tcp global 100.1.1.100 2002 inside 192.168.199.2 23
  4. [R1GigabitEthernet0/0/0]nat server protocol tcp global 100.1.1.100 2003 inside 192.168.199.3 23
  5. [R1GigabitEthernet0/0/0]nat server protocol tcp global 100.1.1.100 2004 inside 192.168.199.4 23
  6. [R2]interface GigabitEthernet 0/0/0
  7. [R2GigabitEthernet0/0/0]nat server protocol tcp global 200.1.1.200 2001 inside 192.168.199.1 23
  8. [R2GigabitEthernet0/0/0]nat server protocol tcp global 200.1.1.200 2002 inside 192.168.199.2 23
  9. [R2GigabitEthernet0/0/0]nat server protocol tcp global 200.1.1.200 2003 inside 192.168.199.3 23
  10. [R2GigabitEthernet0/0/0]nat server protocol tcp global 200.1.1.200 2004 inside 192.168.199.4 23

7)确保内网用户中,只有 PC2 可以远程登录内网设备

  1. [DHCPServer]ip pool VLAN20
  2. [DHCPServerippoolVLAN20]staticbind ipaddress 192.168.20.2 macaddress 548998F074FC # 后面是PC的 MAC地址
  3. [SW1]acl 2000
  4. [SW1aclbasic-2000]rule 10 permit source 192.168.20.2 0.0.0.255
  5. [SW1aclbasic-2000]rule 20 permit source 110.1.1.11 0.0.0.0
  6. [SW1aclbasic-2000]quit
  7. [SW1]userinterface vty 0 4
  8. [SW1uivty0-4]acl 2000 inbound
  9. [SW1uivty0-4]quit
  10. [SW1]
  11. [SW2]acl 2000
  12. [SW2aclbasic-2000]rule 10 permit source 192.168.20.2 0.0.0.255
  13. [SW2aclbasic-2000]rule 20 permit source 110.1.1.11 0.0.0.0
  14. [SW2aclbasic-2000]quit
  15. [SW2]userinterface vty 0 4
  16. [SW2uivty0-4]acl 2000 inbound
  17. [SW2uivty0-4]quit
  18. [SW2]
  19. [SW1]acl 2000
  20. [SW3aclbasic-2000]rule 10 permit source 192.168.20.2 0.0.0.255
  21. [SW3aclbasic-2000]rule 20 permit source 110.1.1.11 0.0.0.0
  22. [SW3aclbasic-2000]quit
  23. [SW3]userinterface vty 0 4
  24. [SW3uivty0-4]acl 2000 inbound
  25. [SW3uivty0-4]quit
  26. [SW3]
  27. [SW4]acl 2000
  28. [SW4aclbasic-2000]rule 10 permit source 192.168.20.2 0.0.0.255
  29. [SW4aclbasic-2000]rule 20 permit source 110.1.1.11 0.0.0.0
  30. [SW4aclbasic-2000]quit
  31. [SW4]userinterface vty 0 4
  32. [SW4uivty0-4]acl 2000 inbound
  33. [SW4uivty0-4]quit
  34. [SW4][/hidecontent]

给TA打赏
共{{data.count}}人
人已打赏
华为数通

园区网需求分析 、 园区网项目流程 、 技术方案选型 、 服务器部署 、 网络拓扑绘制 、 基础交换网络设计

2021-12-28 13:06:56

华为数通网络随笔

STP生成树协议实战

2023-8-31 15:26:20

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索