How To Configure Access Lists & Route Between VLAN’s On HP v1910 24G

In the previous how to, we configured layer 3 static routes and VLAN’s on the HP v1910 24G you will have noticed that all traffic can pass between VLAN’s without any restrictions.  So why is this happening?

Well the answer is because we have turned on routing by giving an IP Address to each VLAN.  This means the HP v1910 uses it’s own routing table to send traffic from VLAN 1 to VLAN 10.

Let’s test this.  My laptop sits on VLAN 1 on IP Address 192.168.37.152 using the HP v1910G as it’s default gateway on 192.168.37.221

VLAN 1

I have five VLAN Interfaces created which can be found under Network > VLAN Interface > Summary

VLAN 2

Behind VLAN 10 is a device with IP Address 10.37.10.11, which I can ping

VLAN 3

Next, I’m going to remove the VLAN Interface for VLAN 10

VLAN 4

Don’t worry, the VLAN is still in play, we just have removed the ability to route between subnets.  Now if we ping the same device we get an epic fail.

VLAN 5

Notice we get a reply from 192.168.37.254 which isn’t an VLAN IP Address.  The reason for this is that 192.168.37.254 is the default gateway for our HP v1910G.  The HP v1910G is saying I haven’t got a clue how to get to 10.37.10.11, so let me send that traffic to my default gateway 192.168.37.254.

VLAN 6

My firewall which is on 192.168.37.254 has a static route to 10.37.10.0 255.255.255.0 via 192.168.37.221 (VLAN 1 Interface on HP v1910G).  When the HP v1910G receives the packet, it drops it as has no where to send the ICMP request.

So just to reiterate, that when we have an VLAN Interface, the HP v1910G will be able to route all traffic between VLAN’s, unless we do something about it.

Access Lists

This is where the Access List comes into play, an Access List specifies what source traffic is allowed to get to what destination traffic.  Think of it as being in a hallway in a house and all the doors are locked.  You then get given a key and you can get from the hallway into the lounge.  The source is the hallway, the destination is the lounge and the key is the Access List.

So before we move any further, I want to give you a brief explanation of what I want to be able to achieve.

My laptop resides on 192.168.37.152/24 on VLAN 1 and I want to be able to connect to my HP StoreVirtual VSA which is on 10.37.20.1/24 VLAN 20.

I also have a Windows 7 machine on 10.37.20.211/24 VLAN 20.

I want to be able to get from my laptop to 10.37.20.1, but I don’t want to let any other traffic threw.

Let’s run a ping to both devices, you can see that I have connectivity to both 10.37.20.1 HP StoreVirtual VSA and 10.37.20.221 Windows 7.

VLAN 7

So let’s create an Access List to do something about this.

Creating An Access List

We need to go to QoS from the left hand menu then onto ACL IPv4

Next we want to select Create

Now we have a choice from Basic ACL’s, Advanced ACL’s and Ethernet Frame Header ACL’s.  OK what are the differences?

Basic ACL these only match source IPv4 address’s

Advanced ACL these match source and destination IPv4 address’s and also protocols on different port numbers e.g. TCP 80

Ethernet Frame Header ACL these match source and destination MAC addresses

With this is in mind, we are going to use Advanced ACL’s as we want to match interesting traffic from source to destination.

In the ACL Number section, type in 3001 and we want the match order to be Config and click Apply

You will see the ACL Number appear in the bottom table, notice we have no rules applied against it yet.

Next we want to go onto the Advanced Setup Tab at the top.  We are going to enter the following information:

  • ACL > Select 3001
  • Rule ID > Select and Enter 10
  • Action > Permit
  • Source IP Address > 192.168.37.152
  • Source Wildcard > 0.0.0.0
  • Destination IP Address > 10.37.20.1
  • Destination Wildcard > 0.0.0.0
  • Protocol > IP
  • Click Add

Now when you click on the Summary Tab you should see your rule in place!

VLAN 8

I want to back track slightly on some of the entries we made into the Advanced ACL, to make sure you are clear on what we did.

Rule ID this is the order in which the rules are read we entered in number 10, so this rule is read first, if you added a rule ID 9 this would get read before rule ID 10.

Wildcard this is the reverse of a normal subnet mask e.g. 255.255.255.0 becomes 0.0.0.255

TOP TIP: At the end of every Access List is always a silent deny, which means you don’t see the traffic being dropped it just happens!

Let’s see if it works shall we? Let’s ping from my laptop to a HP StoreVirtual VSA 10.37.20.1 success, what about the Windows 7 on 10.37.20.211, err also success, that’s not right!

VLAN 7

So what the heck is going on? Well as we haven’t applied the ACL3001 to an interface, everything carries on as per normal.

