how to configure layer 3 static routes

18
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!

Upload: limpvictor17781

Post on 07-Jul-2016

251 views

Category:

Documents


0 download

DESCRIPTION

How to Configure Layer 3 Static Routes hp 1910 vlan

TRANSCRIPT

Page 1: How to Configure Layer 3 Static Routes

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!

Page 2: How to Configure Layer 3 Static Routes

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 RoutesOK, 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

Page 3: How to Configure Layer 3 Static Routes

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.

Page 4: How to Configure Layer 3 Static Routes

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 ConfigurationHopefully, 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

Page 5: How to Configure Layer 3 Static Routes

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.

Page 6: How to Configure Layer 3 Static Routes

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

Page 7: How to Configure Layer 3 Static Routes

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.

Page 8: How to Configure Layer 3 Static Routes

Assign An IP Address To Each VLANI 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.

Page 9: How to Configure Layer 3 Static Routes

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.

Page 10: How to Configure Layer 3 Static Routes

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

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

Page 11: How to Configure Layer 3 Static Routes

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

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

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

Page 12: How to Configure Layer 3 Static Routes

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.

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.

Page 13: How to Configure Layer 3 Static Routes

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 ListsThis 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.

Page 14: How to Configure Layer 3 Static Routes

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.

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

Creating An Access ListWe need to go to QoS from the left hand menu then onto ACL IPv4

Next we want to select Create

Page 15: How to Configure Layer 3 Static Routes

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’sAdvanced ACL these match source and destination IPv4 address’s and also protocols on different port numbers e.g. TCP 80Ethernet Frame Header ACL these match source and destination MAC addressesWith 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.

Page 16: How to Configure Layer 3 Static Routes

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!

Page 17: How to Configure Layer 3 Static Routes

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.255TOP 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!

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

Page 18: How to Configure Layer 3 Static Routes

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 theHP v1910G Manual page 465.

https://vmfocus.com/2012/09/26/how-to-configure-layer-3-static-routes-vlans-on-hp-v1910-24g/

https://vmfocus.com/2012/10/14/how-to-configure-access-lists-route-between-vlans-on-hp-v1910-24g/