Network environment: a 3550EMI switches, cisco1921-sec/k9 divided into three VLAN, vlan2 as the server in the network, named server, IP address
ranges for 192.168.2.0,subnet
mask: 255.255.255.0, gateway: 192.168.2.1, domain server for the windows 2000 advance server, at the same time as the
DNS server, IPaddress for
192.168.2.10, vlan3 for the client 1 local network, IP address is192.168.3.0, subnet mask: 255.255.255.0, gateway: 192.168.3.1 named work01, vlan4 as the client 2 where
the network, named work02, IP address
ranges for 192.168.4.0, subnet mask: 255.255.255.0, gateway:192.168.4.13550 as DHCP server, 1-8 into
the VLAN port 2, port 9-16 partitionto VLAN 3, port 17-24 into VLAN
4
To realize
the function of DHCP server: the VLAN retains the 2-10 IP addressis not configured, for example: 192.168.2.0 segment, reserved IP address192.168.2.2 to 192.168.2.10 are not assigned.
Safety
requirements: VLAN 3 and VLAN 4 are not allowed to visit each other,but they can access the server in VLAN
2, the default access control list ofrules is to reject all packets.
Configuration
commands and steps are as follows:
The first step: create VLAN:
Switch>en
Switch#Vlan Database
Switch (Vlan) >Vlan 2 Name server
Switch (Vlan) >Vlan 3 Name work01
Switch (VLAN) >Vlan 4 Name work02
The second step: setting the VLAN IP address:
Switch#Config T
Switch (Config) >Int Vlan 2
Switch (Config-vlan) Ip Address 192.168.2.1 255.255.255.0
Switch (Config-vlan) No Shut
Switch (Config-vlan) >Int Vlan 3
Switch (Config-vlan) Ip Address 192.168.3.1 255.255.255.0
Switch (Config-vlan) No Shut
Switch (Config-vlan) >Int Vlan 4
Switch (Config-vlan) Ip Address 192.168.4.1 255.255.255.0
Switch (Config-vlan) No Shut
Switch (Config-vlan) Exit
/ * Note: since no port configuration to the VLAN2, 3, 4, so the VLAN will beDOWN off, the port assigned to each VLAN, VLAN up.
The third step: set port global parameters
Switch (Config) Interface Range Fa 0/1
24
Switch (Config-if-range) Switchport Mode Access
Switch (Config-if-range) Spanning-tree Portfast
The fourth step: the port is added to the VLAN2, 3, 4
/ * the port 1-8 is added to the VLAN 2*/
Switch (Config) Interface Range Fa 0/1
8
Switch (Config-if-range) Switchport Access Vlan 2
/ * the port 9-16 is added to the VLAN 3*/
Switch (Config) Interface Range Fa 0/9
16
Switch (Config-if-range) Switchport Access Vlan 3
/ * the port 17-24 is added to the VLAN 4*/
Switch (Config) Interface Range Fa 0/17
24
Switch (Config-if-range) Switchport Access Vlan 4
Switch (Config-if-range) Exit
/ * after this step, the VLAN will rise.
The fifth step: 3550 as
the DHCP server configuration
/*VLAN 2 can address
pool and the corresponding
parameters configuration, a few VLAN to a
few address pool.
Switch (Config) Ip Dhcp Pool Test01
/ * * / set
the subnet can be assigned
Switch (Config-pool) Network 192.168.2.0 255.255.255.0
/ * set the DNS server.
Switch (Config-pool) Dns-server 192.168.2.10
Gateway / / set the subnet
Switch (Config-pool) Default-router 192.168.2.1
/ * configuration VLAN 3 used by the address pool and the corresponding parameters.
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
/ * configuration VLAN 4 used by the address pool and the corresponding parameters.
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
The sixth step: setting the reserved not allocate DHCP address
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
The seventh step: enable routing
/ * routing is enabled, the VLAN host can access each other.
Switch (Config) Ip Routing
The eighth step: Configuration Access Control List
Switch (Config) access-list 103 permit IP 192.168.2.0 0.0.0 .255 192.168.3.00.0.0.255
Switch (Config) access-list 103 permit IP 192.168.3.0 0.0.0 .255 192.168.2.00.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.00.0.0.255
Switch (Config) access-list 104 permit IP 192.168.4.0 0.0.0 .255 192.168.2.00.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
The ninth step: the application of access control list
/ * the access
control list to VLAN 3 and VLAN 4, VLAN 2 does not need.
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
The tenth step: the end and save the configuration
Switch (Config-vlan) End ws-c2960-48pst-l price
Switch#Copy Run Start
switch and router : http://ciscoswitches.webgarden.com/
没有评论:
发表评论