To be honest, applying an Access List to an interface on the HP v1910G is a royal pain.  For most switches you just choose to apply the ACL to an interface either inbound or outbound.  However, on the HP v1910G you have to perform the following:

  • Create a QoS Classifier
  • Create a QoS Behavior
  • Create a QoS Policy using the QoS Classifier and QoS Behavior
  • Apply the QoS Policy to a Port

I’m not going to run through how to do this, as examples can be found in the HP v1910G Manual page 465.

How To Configure Layer 3 Static Routes & VLAN’s On HP v1910 24G

In the last how to, we performed the firmware upgrade and initial configuration on the HP v1910 24G.

It’s now time to start  placing some VLAN’s onto our switch.  A good starting point is why do we use VLAN’s?

Well a VLAN enables us to:

  • Logically segment a switch into smaller switches, much same way that ESXi  allows you to run multiple virtual machines on the same physical hardware.
  • Create logical boundaries so that traffic from one VLAN to another VLAN is permitted or not permitted e.g. User VLAN accessing Server VLAN.
  • Reduce the broadcast domains, in the same way that a switch creates a separate collision domain for each device plugged into it.  A VLAN reduces the ARP broadcasts sent out.

Before we move any further, we need to understand what purpose the VLAN’s will serve in our environment and what they will be assigned too.  For me, it’s quite straight forward, the HP v1910 will be used as my main home lab switch and as such I need a VLAN for the following purposes:

  • Management
  • iSCSI
  • vMotion
  • Backup
  • HP Fail Over Manager

With this in mind, I would highly recommend creating a network table containing your VLAN Names, VLAN ID, Subnet and Switch IP Address. You may ask why do you bother? Well I deal with large number of clients infrastructure and I often find that I get confused as what subnet’s are doing what!

You will notice that I have assigned an IP address to the switch on every VLAN.  The reason for this is the HP v1910 can also do layer 3 static routing so in my home environment the switch is the default gateway as well.

Layer 3 Static Routes

OK, lets login to the HP v1910 24G using the IP address and username/password we assigned previously.

Why use layer 3 static routes? Well I want to be able to route between VLAN’s.  This is critical for my HP Failover Manager (FOM VLAN) which needs to be in a logical third site to communicate with the HP Virtual Storage Appliance (iSCSI VLAN).  For each device on each VLAN they will use the switch as there default gateway.  This means that the network traffic will only leave the switch if it has a destination subnet for which it is not responsible e.g. the internet.

To do this, click on Network from the left hand panel then IPv4 Routing

Click Create in the Destination IP Address enter 0.0.0.0 Mask enter 0.0.0.0 Next Hop enter 192.168.37.254 Select Preference and enter 10

So what are we actually doing? Well we are saying to the switch for ‘any destination IP address’ and ‘any subnet’ send all that traffic to this router/firewall whose IP address is 192.168.37.254 (next hop).

Hopefully it should look something like this.

Cool, let’s test it.  Change a computer to use the HP v1910 24G switch as it’s default gateway.

We should now be able to ping the switch, the switches next hop and also something out on the internet.

Boom, it’s all working, let’s move on!

VLAN Configuration

Hopefully, you have already decided on your VLAN configuration and IP address’s for the switch.  So let’s crack on and start configuring.

Select Network from the left hand menu then VLAN and then Create

My first VLAN ID is 10, so we enter this and click Create to the left hand side.   Next Modify the VLAN description from VLAN 0010 to iSCSI and then click Apply.

Rinse and repeat until you have entered all of your VLAN’s into the switch.  Here’s one I made earlier.

TOP TIP, don’t forget to click Save in the top right hand corner on a regular basis.

Great, we have created the VLAN’s now we need to assign them to some switch ports.  We need to understand what happens when we change the port characteristics.  The options we have are:

  • Untagged – what ever device we plug into this switch port will automatically be placed into this VLAN.  Commonly used for devices which are not VLAN aware (most desktops/laptops).
  • Tagged – if a device is VLAN aware and it has been assigned to a VLAN, when it is plugged into the switch port it won’t go into the Untagged VLAN, it will go into the Tagged VLAN (think IP phones)

As this switch is for my vSphere 5 environment and vSphere is VLAN aware.  We are going to set every port to be Tagged into every VLAN.  What will this achieve? Well every device which is not VLAN away will go straight into the Management VLAN.  Then on the port group’s within the vSwitches I can assign VLAN’s.

To do this, click Network from the left hand menu, then VLAN and finally Modify Port

By default every port will be ‘untagged’ in VLAN 1 so we don’t need to make any modifications to this. Click Select All then Tagged and last of all Enter the VLAN ID’s in this case 10,20,30,40 and click Apply.

