router1配置:
Router#show run
Building configuration...
Current configuration : 1283 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
username Router password 0 cisco
username cisco password 0 cisco
!
!
!
!
!
license udi pid CISCO2911/K9 sn FTX15249QW5
!
!
!
no ip domain-lookup
!
!
spanning-tree mode pvst
!
!
!
!
interface GigabitEthernet0/0
ip address 10.16.122.254 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address 10.16.121.254 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/2
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/3/0
ip address 10.16.123.2 255.255.255.252
!
interface Serial0/3/1
ip address 209.165.201.1 255.255.255.252
encapsulation ppp
ppp authentication chap
ip access-group 101 in
ip access-group 101 out
!
interface Vlan1
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 10.16.122.0 0.0.0.255 area 0
network 10.16.121.0 0.0.0.255 area 0
network 10.16.123.0 0.0.0.3 area 0
default-information originate
!
ip classless
ip route 0.0.0.0 0.0.0.0 209.165.201.2
!
!
access-list 101 permit icmp any any echo-reply
access-list 101 permit icmp any any unreachable
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
router2配置:
Router#show run
Building configuration...
Current configuration : 918 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
username Router password 0 cisco
username cisco password 0 cisco
!
!
!
!
!
license udi pid CISCO2911/K9 sn FTX1524Q66J
!
!
!
no ip domain-lookup
!
!
spanning-tree mode pvst
!
!
!
!
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/2
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/3/0
ip address 209.165.201.2 255.255.255.252
encapsulation ppp
ppp authentication chap
!
interface Serial0/3/1
no ip address
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 10.16.0.0 255.255.0.0 209.165.201.1
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
router0配置:
Router#show run
Building configuration...
Current configuration : 1444 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
!
!
!
!
license udi pid CISCO2911/K9 sn FTX1524WO7X
!
!
!
no ip domain-lookup
!
!
spanning-tree mode pvst
!
!
!
!
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
!
interface GigabitEthernet0/0.1
encapsulation dot1Q 1 native
no ip address
!
interface GigabitEthernet0/0.2
encapsulation dot1Q 2
ip address 10.16.124.254 255.255.255.0
!
interface GigabitEthernet0/0.11
encapsulation dot1Q 11
ip address 10.16.125.254 255.255.255.0
!
interface GigabitEthernet0/0.12
encapsulation dot1Q 12
ip address 10.16.126.254 255.255.255.0
!
interface GigabitEthernet0/0.13
encapsulation dot1Q 13
ip address 10.16.127.254 255.255.255.0
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/2
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/3/0
ip address 10.16.123.1 255.255.255.252
!
interface Serial0/3/1
no ip address
shutdown
!
interface Vlan1
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 10.16.123.0 0.0.0.3 area 0
network 10.16.124.0 0.0.0.255 area 0
network 10.16.125.0 0.0.0.255 area 0
network 10.16.126.0 0.0.0.255 area 0
network 10.16.127.0 0.0.0.255 area 0
!
ip classless
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
switch0配置:
Switch#show run
Building configuration...
Current configuration : 1087 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
no ip domain-lookup
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport mode trunk
!
interface FastEthernet0/3
switchport mode trunk
!
interface FastEthernet0/4
switchport access vlan 11
!
interface FastEthernet0/5
!
switch0 vtp 配置命令:
switch(config)#vtp domian cisco
switch(config)#vtp password cisco
switch(config)#vtp mode server
switch 1,2 配置主要是将互联口设置为trunk口 开启生成树协议(switch(config)#spanning-tree mode pvst);
其中vtp设置部分为:
switch vtp 配置命令:
switch(config)#vtp domian cisco
switch(config)#vtp password cisco
switch(config)#vtp mode client
2: pc 的ip地址可以根据网段随意设置
及供参考。共同学习共同进步。