大型企业案例-:努力变好

大型企业案例
实验环境描述:
本公司为了保证企业网关的稳定性,采用双线接入实现容错功能,默认转发数据从SW1-3L,当SW1-3L发生故障SW2-3L转发数据。
推荐步骤:

  • 交换机互连链路使用Trunk
  • SW1-3L和SW2-3L配置以太网通道
  • 在交换机上配置VTP域名是benet.com,SW1-3L配置为VTP的Server模式,其他三台交换机配置为Clinet模式
  • 在SW1-3L创建VLAN10和VLAN20同步到其他三台交换机
  • 将客户端加入到不同的VLAN
  • 将客户端的所在接口配置成速端口
  • 三层交换机开启接口的路由功能配置IP地址,配置路由器R1的IP地址
  • SW1-3L交换机配置VLAN接口IP地址如下要求
    VLAN10:192.168.10.100/24
    VLAN20:192.168.20.100/24
  • SW2-3L交换机配置VLAN接口IP地址如下要求
    VLAN10:192.168.10.200/24
    VLAN20:192.168.20.200/24
  • 在SW1-3L、SW2-3L配置生成树,SW1-3L是VLAN10、VLAN20的根网桥;SW2-3L是VLAN10、VLAN20的备份根网桥
  • 三层交换机配置默认路由,路由器配置静态路由,全网互通
  • 活跃路由器的优先级为255,备份路由器的优先级为200
  • PC机的IP地址和网关规划
    VLAN10_PC1:192.168.10.1/24 GW:192.168.10.254
    VLAN10-PC2:192.168.10.2/24 GW:192.168.10.254
    VLAN20-PC1:192.168.20.1/24 GW:192.168.20.254
    VLAN20-PC2:192.168.20.2/24 GW:192.168.20.254
  • Down掉三层交换机SW1-3L的F0/11~14任意接口,在SW2查看HSRP备份路由器转换活跃路由器
  • 实验步骤:
    按照拓扑图搭建环境
    大型企业案例
    添加模块
    大型企业案例
    大型企业案例
    *交换机互连链路使用Trunk
    SW1-3L(config)#INTerface Range fastEthernet 0/11 - 15
    SW1-3L(config-if-range)#switchport trunk encapsulation dot1q
    SW1-3L(config-if-range)#switchport mode trunk
    在SW1-3L连续进入0/11-15接口配置为trunk链路
    SW2-3L(config)#interface range fastEthernet 0/11 - 15
    SW2-3L(config-if-range)#switchport trunk encapsulation dot1q
    SW2-3L(config-if-range)#switchport mode trunk
    在SW2-3L连续进入0/11-15接口配置为trunk链路
    SW3(config)#interface range fastEthernet 0/1 - 2
    SW3(config-if-range)#switchport trunk encapsulation dot1q
    SW3(config-if-range)#switchport mode trunk
    在SW3连续进入0/1-2接口配置为trunk链路
    SW4(config)#interface range fastEthernet 0/1 - 2
    SW4(config-if-range)#switchport trunk encapsulation dot1q
    SW4(config-if-range)#switchport mode trunk
    在SW4连续进入0/1-2接口配置为trunk链路
  • SW1-3L和SW2-3L配置以太网通道
    SW1-3L(config)#interface range fastEthernet 0/12 - 13
    SW1-3L(config-if-range)#channel-group 1 mode on
    在SW1-3L进入0/12 – 13接口配置为以太网通道
    SW2-3L(config)#interface range fastEthernet 0/12 - 13
    SW2-3L(config-if-range)#channel-group 1 mode on
    在SW2-3L进入0/12 – 13接口配置为以太网通道
  • 在交换机上配置VTP域名是benet.com,SW1-3L配置为VTP的Server模式,其他三台交换机配置为Clinet模式
    SW1-3L#vlan database
    SW1-3L(vlan)#vtp domain benet.com
    Changing VTP domain name from NULL to benet.com
    SW1-3L(vlan)#vtp server
    在SW1-3L进入vlan数据库模式,vtp域名为benet.com 工作模式为server
    SW2-3L#vlan database
    SW2-3L(vlan)#vtp domain benet.com
    Domain name already set to benet.com .
    SW2-3L(vlan)#vtp client
    Setting device to VTP CLIENT mode.
    在SW2进入vlan数据库模式,vtp域名为benet.com 工作模式为server
    SW3#vlan database
    SW3(vlan)#vtp domain benet.com
    Domain name already set to benet.com .
    SW3(vlan)#vtp client
    Setting device to VTP CLIENT mode.
    在SW3进入vlan数据库模式,vtp域名为benet.com 工作模式为server
    SW4#vlan database
    SW4(vlan)#vtp domain benet.com
    Domain name already set to benet.com .
    SW4(vlan)#vtp client
    Setting device to VTP CLIENT mode.
    在SW4进入vlan数据库模式,vtp域名为benet.com 工作模式为server
  • 在SW1-3L创建VLAN10和VLAN20同步到其他三台交换机
    SW1-3L(vlan)#vlan 10
    VLAN 10 added:
    Name: VLAN0010
    SW1-3L(vlan)#vlan 20
    VLAN 20 added:
    Name: VLAN0020
    SW1-3L(vlan)#exit
    在SW1-3L创建vlan10 vlan20
    在SW2-3L SW3-3L SW4-3L上show vlan-switch b查看vlan是否同步
    大型企业案例
    大型企业案例
    大型企业案例
    大型企业案例
  • 将客户端加入到不同的VLAN
    SW3(config)#interface fastEthernet 0/3
    SW3(config-if)#switchport mode access
    SW3(config-if)#switchport access vlan 10
    SW3(config-if)#exit
    在SW3进入0/3接口,加入vlan10
    SW3(config)#interface fastEthernet 0/4
    SW3(config-if)#switchport mode access
    SW3(config-if)#switchport access vlan 20
    在SW3进入0/4接口,加入vlan20
    SW4(config)#interface fastEthernet 0/3
    SW4(config-if)#switchport mode access
    SW4(config-if)#switchport access vlan 10
    SW4(config-if)#exit
    在SW4进入0/3接口,加入vlan10
    SW4(config)#interface fastEthernet 0/4
    SW4(config-if)#switchport mode access
    SW4(config-if)#switchport access vlan 20
    在SW4进入0/4接口,加入vlan20
  • 将客户端的所在接口配置成速端口(5分)
    SW3(config)#interface range fastEthernet 0/3 - 4
    SW3(config-if-range)#spanning-tree portfast
    在SW3连续进入0/3 – 4接口,配置为速端口
    SW4(config)#interface range fastEthernet 0/3 - 4
    SW4(config-if-range)#spanning-tree portfast
    在SW4连续进入0/3 – 4接口,配置为速端口
  • 三层交换机开启接口的路由功能配置IP地址,配置路由器R1的IP地址
    R1(config)#interface fastEthernet 1/0
    R1(config-if)#ip address 192.168.30.2 255.255.255.0
    R1(config-if)#no shutdown
    在R1进入1/0接口,配置IP地址为192.168.30.2
    R1(config)#interface fastEthernet 0/0
    R1(config-if)#ip address 192.168.40.2 255.255.255.0
    R1(config-if)#no shutdown
    在R1进入0/0接口,配置IP地址为192.168.40.2
    SW1-3L(config)#interface fastEthernet 0/11
    SW1-3L(config-if)#no switchport
    SW1-3L(config-if)#ip address 192.168.30.1 255.255.255.0
    SW1-3L(config-if)#no shutdown
    在SW1-3L进入0/11接口,开启路由功能,配置IP地址为192.168.30.1
    SW2-3L(config)#interface fastEthernet 0/11
    SW2-3L(config-if)#no switchport
    SW2-3L(config-if)#ip address 12.168.40.1 255.255.255.0
    SW2-3L(config-if)#no shutdown
    在SW2-3L进入0/11接口,开启路由功能,配置IP地址为192.168.40.1
  • SW1-3L交换机配置VLAN接口IP地址如下要求
    VLAN10:192.168.10.100/24
    VLAN20:192.168.20.100/24
    SW1-3L(config)#interface vlan 10
    SW1-3L(config-if)#ip address 192.168.10.100 255.255.255.0
    SW1-3L(config-if)#no shutdown
    SW1-3L(config-if)#exit
    在SW1-3L进入vlan10 配置IP地址为192.168.10.100
    SW1-3L(config)#interface vlan 20
    SW1-3L(config-if)#ip address 192.168.20.100 255.255.255.0
    SW1-3L(config-if)#no shutdown
    在SW1-3L进入vlan20 配置IP地址为192.168.20.100
  • SW2-3L交换机配置VLAN接口IP地址如下要求
    VLAN10:192.168.10.200/24
    VLAN20:192.168.20.200/24
    SW2-3L(config)#interface vlan 10
    SW2-3L(config-if)#ip address 192.168.10.200 255.255.255.0
    SW2-3L(config-if)#no shutdown
    SW2-3L(config-if)#exit
    在SW2-3L进入vlan10 配置IP地址为192.168.10.200
    SW2-3L(config)#interface vlan 20
    SW2-3L(config-if)#ip address 192.168.20.200 255.255.255.0
    SW2-3L(config-if)#no shutdown
    在SW2-3L进入vlan20 配置IP地址为192.168.20.200
  • 在SW1-3L、SW2-3L配置生成树,SW1-3L是VLAN10、VLAN20的根网桥;SW2-3L是VLAN10、VLAN20的备份根网桥
    SW1-3L(config)#spanning-tree vlan 10
    SW1-3L(config)#spanning-tree vlan 10 root primary
    SW1-3L(config)#spanning-tree vlan 20
    SW1-3L(config)#spanning-tree vlan 20 root primary
    在SW1-3L进入vlan10 vlan20 配置为根网桥
    SW2-3L(config)#spanning-tree vlan 10
    SW2-3L(config)#spanning-tree vlan 10 root secondary
    SW2-3L(config)#spanning-tree vlan 20
    SW2-3L(config)#spanning-tree vlan 20 root secondary
    在SW2-3L进入vlan10 vlan20 配置为备份根网桥
  • 三层交换机配置默认路由,路由器配置静态路由,全网互通
    SW1-3L(config)#ip route 0.0.0.0 0.0.0.0 192.168.30.2
    SW2-3L(config)#ip route 0.0.0.0 0.0.0.0 192.168.40.2
    在SW2-3L上配置去往40.2的默认路由
    R1(config)#ip route 192.168.10.0 255.255.255.0 192.168.30.1
    R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.30.1
    R1(config)#ip route 192.168.10.0 255.255.255.0 192.168.40.1
    R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.40.1
    在R1上配置去往10.0 20.0的静态路由,下一跳地址为30.1 配置去往10.0 20.0的静态路由,下一跳地址为40.1
    大型企业案例
  • 活跃路由器的优先级为255,备份路由器的优先级为200
    SW1-3L(config)#interface vlan 10
    SW1-3L(config-if)#standby 10 ip 192.168.10.254
    SW1-3L(config-if)#
    Mar 1 01:23:13.495: %HSRP-6-STATECHANGE: Vlan10 Grp 10 state Standby -> Active
    SW1-3L(config-if)#standby 10 priority 255
    SW1-3L(config-if)#standby 10 track fastEthernet 0/12 100
    SW1-3L(config-if)#standby 10 track fastEthernet 0/13 100
    SW1-3L(config-if)#standby 10 track fastEthernet 0/14 100
    SW1-3L(config-if)#standby 10 track fastEthernet 0/15 100
    SW1-3L(config-if)#standby 10 preempt
    在SW1-3L进入vlan10配置为活跃路由器,优先级为255,跟踪端口降级为100
    SW1-3L(config)#interface vlan 20
    SW1-3L(config-if)#standby 20 ip 192.168.20.254
    SW1-3L(config-if)#
    Mar 1 01:26:01.371: %HSRP-6-STATECHANGE: Vlan20 Grp 20 state Standby -> Active
    SW1-3L(config-if)#standby 20 priority 255
    SW1-3L(config-if)#standby 20 track fastEthernet 0/12 100
    SW1-3L(config-if)#standby 20 track fastEthernet 0/13 100
    SW1-3L(config-if)#standby 20 track fastEthernet 0/14 100
    SW1-3L(config-if)#standby 20 track fastEthernet 0/15 100
    SW1-3L(config-if)#standby 20 preempt
    在SW1-3L进入vlan20配置为活跃路由器,优先级为255,跟踪端口降级为100
    SW2-3L(config)#interface vlan 10
    SW2-3L(config-if)#standby 10 ip 192.168.10.254
    SW2-3L(config-if)#standby 10 priority 200
    SW2-3L(config-if)#exit
    在SW2-3L进入vlan10配置为备份路由器,优先级为200
    SW2-3L(config)#interface vlan 20
    SW2-3L(config-if)#standby 20 ip 192.168.20.254
    SW2-3L(config-if)#standby 20 priority 200
    SW2-3L(config-if)#exit
    在SW2-3L进入vlan20配置为备份路由器,优先级为200
  • PC机的IP地址和网关规划
    VLAN10_PC1:192.168.10.1/24 GW:192.168.10.254
    VLAN10-PC2:192.168.10.2/24 GW:192.168.10.254
    VLAN20-PC1:192.168.20.1/24 GW:192.168.20.254
    VLAN20-PC2:192.168.20.2/24 GW:192.168.20.254