You will receive a pop up letting you know that Access Ports will change to Hybrid Ports, we are cool with this, so Click OK.

To verify the VLAN’s have been set correctly, go to Port Detail and choose Select All, it should show the following.

Assign An IP Address To Each VLAN

I mentioned earlier on in the post that we wanted to assign an IP address to each VLAN so that the HP v1910 24G becomes the default gateway for all devices.  To do this  select Network from the left hand menu, then VLAN interface and Create.

Now this is when I need to refer back to my network table! We input the VLAN ID e.g. 10 and then enter the IP Address e.g. 10.37.10.221 and Mask e.g. 255.255.255.0

I always deselect ‘Configure IPv6 Link Local Address’ then click Apply.

Rinse and repeat for the rest of your VLAN’s.  To make sure everything is ‘tickety boo’ click on Summary and you should be greeted with a page similar to this.

Time to test.  So from your computer you should now be able to ping each VLAN IP address on the switch.

Success, that’s our HP v1910 24G configured with VLAN’s.

How To Firmware Upgrade HP v1910 24G Switch & Initial Configuration

So, I finally have my lab all cabled and I have a few spare minutes to start the initial configuration of the vmFocus lab.

What do we do first? Well I always start with networking and making sure that my switch is running the latest firmware.  OK, I do have one exception to this, when you check the manufacturer’s website, if you have release 8.9.5 and  9.0.0, I tend to stick with 8.9.5 as it should be more proven.

Anyway, back on topic, the HP v1910 24G switch is a beast for the money, some of it’s features are:

– Gigabit
– Layer 2 Managed
– Layer3 Static Routing with 32 routes
– Access Control Lists
– STP, RSTP and MSTP
– 802.3X Flow Control
– VLAN with 256 simultaneous
– Link Aggregation
– Lifetime Warranty

It should be a worthy addition to any home lab.

Firmware Upgrade

When I first opened up the switch, I was surprised by how light it was, but comparing this to Cisco’s which I work with on a daily basis (which cost 20x the amount) doesn’t seem fair.

The HP v1910 will pick up it’s IP address via DHCP, so depending on your environment, either check your DHCP servers newest address lease when you power it on or do a ping sweep of your network using something like IPScan

If you don’t have a DHCP server I would recommend using Antamedia DHCP Server, don’t worry it’s free.

Once you have located the IP address of the HP v1910 open up a web browser and type in the address.  Which in my case is http://192.168.37.104.  You should hopefully be greeted with this login screen:

I was quite surprised to see a ‘random’ text generator at the login screen but kudos to HP/3COM for the addition.  The default username and password is:

Username admin
Password

Once logged in, it should look something like this:

We are going to navigate to Device on the left hand side and then onto Device Management:

Now it’s time to download the latest firmware from HP, at the time of writing this blog the most recent firmware is 1910_5.20.R1512P05 which can be found here. Select this and begin the download

After the download completes select choose file

Select ‘if a file with the same name already exist, overwrite it without any prompt and also ‘reboot after the upgrade is finished’

Click on apply.  It will take approximately five minutes for the switch to come back up again, so go grab a cup of coffee before we move onto the next part.

Initial Setup

The first thing we are going to do is change the name of the switch, from HP, to do this select Device from the left hand column and then Basic.  Then enter a new name in ‘sysname’.  As you can see mine is named SW01 (very imaginative).  Don’t forgot to click ‘apply’

System time is perhaps one of the most overlooked items for networks.  I can’t stress how important this is, if you are trying to troubleshoot an error and the time stamps are 10-04-00 01:12, leaves you thinking when did the issue occur?

To setup select Device from the left hand column and then System Time and then Net Time.

In this example, we are using the Source Interface as VLAN 1, which is the default VLAN.  Our external NTP Servers are:

0.vmware.pool.ntp.org – 31.170.110.148
1.vmware.pool.ntp.org – 46.227.200.71

Select you time zone and click apply, once done you should see Clock Status: synchronized.

Moving down the list we are going to change the password for the admin user, select Device from the left hand column then Users then Modify.  Select admin tick Password Modify and then enter your new password

The last thing we are going to do is set a static IP address for the switch, we wouldn’t want to leave it on DHCP would we? To do this select Network from the left menu, then VLAN Interface, then Modify.  Select Manual and enter the static IP address.

This may sound crazy, but before you click apply, write down the last octet of the static IP.  You wouldn’t believe the amount of times I do this and the moment I click save/apply I get a phone call, colleague asking for help and I forget the damn thing.

Click apply and reconnect to the switch on the new IP address and with the password the admin user we applied earlier.

In the next ‘how to’ we are going to configure some VLAN’s.