���要求
:
三层交换
1、
配置
VTP
域,为
server
模式
2、
添加
VLAN,VLAN2-5
3、
配置
TRUNK,f0/11 -12
4、
配置以太通道
f0/1 -2
5、
启用路由转发
ip routing
6、
启用生成树,
vlan2-3
以
3-sw1
为根网桥,
vlan4-5
以
3
-
sw2
为根网桥;且互为备用根网桥
7、
配置
HSRP
(优先级、占先权),
3
-
sw1
是
vlan2-3
的活跃路由器,
3
-
sw2
是
vlan4-5
的活跃路由器
二层交换
1、
配置
VTP
域,为
client
模式
2、
配置
TRUNK
,
f0/11 -12
3、
启用生成树,配置上行链路及速端口
连线
Switch1 F0/1 <----> Switch2 F0/1
Switch1 F0/2 <----> Switch2 F0/2
Switch1 F0/11 <----> Switch3 F0/11
Switch1 F0/12 <----> Switch4 F0/12
Switch3 F0/12 <----> Switch2 F0/12
Switch2 F0/11 <----> Switch4 F0/11
Switch3 F0/2 <----> VPCS V0/1
Switch3 F0/3 <----> VPCS V0/2
Switch4 F0/4 <----> VPCS V0/3
Switch4 F0/5 <----> VPCS V0/4
实验步骤
3-SW1
en
conf t
host 3-SW1
int ran f0/1 -2
swi mode trunk(
启用
trunk)
no shut(
激活
)
exit
int ran f0/11 -12
swi mode trunk
no shut
end
vlan da
vlan 2
(添加
vlan
)
vlan 3
vlan 4
vlan 5
vtp domain fish(
配置
vtp
域
)
vtp server
(为
server
)
exit
conf t
ip routing(
启用路由转发
)
int vlan 2
(为
vlan
设
ip
)
ip add 20.0.0.1 255.0.0.0
no shut
exit
int vlan 3
ip add 30.0.0.1 255.0.0.0
no shut
exit
int vlan 4
ip add 40.0.0.1 255.0.0.0
no shut
exit
int vlan 5
ip add 50.0.0.1 255.0.0.0
no shut
exit
interface Vlan2
ip address 20.0.0.1 255.0.0.0
(把
vlan2
将加入到热备组)
standby 20 ip 20.0.0.100
(设虚拟
ip
)
standby 20 priority 150(
配置优先级为
150)
standby 20 preempt
(配置占先权)
interface Vlan3
ip address 30.0.0.1 255.0.0.0
(把
vlan3
将加入到热备组)
standby 30 ip 20.0.0.100
(设虚拟
ip
)
standby 30 priority 150(
配置优先级为
150)
standby 30 preempt
(配置占先权)
interface Vlan4
ip address 40.0.0.1 255.0.0.0
(把
vlan4
将加入到热备组)
standby 40 ip 20.0.0.100
(设虚拟
ip
)
standby 40 preempt
(配置占先权)
interface Vlan5
ip address 50.0.0.1 255.0.0.0
(把
vlan5
将加入到热备组)
standby 50 ip 20.0.0.100
(设虚拟
ip
)
standby 50 preempt
(配置占先权)
int ran f0/1 -2
channel-group 1 mode on
(配置以太通道)
end
conf t
spanning-tree vlan 2 root primary
(以
vlan2-3
为
3
-
sw1
根网桥)
spanning-tree vlan 3 root primary
exit
conf t
spanning-tree vlan 4 priority secondary
(以
vlan4-5
为备用根网桥)
spanning-tree vlan 5 priority secondary
exit
show run
(查看配置信息)
Building configuration...
Current configuration : 2107 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname 3-SW1
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
!
!
ip cef
ip ips po max-events 100
no ftp-server write-enable
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree vlan 2 priority 8192
spanning-tree vlan 3 priority 8192
spanning-tree vlan 4 priority 16384
spanning-tree vlan 5 priority 16384
!
!
!
--More--
*Mar 1 00:08:28.875: %HSRP-6-STATECHANGE: Vlan4 Grp 40 state Activ! k
!
!
interface Port-channel1
switchport mode trunk
no ip address
!
interface FastEthernet0/0
no ip address
shutdown
!
interface FastEthernet0/1
switchport mode trunk
no ip address
channel-group 1 mode on
!
interface FastEthernet0/2
switchport mode trunk
no ip address
channel-group 1 mode on
!
interface FastEthernet0/3
no ip address
shutdown
!
interface FastEthernet0/4
no ip address
shutdown
!
interface FastEthernet0/5
no ip address
shutdown
!
interface FastEthernet0/6
no ip address
shutdown
!
interface FastEthernet0/7
no ip address
shutdown
!
interface FastEthernet0/8
no ip address
shutdown
!
interface FastEthernet0/9
no ip address
shutdown
!
interface FastEthernet0/10
no ip address
shutdown
!
interface FastEthernet0/11
switchport mode trunk
no ip address
!
interface FastEthernet0/12
switchport mode trunk
no ip address
!
interface FastEthernet0/13
no ip address
shutdown
!
interface FastEthernet0/14
no ip address
shutdown
!
interface FastEthernet0/15
no ip address
shutdown
!
interface Vlan1
no ip address
!
interface Vlan2
ip address 20.0.0.1 255.0.0.0
standby 20 ip 20.0.0.100
standby 20 priority 150
standby 20 preempt
!
interface Vlan3
ip address 30.0.0.1 255.0.0.0
standby 30 ip 30.0.0.100
standby 30 priority 150
standby 30 preempt
!
interface Vlan4
ip address 40.0.0.1 255.0.0.0
standby 40 ip 40.0.0.100
standby 40 preempt
!
interface Vlan5
ip address 50.0.0.1 255.0.0.0
standby 50 ip 50.0.0.100
standby 50 preempt
!
ip http server
no ip http secure-server
ip classless
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
3-SW2
en
conf t
host 3-SW2
int ran f0/1 -2
swi mode trunk
no shut
exit
int ran f0/11 -12
swi mode trunk
end
vlan da
vtp domain fish
vtp server
exit
show vlan-s
conf t
ip routing
int vlan 2
ip add 20.0.0.2 255.0.0.0
no shut
exit
int vlan 3
ip add 30.0.0.2 255.0.0.0
no shut
exit
int vlan 4
ip add 40.0.0.2 255.0.0.0
no shut
exit
int vlan 5
ip add 50.0.0.2 255.0.0.0
no shut
exit
interface Vlan2
ip address 20.0.0.2 255.0.0.0
standby preempt
standby 20 ip 20.0.0.100
!
interface Vlan3
ip address 30.0.0.2 255.0.0.0
standby 30 ip 30.0.0.100
standby 30 preempt
!
interface Vlan4
ip address 40.0.0.2 255.0.0.0
standby preempt
standby 40 ip 40.0.0.100
standby 40 priority 150
!
Intface Vlan5
ip address 50.0.0.2 255.0.0.0
standby 50 ip 50.0.0.100
standby 50 priority 150
standby 50 preempt
!
int ran f0/1 -2
channel-group 1 mode on
end
conf t
spanning-tree vlan 4 root primary
spanning-tree vlan 5 root primary
exit
conf t
spanning-tree vlan 2 priority secondary
spanning-tree vlan 3 priority secondary
exit
show run
Building configuration...
*Mar 1 00:07:02.303: %SYS-5-CONFIG_I: Configured from console by console
Current configuration : 2101 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname 3-SW2
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
!
!
ip cef
ip ips po max-events 100
no ftp-server write-enable
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree vlan 2 priority 16384
spanning-tree vlan 3 priority 16384
spanning-tree vlan 4 priority 8192
spanning-tree vlan 5 priority 8192
!
!
!
!
!
!
interface Port-channel1
switchport mode trunk
no ip address
!
interface FastEthernet0/0
no ip address
shutdown
!
interface FastEthernet0/1
switchport mode trunk
no ip address
channel-group 1 mode on
!
interface FastEthernet0/2
switchport mode trunk
no ip address
channel-group 1 mode on
!
interface FastEthernet0/3
no ip address
shutdown
!
interface FastEthernet0/4
no ip address
shutdown
!
interface FastEthernet0/5
no ip address
shutdown
!
interface FastEthernet0/6
no ip address
shutdown
!
interface FastEthernet0/7
no ip address
shutdown
!
interface FastEthernet0/8
no ip address
shutdown
!
interface FastEthernet0/9
no ip address
shutdown
!
interface FastEthernet0/10
no ip address
shutdown
!
interface FastEthernet0/11
switchport mode trunk
no ip address
!
interface FastEthernet0/12
switchport mode trunk
no ip address
!
interface FastEthernet0/13
no ip address
shutdown
!
interface FastEthernet0/14
no ip address
shutdown
!
interface FastEthernet0/15
no ip address
shutdown
!
interface Vlan1
no ip address
!
interface Vlan2
ip address 20.0.0.2 255.0.0.0
standby preempt
standby 20 ip 20.0.0.100
!
interface Vlan3
ip address 30.0.0.2 255.0.0.0
standby 30 ip 30.0.0.100
standby 30 preempt
!
interface Vlan4
ip address 40.0.0.2 255.0.0.0
standby preempt
standby 40 ip 40.0.0.100
standby 40 priority 150
!
--More--
*Mar 1 00:07:20.243: %HSRP-6-STATECHANGE: Vlan2 Grp 20 state Standby -> Active
*Mar 1 00:07:20.543: %HSRP-6-STATECHANGE: Vlan2 Grp 20 state Activinterface Vla
n5
ip address 50.0.0.2 255.0.0.0
standby 50 ip 50.0.0.100
standby 50 priority 150
standby 50 preempt
!
ip http server
no ip http secure-server
ip classless
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
2-SW1
en
conf t
host 2-SW1
int ran f0/11 -12
swi mode trunk(
启用
trunk)
no shut(
激活
)
end
vlan da
vtp domain fish
(配置
vtp
域)
vtp client
(为
client
)
exit
conf t
int f0/2
swi acc vlan 2(
把端口
f0/2
添加到
vlan 2)
no shut(
激活
)
int f0/3
swi acc vlan 3
(把端口
f0/3
添加到
vlan 3
)
no shut(
激活
)
end
spanning-tree uplinkfast
(配置上行链路)
int ran f0/11 -12
(进入接口)
spanning-tree portfast
(配置速端口)
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/11 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/12 but will only
2-SW2
en
conf t
host 2-SW2
int ran f0/11 -12
swi mode trunk
no shut
end
vlan da
vtp domain fish
vtp client
exit
conf t
int f0/2
swi acc vlan 2
no shut
int f0/3
swi acc vlan 3
no shut
end
spanning-tree uplinkfast
int ran f0/11 -12
spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/11 but will only
have effect when the interface is in a non-trunking mode.
%Warning: portfast should only be enabled on ports connected to a single host.
Connecting hubs, concentrators, switches, bridges, etc.to this interface
when portfast is enabled, can cause temporary spanning tree loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/12 but will only