zoukankan      html  css  js  c++  java
  • 无线技术——VRRP配置


    实验拓扑

    在这里插入图片描述

    基础配置

    • 配置SW1
    # 创建vlan,配置链路聚合
    [SW1]vlan batch 10 20 
    [SW1]int Eth-Trunk 1
    [SW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/10 0/0/11
    [SW1-Eth-Trunk1]port link-type trunk 
    [SW1-Eth-Trunk1]port trunk allow-pass vlan all 
    [SW1-Eth-Trunk1]q
    # 配置接口类型
    [SW1]int g0/0/1 
    [SW1-GigabitEthernet0/0/1]port link-type trunk 
    [SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
    [SW1-GigabitEthernet0/0/1]int g0/0/2
    [SW1-GigabitEthernet0/0/2] port link-type trunk
    [SW1-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
    [SW1-GigabitEthernet0/0/2]q
    
    • 配置SW2
    # SW2创建vlan,配置链路聚合
    [SW2]vlan batch 10 20 
    [SW2]int Eth-Trunk 1
    [SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/10 0/0/11
    [SW2-Eth-Trunk1]port link-type trunk 
    [SW2-Eth-Trunk1]port trunk allow-pass vlan all 
    [SW2-Eth-Trunk1]q
    # SW2配置接口类型
    [SW2]int g0/0/1 
    [SW2-GigabitEthernet0/0/1]port link-type trunk 
    [SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
    [SW2-GigabitEthernet0/0/1]int g0/0/2
    [SW2-GigabitEthernet0/0/2] port link-type trunk
    [SW2-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
    [SW2-GigabitEthernet0/0/2]q
    
    • 配置SW3、SW4
    # SW3配置
    [SW3]vlan ba 10 20
    [SW3]int g0/0/2
    [SW3-GigabitEthernet0/0/2]port link-type trunk
    [SW3-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
    [SW3-GigabitEthernet0/0/2]int g0/0/
    [SW3-GigabitEthernet0/0/3]port link-type trunk
    [SW3-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 4094
    [SW3-GigabitEthernet0/0/3]q
    [SW3]int g0/0/1
    [SW3-GigabitEthernet0/0/1]port link-type access 
    [SW3-GigabitEthernet0/0/1]port default vlan 10
    
    # SW4配置
    [SW4]vlan ba 10 20
    [SW4]int g0/0/2
    [SW4-GigabitEthernet0/0/2]port link-type trunk
    [SW4-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094
    [SW4-GigabitEthernet0/0/2]int g0/0/3
    [SW4-GigabitEthernet0/0/3]port link-type trunk
    [SW4-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 409
    [SW4]int g0/0/1
    [SW4-GigabitEthernet0/0/1]port link-type access 
    [SW4-GigabitEthernet0/0/1]port default vlan 20
    
    • AR1配置
    [AR1]int g0/0/0
    [AR1-GigabitEthernet0/0/0]ip ad 10.1.1.1 24
    [AR1-GigabitEthernet0/0/0]q
    [AR1]ip route-static 0.0.0.0 0 10.1.1.254  //配置静态路由,否则无法互通
    

    配置VRRP

    • SW1配置
    # 配置vlanif的IP地址,配置VRRP
    [SW1]int Vlanif 10
    [SW1-Vlanif10]ip ad 10.1.1.2 24
    [SW1-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254  //配置VRID 1的虚拟网关为10.1.1.254
    [SW1-Vlanif10]vrrp vrid 1 priority 120  //配置VRID 1的优先级
    [SW1-Vlanif10]q
    [SW1]int Vlanif 20
    [SW1-Vlanif20]ip ad 20.1.1.2 24
    [SW1-Vlanif20]vrrp vrid 2 virtual-ip 20.1.1.254  //配置VRID 2的虚拟网关为20.1.1.254
    
    • SW2配置
    [SW2]int Vlanif 10
    [SW2-Vlanif10]ip ad 10.1.1.3 24
    [SW2-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254
    [SW2-Vlanif10]q
    [SW2]int Vlanif 20
    [SW2-Vlanif20]ip ad 20.1.1.3 24
    [SW2-Vlanif20]vrrp vrid 2 virtual-ip 20.1.1.254
    [SW2-Vlanif20]vrrp vrid  2 priority 120  //配置VRID 2的优先级为120
    

    实验结果

    • 当SW2down掉之后(down之前记得save),VRRP可以迅速切换备用网关,进行数据转发,当SW2恢复时,可以迅速切换会主交换机

    在这里插入图片描述
    拓展

    • vrrp vrid 1 preempt-mode timer delay 20修改抢占时延
    • vrrp vrid 1 track interface GigabitEthernet0/0/1 reduced 20配置上行接口down后,自身优先级降20

     

    以上内容均属原创,如有不详或错误,敬请指出。
    
    本文作者: 坏坏
  • 相关阅读:
    Linux(CentOS 7)搭建DHCP服务器实验
    Linux(CentOS 7)发布静态网站
    Linux(CentOS 7)搭建VSFTP服务器
    Linux(CentOS 7)搭建samba服务器搭建实验
    Linux(CentOS 7)软件的安装
    Linux(CentOS 7)服务于进程
    Linux磁盘配额
    Linux LVM逻辑卷管理
    Linux磁盘挂载
    Linux磁盘分区
  • 原文地址:https://www.cnblogs.com/bad5/p/13022661.html
Copyright © 2011-2022 走看看