How to Configure a Vlan Cisco Router

Written by thomasmckinlay
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Configure a Vlan Cisco Router
VLANs help to organise large networks. (behind network storage cables image by willem169 from Fotolia.com)

Configure a VLAN on a Cisco Router by using a subinterface. The subinterface commands allow you to specify that the interface should encapsulate frames according to the IEEE 802.1Q standard. You can also specify a VLAN number.

Skill level:
Easy

Other People Are Reading

Instructions

  1. 1

    Log on the router and enter enable mode using the standard user name and password assigned to you by your system administrator. Enter an enable password if required.

    How to Configure a Vlan Cisco Router
    Use the name and password given to you by your system administrator to log in. (woman hands typing on laptop keyboard image by .shock from Fotolia.com)
  2. 2

    Identify which physical interface will connect to the switch and which VLAN number is in use. It is possible that more than one interface will connect to VLANs. Record each interface and the VLAN numbers that will connect to it. As an example, let's assume VLAN 25 and 26 will connect to interface Fastethernet 0/0 and VLAN 78 will connect to Fastethernet 0/1.

    How to Configure a Vlan Cisco Router
    Identify which interface will have VLANs. (Patch Panel image by Phil2048 from Fotolia.com)
  3. 3

    Enter configuration mode by typing "configure terminal". The prompt will change from "Router#" to "Router(config)#".

  4. 4

    Create or edit a subinterface. Type "interface fastethernet 0/0.1". The prompt will change to "Router(config-subif)#". The "1" following a period after the interface number is the subinterface number. This command will create the subinterface if it does not exist or allow you to edit subinterface 1 if it does exist.

  5. 5

    Configure the subinterface with IEEE 802.1Q encapsulation and enter one of the VLAN numbers. Use the command "encapsulation dot1Q 25" to set this subinterface to handle VLAN 25.

  6. 6

    Enter the IP address for this VLAN. Each router virtual interface will need a unique IP address as designed in your IP address layout. For example, enter the command "ip address 192.168.1.254 255.255.255.0". Both the address and the mask should come from your IP address design.

    How to Configure a Vlan Cisco Router
    The addresses for each VLAN will come from the network design. (e-mail @ image by Witold Krasowski from Fotolia.com)
  7. 7

    Enter "exit" to return to the main configuration prompt of "Router(config)#"

  8. 8

    Configure the remaining subinterfaces on all required physical interfaces. Use the same commands but substitute the VLAN numbers and IP address from your network plan. In this example, enter "interface fastethernet 0/0.2", "encapsulation dot1Q 26", "ip address 192.168.26.254 255.255.255.0" and "exit" to configure the second VLAN. The last VLAN in our example would be entered using the command "interface fastethernet 0/1.1", "encapsulation dot1Q 76", "ip address 192.168.76.254 255.255.255.0", "exit". When all information is entered type "end" to exit configuration mode.

  9. 9

    Verify the configuration by typing "show run" at the router enable prompt of "Router#". Make sure the commands were typed in correctly and the addresses and VLAN numbers match the numbers in your plan.

  10. 10

    Save the configuration by entering the command "copy running-config start-up-config".

    How to Configure a Vlan Cisco Router
    Don't forget to save the configuration changes. (save image by dinostock from Fotolia.com)

Tips and warnings

  • The commands shown here are spelt out in long form so they may be more easily understood. A proficient Cisco operator would abbreviate the commands.
  • For example, "configure terminal" would be abbreviated to "conf t"; "interface would be abbreviated to "int"; "fastethernet" would be abbreviated to "f"; "running-config" would be abbreviated to "run" and "startup-config" would be abbreviated to "start".
  • An alternative to the command "copy run start" is "wr me", meaning "write memory."
  • Remember that the changes you make take effect immediately.
  • Be certain you are editing the subinterface.
  • Deleted subinterfaces may not actually disappear until the next reload.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.