左边交换机的配置:
Switch(config)#do show run
Building configuration...
Current configuration : 1205 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/3
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end
R0的配置
Router#show run
Building configuration...
Current configuration : 1064 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
ip cef
no ipv6 cef
spanning-tree mode pvst
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
ip helper-address 10.1.12.2
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
ip helper-address 10.1.12.2
!
interface FastEthernet0/1
ip address 10.1.12.1 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 10.1.12.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
!
ip flow-export version 9
line con 0
!
line aux 0
!
line vty 0 4
login
!
end
R1的配置
Router#show run
Building configuration...
Current configuration : 1155 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
ip dhcp pool 10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 61.139.2.69
ip dhcp pool 20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
dns-server 61.139.2.69
ip cef
no ipv6 cef
spanning-tree mode pvst
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 10.1.12.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
!
interface FastEthernet0/1.1
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
!
interface FastEthernet0/1.2
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
!
interface Vlan1
no ip address
shutdown
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 10.1.12.0 0.0.0.255 area 0
network 2.2.2.2 0.0.0.0 area 0
ip classless
ip flow-export version 9
no cdp run
line con 0
!
line aux 0
!
line vty 0 4
login
end
右边交换机的配置
Switch#show run
Building configuration...
Current configuration : 1205 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch