Tuesday, July 7, 2009

Enable LACP on an HP Procurve switch

First off, make sure your switch supports LACP. Not all of them do. If yours doesn't, or at least doesn't out of the box, check to see if there are any firmware updates on HP's site that enable LACP support, which you can find at http://www.hp.com/rnd/software/switches.htm. You also want to make sure that the device you're connecting to the switch supports LACP too, but hopefully you've already done that since you're looking how to set it up.

Ok, to enable LACP (link aggregation control protocol) is pretty easy. You have to have admin access to your switch, and also access to the CLI (command line interface) which you can get through with a simple telnet session to your switch's IP address. There is dynamic LACP, which is more of an automated configuration, but it limits your LACP link to running in the default VLAN only. I believe you can just plug the Ethernet cables into your switch and it will automatically recognize LACP is setup, as long as it is already configured on the device you are connecting. If you have multiple VLANs and need LACP to run in a VLAN other than the default, the only option is to manually set up static LACP, which is what this post is going to cover.

1. Login to the CLI on your switch, which you can do by opening a telnet session to the switch's IP address
2. Enter the username and password when prompted
3. Use the command "config t" to get into the configuration terminal. You'll know this worked when you see (config) appended to the end of your device name.
4. Use the following command to create your LACP trunk of ports: "trunk 1-4 trk1 lacp" then press Enter. This will create a new LACP trunk using ports 1, 2, 3, and 4, and name it trk1. For trk1, you can use anything from trk1-trkX, where X is the last port number on your switch. You can substitute whichever ports you want to use to create your LACP trunk. If you just want to use trunking rather than LACP, simply replace LACP at the end with the word trunk
5. Use the command "show lacp" to check the settings. You should see columns for "LACP enabled", "LACP Partner", and "LACP status". Assuming you already have the device configured for LACP and plugged into your new LACP ports, those three columns should read "Active", "Yes", and "Success" respectively. If the first column says "Passive", go to step 5b. Otherwise skip right to step 6.
5b. Enable Active LACP mode on your trunk ports. To do this, make sure you're in config mode and then use the command "interface 1-4 lacp active", substituting the port numbers you used in your trunk in the command. The command above changes ports 1, 2, 3, and 4 to active LACP mode
6. Now you have to put your new LACP trunk into the correct VLAN. Let's say I want this trunk to be in VLAN 2. To do that, I'll use the command "vlan 2 untag trk1". Substitute the VLAN number and trunk number of the actual trunks you are going to be using
7. That's it. You should now have yourself a static LACP trunk on your HP Procurve switch, and it should be in the correct VLAN for you to start using.

If you want to remove a port from your trunk at some point, you can use "no trunk 1" which would remove port 1 from the trunk. You can use port ranges too, so "no trunk 1-4" would completely remove the trunk that was setup in the example.

For more information, check out the pdf instructions from HP here. To see the original post that pointed me in the correct direction, click here.

10 comments:

Anonymous said...

Hi,
many thanks 2 for this one, it helps me very well out during a big project with HP Switches and a huge VMWARE CLuster.

Tanguy said...

Hi,

Thank you for your well explained tutorial. I just have a question :
When I enter show Trunks it is said Load Balancing (Type is LACP). How can I make a link aggregation ? (To have a 4Gb link between switches).
Thanks !

rslygh said...

LACP is link aggregation, so your trunks sound like they're setup correctly. As long as your network cards support LACP you should be able to configure them to create a link aggregation on your machine (not the switch). Then make sure you plug them into your LACP ports on the switch. For an HP server that I have, I created an LACP network team the in HP Network Configuration Utility and it worked just fine.

Anonymous said...

Thanks its help.

Anonymous said...

Big thanks!

Unknown said...

hello admin.. i have one question tht not related to this post.. :)

my question is.. how can i connect/ping VLAN1 in switch1 and VLAN1 in switch2 using trunk port..

rslygh said...

Assuming VLAN1 on both switches is part of the same subnet, you should be able to create a trunk on each in VLAN1 and then connect them with a patch cable. If VLAN1 on each is in different subnets, then you need to look into setting up routing. Let's say VLAN11 is VLAN1 on switch1, and VLAN12 is VLAN1 on switch2. You could create a trunk on switch1 and create VLAN2 with it, and create your other trunk directly in VLAN12. Then plug VLAN2 into VLAN12 with a patch cable, and configure switch 1 to allow routing between VLAN11 and VLAN2.

Mathiau said...

Much appreciated!

Anonymous said...

Hi,

If both switch will only be using the default vlan, does a vlan still need to be assign to the trunk?

Thank for for sharing.

rslygh said...

No, you shouldn't have to change the VLAN assignment to the trunk ports if you aren't using anything besides DEFAULT_VLAN.

You may not even need to go through this process in that case though if you setup your NIC teaming on the device you're connecting. In that case, the switch should auto-configure the trunk within the DEFAULT_VLAN for you. In my example I needed the trunk in a different VLAN, which is why I had to manually create it.