交换路由小综合实验一
本实验内容应用了以下知识点:VLAN 、Trunk、channel-group、三层路由、VTP 、STP、 HSRP、OSPF。知识点应用面还是比较多的。
实验拓扑环境:
实验部署环境:
1.PC1和PC3属于vlan 10 192.168.10.1/24,PC2和PC4属于vlan 20 192.168.20.1/24;
2.sw1、sw2、sw3、sw4 直接的链路全部trunk,sw1和sw2直接以太网通道;
3.R1、sw1、sw2 直间采用OSPF路由协议;
实验目的:
1、PC1、PC2、PC3、PC4、PC5直接互通;
2、PC1、PC2、PC3、PC4到PC5之间骨干链路冗余;
3、SW1和SW2 分别负载vlan流量;
测试结果:
1. sw1的路由表
sw1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
100.0.0.0/32 is subnetted, 1 subnets
O IA 100.100.100.1 [110/11] via 10.10.10.1, 00:21:58, FastEthernet0/0
20.0.0.0/24 is subnetted, 1 subnets
O 20.20.20.0 [110/11] via 192.168.20.4, 00:21:58, Vlan20
[110/11] via 192.168.10.4, 00:21:58, Vlan10
C 192.168.10.0/24 is directly connected, Vlan10
C 192.168.20.0/24 is directly connected, Vlan20
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.10.0 is directly connected, FastEthernet0/0
30.0.0.0/24 is subnetted, 1 subnets
O 30.30.30.0 [110/11] via 10.10.10.1, 00:21:59, FastEthernet0/0
2.pc1跟踪PC5
tracert 30.30.30.2
traceroute to 30.30.30.2, 64 hops max, press Ctrl+C to stop
1 192.168.10.1 30.000 ms 30.000 ms 40.000 ms
2 10.10.10.1 60.000 ms 50.000 ms 40.000 ms
3 30.30.30.2 70.000 ms 60.000 ms 60.000 ms
3.pc2跟踪PC5
tracert 30.30.30.2
traceroute to 30.30.30.2, 64 hops max, press Ctrl+C to stop
1 192.168.20.4 30.000 ms 30.000 ms 40.000 ms
2 20.20.20.1 50.000 ms 50.000 ms 50.000 ms
3 30.30.30.2 80.000 ms 80.000 ms 70.000 ms
4. show spanning-tree 信息
sw1#show spanning-tree vlan 10
VLAN10 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 8192, address c404.10c8.0001
Configured hello time 2, max age 20, forward delay 15
We are the root of the spanning tree
Topology change flag set, detected flag set
Number of topology changes 7 last change occurred 00:00:54 ago
from FastEthernet1/2
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 1, topology change 6, notification 0, aging 0
Port 42 (FastEthernet1/1) of VLAN10 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.42.
Designated root has priority 8192, address c404.10c8.0001
Designated bridge has priority 8192, address c404.10c8.0001
Designated port id is 128.42, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 1741, received 14
Port 43 (FastEthernet1/2) of VLAN10 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.43.
Designated root has priority 8192, address c404.10c8.0001
Designated bridge has priority 8192, address c404.10c8.0001
Designated port id is 128.43, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 1767, received 55
Port 55 (FastEthernet1/14) of VLAN10 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.55.
Designated root has priority 8192, address c404.10c8.0001
Designated bridge has priority 8192, address c404.10c8.0001
Designated port id is 128.55, designated path cost 0 Hello is pending
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 1768, received 78
Port 56 (FastEthernet1/15) of VLAN10 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.56.
Designated root has priority 8192, address c404.10c8.0001
Designated bridge has priority 8192, address c404.10c8.0001
Designated port id is 128.56, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 1735, received 37
sw1#show spanning-tree vlan 20
VLAN20 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 16384, address c404.10c8.0002
Configured hello time 2, max age 20, forward delay 15
Current root has priority 8192, address c405.10c8.0002
Root port is 55 (FastEthernet1/14), cost of root path is 19
Topology change flag not set, detected flag not set
Number of topology changes 3 last change occurred 00:47:56 ago
from FastEthernet1/15
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0, aging 0
Port 42 (FastEthernet1/1) of VLAN20 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.42.
Designated root has priority 8192, address c405.10c8.0002
Designated bridge has priority 16384, address c404.10c8.0002
Designated port id is 128.42, designated path cost 19
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 1727, received 5
Port 43 (FastEthernet1/2) of VLAN20 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.43.
Designated root has priority 8192, address c405.10c8.0002
Designated bridge has priority 16384, address c404.10c8.0002
Designated port id is 128.43, designated path cost 19
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 1725, received 2
Port 55 (FastEthernet1/14) of VLAN20 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.55.
Designated root has priority 8192, address c405.10c8.0002
Designated bridge has priority 8192, address c405.10c8.0002
Designated port id is 128.55, designated path cost 0
Timers: message age 2, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 292, received 1415
Port 56 (FastEthernet1/15) of VLAN20 is blocking
Port path cost 19, Port priority 128, Port Identifier 128.56.
Designated root has priority 8192, address c405.10c8.0002
Designated bridge has priority 8192, address c405.10c8.0002
Designated port id is 128.56, designated path cost 0
Timers: message age 2, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 288, received 1367
设备配置文件:
R1#show running-config
Building configuration...
Current configuration : 1196 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
interface Loopback0
ip address 100.100.100.1 255.255.255.0
!
interface FastEthernet0/0
ip address 10.10.10.1 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 20.20.20.1 255.255.255.0
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface Serial0/2
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
ip address 30.30.30.1 255.255.255.0
duplex auto
speed auto
!
router ospf 110
log-adjacency-changes
network 10.10.10.0 0.0.0.255 area 0
network 20.20.20.0 0.0.0.255 area 0
network 30.30.30.0 0.0.0.255 area 0
network 100.100.100.0 0.0.0.255 area 1
!
!
no ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
sw1#show running-config
Building configuration...
Current configuration : 2403 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
!
!
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree vlan 10 priority 8192
spanning-tree vlan 20 priority 16384
!
!
!
!
!
!
interface Port-channel1
switchport mode trunk
!
interface FastEthernet0/0
ip address 10.10.10.2 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface Serial0/2
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
!
interface FastEthernet1/1
switchport mode trunk
!
interface FastEthernet1/2
switchport mode trunk
!
interface FastEthernet1/3
switchport mode trunk
!
interface FastEthernet1/4
switchport mode trunk
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
switchport mode trunk
channel-group 1 mode on
!
interface FastEthernet1/15
switchport mode trunk
channel-group 1 mode on
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
standby 10 ip 192.168.10.254
standby 10 priority 120
standby 10 preempt
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
standby 20 ip 192.168.20.254
standby 20 priority 110
standby 20 preempt
!
router ospf 110
log-adjacency-changes
network 10.10.10.0 0.0.0.255 area 0
network 20.20.20.0 0.0.0.255 area 0
network 30.30.30.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
!
ip classless
!
!
no ip http server
no ip http secure-server
!
mac-address-table static c404.10c8.0000 interface FastEthernet1/14 vlan 10
mac-address-table static c404.10c8.0000 interface FastEthernet1/14 vlan 20
mac-address-table static 0000.0c07.ac0a interface FastEthernet1/14 vlan 10
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
sw2#show run
Building configuration...
Current configuration : 2207 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
!
!
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree vlan 10 priority 16384
spanning-tree vlan 20 priority 8192
!
!
!
!
!
!
interface Port-channel1
switchport mode trunk
!
interface FastEthernet0/0
ip address 20.20.20.2 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface Serial0/2
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
!
interface FastEthernet1/1
switchport mode trunk
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
switchport mode trunk
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
switchport mode trunk
channel-group 1 mode on
!
interface FastEthernet1/15
switchport mode trunk
channel-group 1 mode on
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 192.168.10.4 255.255.255.0
standby 10 ip 192.168.10.254
standby 10 priority 110
standby 10 preempt
!
interface Vlan20
ip address 192.168.20.4 255.255.255.0
standby 20 ip 192.168.20.254
standby 20 priority 120
standby 20 preempt
!
router ospf 110
log-adjacency-changes
network 10.10.10.0 0.0.0.255 area 0
network 20.20.20.0 0.0.0.255 area 0
network 30.30.30.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
!
ip classless
!
!
no ip http server
no ip http secure-server
!
mac-address-table static 0000.0c07.ac14 interface FastEthernet1/15 vlan 20
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
sw3#show run
Building configuration...
Current configuration : 1458 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
!
!
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
interface Serial0/2
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet1/0
!
interface FastEthernet1/1
switchport access vlan 10
!
interface FastEthernet1/2
switchport access vlan 20
!
interface FastEthernet1/3
switchport mode trunk
!
interface FastEthernet1/4
switchport mode trunk
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
!
interface Vlan1
no ip address
!
ip classless
!
!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
sw4#show run
Building configuration...
*Mar 1 00:54:23.951: %SYS-5-CONFIG_I: Configured from console by console
Current configuration : 1257 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
ip subnet-zero
ip cef
!
!
!
!
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
!
interface FastEthernet1/1
!
interface FastEthernet1/2
switchport mode trunk
!
interface FastEthernet1/3
switchport mode trunk
!
interface FastEthernet1/4
switchport access vlan 10
!
interface FastEthernet1/5
switchport access vlan 20
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
!
interface Vlan1
no ip address
!
ip classless
!
!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end