sw 1配置
enable
conf t
host sw1
line c 0
logg sy
end
vlan data
vlan 2
vlan 3
vlan 4
vlan 5
vlan 6
exit
conf t
int r f 0/2 - 5
no shut
sw ac v 2
exit
int f0/0
switchport mode trunk
no shut
exit
int f0/1
switchport mode trunk
no shut
end
write
show run
show vlan-s
 
sw2 配置
enable
conf t
host sw2
line c 0
logg sy
end
vlan data
vlan 2
vlan 3
vlan 4
vlan 5
vlan 6
exit
conf t
int r f 0/1 - 5
no hsut
sw ac v 2
exit
int r f 0/6 - 10
no shut
sw ac v 3
exit
int r f 0/11 - 15
no shut
sw ac v 4
exit
int f0/0
no shut
switchport mode trunk
switchport trunk all vlan add 2
switchport trunk all vlan add 3
switchport trunk all vlan add 4
end
write
show run
show vlan-s

sw3配置
enable
conf t
host sw3
line c 0
logg sy
end
vlan data
vlan 2
vlan 3
vlan 4
vlan 5
vlan 6
exit
conf t
int r f 0/1 - 8
no shut
sw ac v 5
exit
int r f 0/9 - 15
no shut
sw ac v 2
exit
int f0/0
no shut
switchport mode trunk
switchport trunk all valn add 2
switchport trunk all vlan add 5
end
write
show run
show vlan-s

sw4配置
enable
conf t
host sw4
line c 0
logg sy
end
vlan data
vlan 2
vlan 3
vlan 4
vlan 5
vlan 6
exit
conf t
int r f 0/1 - 8
no shut
sw ac v 4
exit
int r f 0/9 - 15
no shut
sw ac v 3
exit
int f0/0
no shut
switchport mode trunk
switchport trunk all valn add 3
switchport trunk all vlan add 4
end
wr
show run
show vlan -s
 
sw5 配置
enable
conft
host sw5
line c 0
logg sy
end
vlan data
vlan 2
vlan 3
vlan 4
vlan 5
vlan 6
exit
conf t
int r f 0/3 - 5
sw ac v 6
no shut
exit
int f0/0
no shut
switchport mode trunk
exit
int f0/1
no shut
switchport mode trunk
end
write
show run
show vlan-s
 
r1 配置
enable
conf t
host r1
no ip do lo
line c 0
logg sy
exit
int e0/1
ip add 192.168.5.1 255.255.255.0
no shut
exit
int e0/2
ip add 192.168.7.1 255.255.255.0
no shut
exit
int e0/0
no shut
exit
int e0/0.1
enc dot1q 2
ip add 192.168.0.1 255.255.255.0
no shut
exit
int e0/0.2
enc dot1q 3
ip add 192.168.1.1 255.255.255.0
no shut
exit
int e0/0.3
enc dot1q 4
ip add 192.168.2.1 255.255.255.0
no shut
end
wr
show run
 
r2 配置
enable
conf t
host r2
no ip do lo
line c 0
logg sy
exit
int e0/1
ip add 192.168.7.2 255.255.255.0
no shut
exit
int e0/2
ip add 192.168.6.2 255.255.255.0
no shut
exit
int e0/0
no shut
exit
int e0/0.1
enc dot1q 2
ip add 192.168.0.6 255.255.255.0
no shut
exit
int e0/0.2
enc dot1q 5
ip add 192.168.3.1 255.255.255.0
no shut
end
wr
show run
 
r3配置
enable
conf t
host r3
no ip do lo
line c 0
logg sy
exit
int e0/1
no shut
ip add 192.168.5.2 255.255.255.0
exit
int e0/2
ip add 192.168.6.1 255.255.255.0
no shut
exit
int e0/0
no shut
exit
int e0/0.1
enc dot1q 3
ip add 192.168.1.5 255.255.255.0
no shut
exit
int e0/0.2
enc dot1q 4
ip add 192.168.2.5 255.255.255.0
no shut
exit
int e0/0.3
enc dot1q 6
ip add 192.168.4.21 255.255.255.0
no shut
end
wr
show run
 

vpc 配置

ip 192.168.0.2 192.168.0.1 24
2
ip 192.168.0.3 192.168.0.1 24
3
ip 192.168.1.2 192.168.1.1 24
4
ip 192.168.2.2 192.168.2.1 24
5
ip 192.168.3.2 192.168.3.1 24
6
ip 192.168.0.4 192.168.0.6 24
7
ip 192.168.2.3 192.168.2.5 24
8
ip 192.168.1.3 192.168.1.5 24
9
ip 192.168.4.2 192.168.4.1 24
1
show