第五步:配置3550作为DHCP服务器
/*VLAN 2可用地址池和相应参数的配置,有几个VLAN要设几个地址池*/
Switch(Config)Ip Dhcp Pool Test01
/*设置可分配的子网*/
Switch(Config-pool)Network 192.168.2.0 255.255.255.0
/*设置DNS服务器*/
Switch(Config-pool)Dns-server 192.168.2.10
/*设置该子网的网关*/
Switch(Config-pool)Default-router 192.168.2.1
/*配置VLAN 3所用的地址池和相应参数*/
Switch(Config)Ip Dhcp Pool Test02
Switch(Config-pool)Network 192.168.3.0 255.255.255.0
Switch(Config-pool)Dns-server 192.168.2.10
Switch(Config-pool)Default-router 192.168.3.1
/*配置VLAN 4所用的地址池和相应参数*/
Switch(Config)Ip Dhcp Pool Test03
Switch(Config-pool)Network 192.168.4.0 255.255.255.0
Switch(Config-pool)Dns-server 192.168.2.10
Switch(Config-pool)Default-router 192.168.4.1
第六步:设置DHCP保留不分配的地址
Switch(Config)Ip Dhcp Excluded-address 192.168.2.2 192.168.2.10
Switch(Config)Ip Dhcp Excluded-address 192.168.3.2 192.168.3.10
Switch(Config)Ip Dhcp Excluded-address 192.168.4.2 192.168.4.10
第七步:启用路由
/*路由启用后,各VLAN间主机可互相访问*/
Switch(Config)Ip Routing
第八步:配置访问控制列表
Switch(Config)access-list 103 permit ip 192.168.2.0 0.0.0.255 192.168.3.0 0.0.0.255
Switch(Config)access-list 103 permit ip 192.168.3.0 0.0.0.255 192.168.2.0 0.0.0.255
Switch(Config)access-list 103 permit udp any any eq bootpc
Switch(Config)access-list 103 permit udp any any eq tftp
Switch(Config)access-list 103 permit udp any eq bootpc any
Switch(Config)access-list 103 permit udp any eq tftp any
Switch(Config)access-list 104 permit ip 192.168.2.0 0.0.0.255 192.168.4.0 0.0.0.255
Switch(Config)access-list 104 permit ip 192.168.4.0 0.0.0.255 192.168.2.0 0.0.0.255
Switch(Config)access-list 104 permit udp any eq tftp any
Switch(Config)access-list 104 permit udp any eq bootpc any
Switch(Config)access-list 104 permit udp any eq bootpc any
Switch(Config)access-list 104 permit udp any eq tftp any
第九步:应用访问控制列表
/*将访问控制列表应用到VLAN 3和VLAN 4,VLAN 2不需要*/
Switch(Config)Int Vlan 3
Switch(Config-vlan)ip access-group 103 out
Switch(Config-vlan)Int Vlan 4
Switch(Config-vlan)ip access-group 104 out
第十步:结束并保存配置
Switch(Config-vlan)End
Switch#Copy Run Start

发表评论