当前位置:   article > 正文

综合实验(简单版)配置_stp region-configuration instance 10 vlan 10 insta

stp region-configuration instance 10 vlan 10 instance 20 vlan 20 instance 30

                      本文主要复述一遍实验过程:

做实验前要先看拓扑和要求

拓扑图和要求如下:

 

看完要求直接开始实验:

本实验PC机开启DHCP获取IP地址,故PC机不用配置IP地址:

首先,我们先从接入交换机开始配置:

SW3和SW4配置一样,举其中一个例子就OK!!!

接入层比较简单:

1、配置vlan,PC1为Vlan10,PC2为Vlan20

2、连接PC机端为access口,连接汇聚端为trunk口

3、配置MSTP

补充一点:

边缘端口:连接交换机连接下游的PC的接口

stp edged-port enable

边缘端口配置bpdu的保护

stp bpdu-protection

  1. vlan batch 10 20 //可以通过vlan batch 10 20 直接创建多个Vlan
  2. interface Ethernet0/0/1
  3. port link-type access
  4. port default vlan 10
  5. stp edged-port enable
  6. interface Ethernet0/0/2
  7. port link-type access
  8. port default vlan 20
  9. stp edged-port enable
  10. interface GigabitEthernet0/0/1
  11. port link-type trunk
  12. port trunk allow-pass vlan 10 20
  13. interface GigabitEthernet0/0/2
  14. port link-type trunk
  15. port trunk allow-pass vlan 10 20
  16. stp bpdu-protection//注意不是在接口下

开启MSTP

同时根据要求2,不同进程负载均衡

  1. stp mode mstp
  2. stp region-configuration
  3. region-name NP
  4. revision-level 1
  5. instance 10 vlan 10
  6. instance 20 vlan 20
  7. active region-configuration

接下来看汇聚层:

SW1和SW2:讲一下SW1的配置,SW参考SW1

不要忘记开启DHCP:dhcp enable

汇聚层配置相比接入层多

1、创建Vlan

  1. vlan batch 10 15 20 25
  2. interface GigabitEthernet0/0/3
  3. port link-type trunk
  4. port trunk allow-pass vlan 10 20
  5. interface GigabitEthernet0/0/4
  6. port link-type trunk
  7. port trunk allow-pass vlan 10 20
  8. interface GigabitEthernet0/0/5
  9. port link-type access
  10. port default vlan 15
  11. stp disable
  12. interface Vlanif15
  13. ip address 172.16.15.100 255.255.255.0

 2、Eth-Trunk

  1. interface Eth-Trunk12
  2. port link-type trunk
  3. port trunk allow-pass vlan 10 20
  4. interface GigabitEthernet0/0/1
  5. eth-trunk 12
  6. interface GigabitEthernet0/0/2
  7. eth-trunk 12

3、MSTP

  1. stp mode mstp
  2. stp region-configuration
  3. region-name NP
  4. revision-level 1
  5. instance 10 vlan 10
  6. instance 20 vlan 20
  7. active region-configuration

设置进程的主备根

SW1:

stp instance 10 root primary

stp instance 20 root secondary

SW2:

stp instance 20 root primary

stp instance 10 root secondary

  1. stp instance 10 root primary
  2. stp instance 20 root secondary

4、VRRP

  1. interface Vlanif10
  2. ip address 172.16.10.100 255.255.255.0
  3. vrrp vrid 10 virtual-ip 172.16.10.254
  4. vrrp vrid 10 priority 105
  5. vrrp vrid 10 track interface GigabitEthernet0/0/5
  6. dhcp select relay //DHCP relay中继
  7. dhcp relay server-ip 172.16.15.254
  8. interface Vlanif20
  9. ip address 172.16.20.101 255.255.255.0
  10. vrrp vrid 20 virtual-ip 172.16.20.254
  11. dhcp select relay //DHCP relay中继
  12. dhcp relay server-ip 172.16.15.254

 5、OSPF

  1. ospf 10 router-id 1.1.1.1
  2. area 0.0.0.0
  3. network 172.16.10.0 0.0.0.255
  4. network 172.16.15.0 0.0.0.255
  5. network 172.16.20.0 0.0.0.255

配置SW5:

不要忘记开启DHCP:dhcp enable

  1. vlan batch 15 25
  2. interface GigabitEthernet0/0/1
  3. port link-type access
  4. port default vlan 15
  5. stp disable //关闭stp
  6. interface GigabitEthernet0/0/2
  7. port link-type access
  8. port default vlan 25
  9. stp disable //关闭stp
  10. 创建一个环回口
  11. int Loopback 0
  12. ip address 5.5.5.5 24
  13. interface Vlanif15
  14. ip address 172.16.15.254 255.255.255.0
  15. dhcp select global //开启全局地址池
  16. interface Vlanif25
  17. ip address 172.16.25.254 255.255.255.0
  18. dhcp select global //开启全局地址池

配置IP地址池

  1. ip pool 10
  2. gateway-list 172.16.10.254
  3. network 172.16.10.0 mask 255.255.255.0
  4. dns-list 114.114.114.114
  5. #
  6. ip pool 20
  7. gateway-list 172.16.20.254
  8. network 172.16.20.0 mask 255.255.255.0
  9. dns-list 114.114.114.114

OSPF:

  1. ospf 10 router-id 5.5.5.5
  2. area 0.0.0.0
  3. network 172.16.15.0 0.0.0.255
  4. network 172.16.25.0 0.0.0.255
  5. network 172.16.51.100 0.0.0.0
  6. network 5.5.5.5 0.0.0.0 //宣告环回口

配置完成!!!

测试一下获取IP地址情况!

 

PC1 ping PC2

 测试SW5环回口地址5.5.5.5

通过Tracert追踪可以发现PC1和PC2走的路径不一样,实现负载均衡

当然通过配置VRRP,当SW1连接SW5的线断开,PC1数据将走向SW2去往SW5

此时PC1数据走的是SW2

 

本次实验就完成了

觉得有用的点个赞吧!!!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/326981
推荐阅读
相关标签
  

闽ICP备14008679号