拓扑图如下:
三层交换+vlan+dhcp(基本配置)_vlan
 
3L配置如下:
Building configuration...
Current configuration : 1464 bytes
!
version 12.2
no service password-encryption
!
hostname Switch
!
!
ip routing
!
!
!
!
ip ssh version 1
!
port-channel load-balance src-mac
!
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
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
 switchport mode trunk
!
interface FastEthernet0/24
 switchport mode trunk
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 ip address 192.168.1.1 255.255.255.0
!
interface Vlan23
 ip address 192.168.2.1 255.255.255.0
!
interface Vlan33
 ip address 192.168.3.1 255.255.255.0
!
ip classless
!
!
!
ip dhcp excluded-address 192.168.2.1
ip dhcp excluded-address 192.168.3.1
!
ip dhcp pool vlan23
 network 192.168.2.0 255.255.255.0
 default-router 192.168.2.1
 dns-server 202.103.225.68
ip dhcp pool vlan33
 network 192.168.3.0 255.255.255.0
 default-router 192.168.3.1
 dns-server 202.103.225.68
!
line con 0
line vty 0 4
 login
!
!
end
 
配置成功vlan23pc
三层交换+vlan+dhcp(基本配置)_dhcp_02
 
vlan33pc
三层交换+vlan+dhcp(基本配置)_dhcp_03