sw1交换机配置
enable
conf t
host sw1
line c 0
logg sy
end
vlan data
vlan 2
vlan 3
exit
conf t
int r f 0/2 - 9
sw ac v 2
no shut
exit
int r f 0/10 - 15
sw ac v 3
no shut
exit
int f0/0
switchport mode trunk
no shut
end
wr
show run

sw2交换机配置
enable
conf t
host sw2
line c 0
logg sy
end
vlan data
vlan 2
vlan 3
exit
conf t
int r f 0/3 - 9
sw ac v 2
no shut
exit
int r f 0/10 - 15
sw ac v 3
no shut
exit
int f0/0
switchport mode trunk
no shut
end
wr
show run
 
RIP V2 配置
r1配置
enable
conf t
host r1
no ip do lo
line c 0
logg sy
exit
int e0/1
ip add 192.168.40.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.10.1 255.255.255.0
no shut
exit
router rip
vers 2
no auto-s
network 192.168.0.0
network 192.168.10.0
network 192.168.40.0
end
write
show run

r2配置
enable
conf t
host r2
no ip do lo
line c 0
logg sy
exit
int e0/0
ip add 192.168.50.1 255.255.255.0
no shut
exit
int e0/1
ip add 192.168.40.2 255.255.255.0
no shut
exit
router rip
vers 2
no auto-s
network 192.168.40.0
network 192.168.50.0
end
write
show run

r3配置
enable
conf t
host r3
no ip do lo
line c 0
logg sy
exit
int e0/1
ip add 192.168.50.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.20.1 255.255.255.0
no shut
exit
int e0/0.2
enc dot1q 3
ip add 192.168.30.1 255.255.255.0
no shut
exit
router rip
vers 2
no auto-s
network 192.168.50.0
network 192.168.20.0
network 192.168.30.0
end
write
show run
 

静态路由配置
r1配置
enable
conf t
host r1
no ip do lo
line c 0
logg sy
exit
int e0/1
ip add 192.168.40.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.10.1 255.255.255.0
no shut
exit
ip route 0.0.0.0 0.0.0.0 192.168.40.2
exit
write
show run
 
r2配置
enable
conf t
host r2
no ip do lo
line c 0
logg sy
exit
int e0/0
ip add 192.168.50.1 255.255.255.0
no shut
exit
int e0/1
ip add 192.168.40.2 255.255.255.0
no shut
exit
ip route 192.168.0.0 255.255.255.0 192.168.40.1
ip route 192.168.10.0 255.255.255.0 192.168.40.1
ip route 192.168.20.0 255.255.255.0 192.168.50.2
ip route 192.168.30.0 255.255.255.0 192.168.50.2
exit
write
show run
 

r3配置
enable
conf t
host r3
no ip do lo
line c 0
logg sy
exit
int e0/1
ip add 192.168.50.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.20.1 255.255.255.0
no shut
exit
int e0/0.2
enc dot1q 3
ip add 192.168.30.1 255.255.255.0
no shut
exit
ip route 0.0.0.0 0.0.0.0 192.168.50.1
exit
write
no shut
 

VPC 配置
ip 192.168.0.2 192.168.0.1 24
2
ip 192.168.10.2 192.168.10.1 24
3
ip 192.168.20.2 192.168.20.1 24
4
ip 192.168.30.2 192.168.30.1 24
1
show