拓朴如下,用的是dy模拟器,iso是unzip-c3640-ik9o3s-mz.124-10.bin




模拟器不保存vlan信息:
(config)#vtp file nvram:vlan.dat
Setting device to store VLAN database at filename nvram:vlan.dat.
Switch(Config)Service Dhcp //默认是开启的
Switch(Config)Ip Dhcp Relay Information Option//这句不用配也可以分的。
交换机配置如下:
Switch1#show running
Building configuration...
Current configuration : 1398 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Switch1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
!
!
vtp file nvram:vlan.dat
!
interface FastEthernet0/0
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
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
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
switchport mode trunk
!
interface FastEthernet0/15
switchport mode trunk
!
interface Vlan1
ip address 192.168.254.1 255.255.255.0
no ip route-cache
!
interface Vlan2
no ip address
ip helper-address 192.168.168.168
no ip route-cache
!
interface Vlan3
no ip address
ip helper-address 192.168.168.168
no ip route-cache
!
interface Vlan4
no ip address
ip helper-address 192.168.168.168
no ip route-cache
!
interface Vlan168
no ip address
no ip route-cache
!
ip default-gateway 192.168.254.2
ip http server
!
!
!
!
!
!
control-plane
!
!
!
line con 0
line aux 0
line vty 0 4
privilege level 15
password onepc
login
!
!
end
///////////////////////////////////////////////////////////////////
Switch2#show running-config
Building configuration...
Current configuration : 1458 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Switch2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
vtp file nvram:vlan.dat
!
!
!
!
interface FastEthernet0/0
switchport access vlan 168
!
interface FastEthernet0/1
switchport access vlan 168
!
interface FastEthernet0/2
switchport access vlan 2
!
interface FastEthernet0/3
switchport access vlan 2
!
interface FastEthernet0/4
switchport access vlan 2
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
switchport mode trunk
!
interface Vlan1
ip address 192.168.254.2 255.255.255.0
!
interface Vlan2
ip address 192.168.2.1 255.255.255.0
ip helper-address 192.168.168.168
!
interface Vlan3
ip address 192.168.3.1 255.255.255.0
ip helper-address 192.168.168.168
!
interface Vlan4
ip address 192.168.4.1 255.255.255.0
ip helper-address 192.168.168.168
!
interface Vlan168
ip address 192.168.168.1 255.255.255.0
!
ip http server
!
!
!
!
!
!
control-plane
!
!
!
!
line con 0
line aux 0
line vty 0 4
privilege level 15
password onepc
login
!
!
end
Switch2#
/////////////////////////////////////////////////////////////////
Switch3#show running
Building configuration...
Current configuration : 1389 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Switch3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
!
!
!
vtp file nvram:vlan.dat
!
!
!
!
interface FastEthernet0/0
switchport access vlan 3
!
interface FastEthernet0/1
switchport access vlan 4
!
interface FastEthernet0/2
switchport access vlan 4
!
interface FastEthernet0/3
switchport access vlan 4
!
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
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
switchport mode trunk
!
interface Vlan1
ip address 192.168.254.3 255.255.255.0
no ip route-cache
!
interface Vlan2
no ip address
ip helper-address 192.168.168.168
no ip route-cache
!
interface Vlan3
no ip address
ip helper-address 192.168.168.168
no ip route-cache
!
interface Vlan4
no ip address
ip helper-address 192.168.168.168
no ip route-cache
!
ip default-gateway 192.168.254.2
ip http server
!
!
!
!
!
!
control-plane
!
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
!
end