用的是小凡模拟器
各设备配置命令
路由器配置命令
EN
CONF T
HOSTNAME BJ-R-1
IP ROUTING
INT E0/1
IP ADD 192.168.10.1 255.255.255.252
NO SHUT
EXIT
INT E0/2
IP ADD 192.168.20.1 255.255.255.252
NO SHUT
EXIT
第一台三层交换机的配置命令
设置接口IP(IOS需用unzip-c3640-js-mz.124-10,IOS c3640-is-mz.123-13a不支持三层功能)
EN
CONF T
HOSTNAME BJ-RS-1
IP ROUTING
INT F0/15
NO SWITCHPORT
IP ADD 192.168.10.2 255.255.255.252
NO SHUT
EXIT
EXIT
设置VTP和添加VLAN
VLAN DATABASE
VTP DOMAIN YHL
VTP SERVER
VTP PASSWORD 321
VTP PRUNING
VTP V2
VLAN 2 NAME SALES
VLAN 3 NAME ENGIN
EXIT
为VLAN配置IP
CONF T
INT VLAN 1
IP ADD 172.16.10.11 255.255.255.0
NO SHUT
EXIT
INT VLAN 2
IP ADD 172.16.20.11 255.255.255.0
NO SHUT
EXIT
INT VLAN 3
IP ADD 172.16.30.11 255.255.255.0
NO SHUT
EXIT
配置中继接口
INT F0/1
SWITCHPORT MODE TRUNK
NO SHUT
INT F0/2
SWITCHPORT MODE TRUNK
NO SHUT
INT F0/13
SWITCHPORT MODE TRUNK
NO SHUT
INT F0/14
SWITCHPORT MODE TRUNK
NO SHUT
EXIT
配置以太网通道
INT RANGE F0/13 - 14
CHANNEL-GROUP 1 MODE ON
将VLAN1加入热备组1
INT VLAN 1
STANDBY 1 IP 172.16.10.1
NO SHUT
将VLAN2加入热备组2
INT VLAN2
STANDBY 2 IP 172.16.20.1
NO SHUT
将VLAN3加入热备组3
INT VLAN 3
STANDBY 3 IP 172.16.30.1
NO SHUT
设置VLAN1和VLAN3分别为热备组1和3的活跃路由器
INT VLAN 1
STANDBY 1 PRIORITY 105
EXIT
INT VLAN 3
STANDBY 3 PRIORITY 105
EXIT
设置VLAN2为热备组2的备份路由器(不用配置,优先级默认为100,只需将BJ-RS-2的VLAN2分别设置为热备组2的活跃路由器就行了)
设置VLAN1有热备组1和3的占先权
INT VLAN 1
STANDBY 1 PREEMPT
INT VLAN 3
STANDBY 3 PREEMPT
设置热备组1和3的端口跟踪
INT VLAN 1
STANDBY 1 TRACK F0/15 10
EXIT
INT VLAN 3
STANDBY 3 TRACK F0/15 10
关闭端口重定向
INT VLAN 1
NO IP REDIRECTS
EXIT
INT VLAN 2
NO IP REDIRECTS
EXIT
INT VLAN 3
NO IP REDIRECTS
EXIT
第二台三层交换机的配置命令
设置接口IP
EN
CONF T
HOSTNAME BJ-RS-2
IP ROUTING
INT F0/15
NO SWITCHPORT
IP ADD 192.168.20.2 255.255.255.252
NO SHUT
EXIT
EXIT
设置VTP和添加VLAN
VLAN DATABASE
VTP DOMAIN YHL
VTP SERVER
VTP PASSWORD 321
VTP PRUNING
VTP V2
VLAN 2 NAME SALES
VLAN 3 NAME ENGIN
EXIT
为VLAN配置IP
CONF T
INT VLAN 1
IP ADD 172.16.10.12 255.255.255.0
NO SHUT
EXIT
INT VLAN 2
IP ADD 172.16.20.12 255.255.255.0
NO SHUT
EXIT
INT VLAN 3
IP ADD 172.16.30.12 255.255.255.0
NO SHUT
EXIT
配置中继接口
INT F0/1
SWITCHPORT MODE TRUNK
NO SHUT
INT F0/2
SWITCHPORT MODE TRUNK
NO SHUT
INT F0/13
SWITCHPORT MODE TRUNK
NO SHUT
INT F0/14
SWITCHPORT MODE TRUNK
NO SHUT
EXIT
配置以太网通道
INT RANGE F0/13 - 14
CHANNEL-GROUP 1 MODE ON
将VLAN1加入热备组1
INT VLAN 1
STANDBY 1 IP 172.16.10.1
NO SHUT
将VLAN2加入热备组2
INT VLAN2
STANDBY 2 IP 172.16.20.1
NO SHUT
将VLAN3加入热备组3
INT VLAN 3
STANDBY 3 IP 172.16.30.1
NO SHUT
设置VLAN2为热备组2的活跃路由器
INT VLAN 2
STANDBY 2 PRIORITY 105
EXIT
设置VLAN1和3为热备组1和3的备份路由器(不用配置,优先级默认为100,只需将BJ-RS-1的VLAN1和3分别设置为热备组1和3的活跃路由器就行了)
设置VLAN2有热备组2的占先权
INT VLAN 2
STANDBY 2 PREEMPT
设置热备组2的端口跟踪
INT VLAN 2
STANDBY 2 TRACK F0/15 10
EXIT
关闭端口重定向
INT VLAN 1
NO IP REDIRECTS
EXIT
INT VLAN 2
NO IP REDIRECTS
EXIT
INT VLAN 3
NO IP REDIRECTS
EXIT
二层交换机BJ-S-1的配置
EN
CONF T
NO IP ROUTING
HOSTNAME BJ-S-1
设置中继接口
INT F0/15
SWITCHPORT MODE TRUNK
NO SH
INT F0/14
SWITCHPORT MODE TRUNK
NO SH
设置VLAN1的管理IP
INT VLAN 1
IP ADD 172.16.10.13 255.255.255.0
NO SH
EXIT
EXIT
设置VTP和添加VLAN
VLAN DATABASE
VTP DOMAIN YHL
VTP CLIENT
VTP PASSWORD 321
VTP PRUNING
VTP V2
VLAN 2 NAME SALES
VLAN 3 NAME ENGIN
EXIT
设置接入接口加入各自VLAN
CONF T
INT F0/1
SWITCHPORT ACCESS VLAN 2
NO SH
EXIT
INT F0/2
SWITCHPORT ACCESS VLAN 3
NO SH
EXIT
二层交换机BJ-S-2的配置
EN
CONF T
NO IP ROUTING
HOSTNAME BJ-S-2
设置中继接口
INT F0/15
SWITCHPORT MODE TRUNK
NO SH
INT F0/14
SWITCHPORT MODE TRUNK
NO SH
设置VLAN1的管理IP
INT VLAN 1
IP ADD 172.16.10.14 255.255.255.0
NO SH
EXIT
EXIT
设置VTP和添加VLAN
VLAN DATABASE
VTP DOMAIN YHL
VTP CLIENT
VTP PASSWORD 321
VTP PRUNING
VTP V2
VLAN 2 NAME SALES
VLAN 3 NAME ENGIN
EXIT
设置接入接口加入各自VLAN
CONF T
INT F0/1
SWITCHPORT ACCESS VLAN 2
NO SH
EXIT
INT F0/2
SWITCHPORT ACCESS VLAN 3
NO SH
EXIT
PC1的配置
EN
CONF T
NO IP ROUTING
HOSTNAME PC1
INT F0/0
IP ADD 172.16.20.101 255.255.255.0
NO SHUT
EXIT
IP DEFAULT-GATEWAY 172.16.20.1
PC4的配置
EN
CONF T
NO IP ROUTING
HOSTNAME PC4
INT F0/0
IP ADD 172.16.30.102 255.255.255.0
NO SHUT
EXIT
IP DEFAULT-GATEWAY 172.16.30.1
验证
关闭BJ-RS-1的所有接口
INT RANGE F0/0 – 15
SHUTDOWN
如果VLAN1的PC1仍然能PING通VLAN3的PC3,则说明热备成功
设置两个三层交换机为根网桥
RS-1
SPANNING-TREE VLAN 1 ROOT PRIMARY
SPANNING-TREE VLAN 3 ROOT PRIMARY
SPANNING-TREE VLAN 2 ROOT SECONDARY
RS-2
SPANNING-TREE VLAN 2 ROOT PRIMARY
SPANNING-TREE VLAN 1 ROOT SECONDARY
SPANNING-TREE VLAN 3 ROOT SECONDARY
使用TFTP下载配置
需要和真机网卡桥接并打开TFTP
COPY RUN TFTP
本文出自 “ hehe my” 博客,请务必保留此出处 http://yhlt024.blog.51cto.com/532582/201588
本文出自 51CTO.COM技术博客