Switch#conf T
Switch (config) #no IP domain-lookup
Switch#vlan Database
Switch (VLAN) #vlan 2
Switch (VLAN) #vlan 3
Switch (config) #int VLAN 2
Switch (config-if) #ip address 192.168.2.1 255.255.255.0
Switch (config-if) #no shutdown
Switch (config) #int VLAN 3
Switch (config-if) #ip address 192.168.3.1 255.255.255.0
Switch (config-if) #no shutdown
Switch (config) #interface fastethernet 0/24
Switch (config-if) #switchport trunk Encapsulation dot1q--Cisco Configuration Trunk Encapsulation ISL or 802.1Q or autonegotiation
Switch (config-if) #switchport mode trunk
Switch (config) #ip DHCP pool vlan2
Switch (dhcp-config) #network 192.168.2.0 192.168.2.255
Switch (dhcp-config) #default-router 192.168.2.1
Switch (config) #ip DHCP pool VLAN3
Switch (dhcp-config) #network 192.168.3.0 192.168.3.255
Switch (dhcp-config) #default-router 192.168.3.1
Switch (config) #ip dhcp excluded-address 192.168.2.1 192.168.2.10
Switch (config) #ip dhcp excluded-address 192.168.3.1 192.168.3.10
Set the exclusion address to 192.168.2.1 to 192.168.2.10 IP addresses not assigned to clients
Two-storey
Switch (config) #interface fastethernet 0/24
Switch (config-if) #switchport mode trunk
Switch#vlan Database
Switch (VLAN) #vlan 2
Switch (VLAN) #vlan 3
Switch (config) #int range fastethernet 0/1-5
Switch (config-if-range) #switchport Access VLAN 2
Switch (config) #int range fastethernet 0/6-10
Switch (config-if-range) #switchport Access VLAN 3
This article is from the "Little Geek a" blog, please be sure to keep this source http://howardhuang.blog.51cto.com/9812975/1662777
Three-layer + two-layer switch divides two VLANs