Pages

Tuesday, May 8, 2012

VLAN Setup On HP Procurve Switch and Cisco Router

If you have a network with a Cisco router and HP Procurve switches and you want to setup VLANs, here is how to do it

Setup for this example:
  • HP Procurve 4200 series switch
  • Cisco Router
  • IP Address Range: 10.100.xxx.xxx
  • VLANs: 200, 20, 21, 22, and 23
  • DHCP Server Address: 10.100.20.10 Subnet Mask: 255.255.255.0


On the HP Procurve 4200 switch, log on to the command line. Enter the configuration mode by typing "config" and type the following commands:

ip routing
ip route 0.0.0.0 0.0.0.0 10.100.1.1

vlan 200
     ip address 10.100.1.2 255.255.255.0
     untagged tagged E1

vlan 20
     ip address 10.100.20.1 255.255.255.0
     ip helper-address 10.100.20.10
     tagged A1-A4,B1-B4,C1-C4,D1-D4
     exit
vlan 21
     ip address 10.100.21.1 255.255.255.0
     ip helper-address 10.100.20.10
     tagged A1-A4,B1-B4,C1-C4,D1-D4 
     exit
vlan 22
     ip address 10.100.22.1 255.255.255.0
     ip helper-address 10.100.20.10
     tagged A1-A4,B1-B4,C1-C4,D1-D4 
     exit
vlan 23
     ip address 10.100.23.1 255.255.255.0
     ip helper-address 10.100.20.10
     tagged A1-A4,B1-B4,C1-C4,D1-D4     
     exit
 write memory


These commands tell the Procurve switch that you want to use VLANs on switch ports A1 through D4. Switch port E1 is setup for the connection between the 4200 switch and the Cisco router. If you want to create more than 8 VLANs, you will need to run the below commands first in the configuration mode and then reboot the switch.
max-vlans 30
write memory
reload
 
On the Cisco router, enter privileged mode and then type "config terminal" to enter the configuration mode. Type the commands below.

int f0/0
     ip address 10.100.1.1 255.255.0.0
     exit
ip route 10.100.20.0 255.255.255.0 10.100.1.2
ip route 10.100.21.0 255.255.255.0 10.100.1.2
ip route 10.100.22.0 255.255.255.0 10.100.1.2
ip route 10.100.23.0 255.255.255.0 10.100.1.2
exit
copy running-config startup-config

You will need an ip route for every VLAN you want to create.

Remember, if you get stuck and need help remembering a command, type "?" and you will get a list of commands that you can run.

No comments:

Post a Comment