R1配置
R1#show run
Building configuration...
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname R1
!
!
!
ip subnet-zero
!
!
!
!
!
!
!
!
!
interface Serial0
no ip address
no ip directed-broadcast
shutdown
!
interface FastEthernet0/0
no ip address
no ip directed-broadcast
bandwidth 100000
shutdown
!
interface FastEthernet0/0.1
encapsulation dot1q 2
ip address 192.168.1.1 255.255.255.0
!
!
interface FastEthernet0/0.2
encapsulation dot1q 3
ip address 192.168.2.1 255.255.255.0
!
!
interface FastEthernet0/1
no ip address
no ip directed-broadcast
bandwidth 100000
shutdown
!
interface Bri0
no ip address
no ip directed-broadcast
shutdown
!
!
!
ip classless
no ip http server
!
!
!
!
!
line con 0
transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end
SW1配置
SW1#show run
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW1
!
!
!
ip subnet-zero
spanning-tree extend system-id
!
!
!
!
!
!
!
!
!
interface FastEthernet0/1
switchport mode access
switchport access vlan 2
!
interface FastEthernet0/2
switchport mode access
switchport access vlan 3
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
switchport mode trunk
switchport trunk encapsulation dot1q
!
interface FastEthernet0/12
switchport mode trunk
switchport trunk encapsulation dot1q
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
vtp Server
vtp domain cisco
vtp password cisco
!
interface Vlan 1
no ip address
no ip route-cache
!
vlan 2 name cisco
vlan 3 name huawei
!
!
!
ip classless
no ip http server
!
!
!
!
!
line con 0
transport input none
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
no scheduler allocate
end
SW2配置
SW2# show run
!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW2
!
!
!
ip subnet-zero
spanning-tree extend system-id
!
!
!
!
!
!
!
!
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
switchport mode access
switchport access vlan 2
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
switchport mode trunk
switchport trunk encapsulation dot1q
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
vtp Client
vtp domain cisco
vtp password cisco
!
interface Vlan 1
no ip address
no ip route-cache
!
vlan 2 name cisco
vlan 3 name huawei
!
!
!
ip classless
no ip http server
!
!
!
!
!
line con 0
transport input none
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
no scheduler allocate
end