VLAN10-PC1(config)#no ip routing
VLAN10-PC1(config)#interface fastEthernet 0/0
VLAN10-PC1(config-if)#no shutdown
VLAN10-PC1(config)#interface fastEthernet 0/0
VLAN10-PC1(config-if)#ip address 192.168.10.1 255.255.255.0
VLAN10-PC1(config-if)#no shutdown
VLAN10-PC1(config-if)#exit
VLAN10-PC1(config)#ip default-gateway 192.168.10.254
在vlan10-pc1关闭路由功能,激活0/0接口,配置IP地址为192.168.10.1 网关为192.168.10.254
VLAN20-PC1(config)#no ip routing
VLAN20-PC1(config)#interface fastEthernet 0/0
VLAN20-PC1(config-if)#no shutdown
VLAN20-PC1(config-if)#exit
VLAN20-PC1(config)#interface fastEthernet 0/0
VLAN20-PC1(config-if)#ip address 192.168.20.1 255.255.255.0
VLAN20-PC1(config-if)#no shutdown
VLAN20-PC1(config-if)#exit
VLAN20-PC1(config)#ip default-gateway 192.168.20.254
在vlan20-pc1关闭路由功能,激活0/0接口,配置IP地址为192.168.20.1 网关为192.168.20.254
VLAN10-PC2(config)#no ip routing
VLAN10-PC2(config)#interface fastEthernet 0/0
VLAN10-PC2(config-if)#no shutdown
VLAN10-PC2(config-if)#exit
VLAN10-PC2(config)#interface fastEthernet 0/0
VLAN10-PC2(config-if)#ip address 192.168.10.2 255.255.255.0
VLAN10-PC2(config-if)#no shutdown
VLAN10-PC2(config-if)#exit
VLAN10-PC2(config)#ip default-gateway 192.168.10.254
在vlan10-pc2关闭路由功能,激活0/0接口,配置IP地址为192.168.10.2 网关为192.168.10.254
VLAN20-PC2(config)#no ip routing
VLAN20-PC2(config)#interface fastEthernet 0/0
VLAN20-PC2(config-if)#no shutdown
VLAN20-PC2(config-if)#exit
VLAN20-PC2(config)#interface fastEthernet 0/0
VLAN20-PC2(config-if)#ip address 192.168.20.2 255.255.255.0
VLAN20-PC2(config-if)#no shutdown
VLAN20-PC2(config-if)#exit
VLAN20-PC2(config)#ip default-gateway 192.168.20.254
在vlan20-pc2关闭路由功能,激活0/0接口,配置IP地址为192.168.20.2 网关为192.168.20.254

  • Down掉三层交换机SW1-3L的F0/11~14任意接口,在SW2查看HSRP备份路由器转换活跃路由器
    SW1-3L(config)#interface range fastEthernet 0/11 - 14
    SW1-3L(config-if-range)#shutdown
    在SW1-3L连续进入0/11 – 14接口,shutdown关闭
    大型企业案例
    大型企业案例