First of all thanks for taking the time to read my tutorial on how to configure a Router on a Stick.

How Can I Get Two Separate VLANs On Layer 2 Switch To Communicate?



Let's take a step back and look at this from the switch's point of view. When a new device is connected to a layer 2 switch and sends out a frame, the switch receives that frame and dissects it. The switch then looks inside that frame for the source and destination devices MAC Address. When the switch finds the senders MAC Address the switch then compares it MAC Address Table to see if it has that device stored within its table

If the switch does not have that device it then adds it to its Mac Address Table with a corresponding port number.

The switch then looks at its Mac Address Table for the destination Mac address within its table.

If the switch finds the Mac address of the destination device it then forwards that frame out of the corresponding port

But what happens if the switch does not have the destination MAC address within its table? The switch then floods an Address Resolution Protocol or APR request out each port except the port that the frame comes in on and waits for a reply. For example the ARP may say "Who is MAC 0000.1111.2222.3333?" and that device would respond by saying "I am here". The switch would then note that MAC address and port number within its Mac Address table allowing it to quickly forward frame to devices on the same subnet.

Single VLAN



Ok so what happens if i add another VLAN to the switch? If another vlan is added to the switch then a layer 3 device must be attached. This layer 3 device is normally a router or a switch capable of routing.

In the diagram below the switch is connected to a layer 3 device, in this case a router by a "trunk" link.

A trunk link carries separate VLAN traffic to a layer 3 capable device. To identify the VLAN that the frame belongs to the switch uses different techniques such as Inter link Switching (ISL) or 802.1Q

Trunk Link

Now in order to allow different subnets to communicate a router or layer 3 device must be configured with the ip address of each gate way.

So how do you configure 1 interface with two ip address that carry separate vlan traffic?


This is done by using the sub interfaces.

Below is a screen print of how to configure two sub interfaces.

Sub Interface
Art and Design by Matthew James Taylor

No CSS hacks

The CSS used for this layout is 100% valid and hack free. To overcome Internet Explorer's broken box model, no horizontal padding or margins are used. Instead, this design uses percentage widths and clever relative positioning.

SEO friendly 2-1 column ordering

The higher up content is in your page code, the more important it is considered by search engine algorithms (see my article on link source ordering for more details on how this affects links). To make your website as optimised as possible your main page content must come before the side columns. This layout does exactly that: The the right-hand main page comes first, then the left column (see the nested div structure diagram for more info). The columns can also be configured in the opposite order if required.

Full length column background colours

In this layout the background colours of each column will always stretch to the length of the longest column. This feature was traditionally only available with table based layouts but now with a little CSS trickery we can do exactly the same with divs. Say goodbye to annoying short columns! You can read my article on equal height columns if you want to see how this is done.

No Images

This layout requires no images. Many CSS website designs need images to colour in the column backgrounds but that is not necessary with this design. Why waste bandwidth and precious HTTP requests when you can do everything in pure CSS and XHTML?

No JavaScript

JavaScript is not required. Some website layouts rely on JavaScript hacks to resize divs and force elements into place but you won't see any of that nonsense here.

Resizable text compatible

This layout is fully compatible with resizable text. Resizable text is important for web accessibility. People who are vision impaired can make the text larger so it's easier for them to read. It is becoming increasingly more important to make your website resizable text compatible because people are expecting higher levels of web accessibility. Apple have made resizing the text on a website simple with the pinch gesture on their multi-touch trackpad. So far this trackpad is only available on the MacBook Air but it will soon be rolled out to all of their systems. Is your website text-resizing compatible?

No Quirks Mode

This liquid layout does not require the XML declaration for it to display correctly in older versions of Internet Explorer. This version works without it and is thus never in quirks mode.

No IE Conditional Comments

Only one stylesheet is used with this layout This means that IE conditional comments are not needed to set extra CSS rules for older versions of Internet Explorer.

Browser Compatibility

This left menu liquid Layout has been tested on the following browsers:

iPhone & iPod Touch

  • Safari

Mac

  • Safari
  • Firefox
  • Opera 9.25
  • Netscape 9.0.0.5 & 7.1

Windows

  • Firefox 1.5, 2 & 3
  • Safari
  • Opera 8.1 & 9
  • Google Chrome
  • Explorer 5.5, 6 & 7
  • Netscape 8

Valid XHTML strict markup

The HTML in this layout validates as XHTML 1.0 strict.

This layout is FREE for anyone to use

That's right, you don't have to pay anything. If you are feeling generous however, link back to my demo page so other people can find and use this layout too.

Download this layout (20kb zip file).

Centered menus compatible

This layout is fully compatible with my cross-browser compatible centered menus.

This page uses the Perfect 'Left Menu' 2 Column Liquid Layout by Matthew James Taylor. View more website layouts and web design articles.