Pages

Jul 21, 2010

Configure vlan on catalyst 2960G switch


Displaying VLAN List.

Below is an example to display list of vlan and its associated port(s):

User Access Verification

Username: admin
Password:

SW03>enable
Password:
SW03#show vlan brief

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/22
2 DMZ active Gi0/15
3 Proxy active
4 Secured active Gi0/9
5 Calr active
6 Proc active
7 Test active
8 Center active
9 Apps
10 Users active
11 Backup active
12 VLAN0012 active
13 VLAN0013 active Gi0/7, Gi0/8, Gi0/10, Gi0/11
Gi0/12, Gi0/13, Gi0/14, Gi0/16
Gi0/17, Gi0/18
14 ipphone active
15 team active
100 TM_IPVPN active
110 TM active
999 Management active Gi0/1, Gi0/2, Gi0/3, Gi0/4
--More--
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
Gi0/5, Gi0/6, Gi0/19, Gi0/20
Gi0/21
1002 fddi-default act/unsup
1003 trcrf-default act/unsup
1004 fddinet-default act/unsup
1005 trbrf-default act/unsup

Creating VLAN.

In order to create vlan, first note the the number of existing vlan. Vlan numbering must be unique. Example below describe the steps of creating a vlan 10 named security.

Switch>enable
Switch#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name security
Switch(config-vlan)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

Use show running-config command to verify that the vlan is successfully created.
Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will performed the operation and display OK, before returning to the prompt.

Associating port with VLAN.

To add port to vlan, there are two ways to do it. First, adding port one by one and second by adding using port range. The first method is useful to add a single port or to add ports that are not adjacent to each other (range cannot be used). The second one is for adding ports that are sequentially numbered eg: port 20 to 35. The example procedure for both methods are listed below. These procedure can also be used to reallocate port(s) between vlan.
a) Adding a single port

Switch#conf term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fa0/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION

%Portfast has been configured on FastEthernet0/1 but will only
have effect when the interface is in a non-trunking mode.
Switch(config-if)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

b) Adding a range of port

Switch#conf term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface range fa0/20 – fa0/35
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION

%Portfast has been configured on FastEthernet0/1 but will only
have effect when the interface is in a non-trunking mode.
Switch(config-if-range)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will perform the operation and display OK, before returning to the prompt.

Unassociate port(s) from vlan.

You need to unassociate port(s) from vlan before deleting the vlan. To do this, below are the examples.
a)Unassociate a port

Switch#config term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fa0/1
Switch(config-if)#no switchport access vlan 10
Switch(config-if)#no spanning-tree portfast
Switch(config-if)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

b) Unassociate a range of port

Switch#config term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface range fa0/20 – fa0/35
Switch(config-if-range)#no switchport access vlan 10
Switch(config-if-range)#no spanning-tree portfast
Switch(config-if-range)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

When you unassociate a port from its vlan, it will return back to its original vlan which is vlan 1. Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will performed the operation and display OK, before returning to the prompt.

Deleting a vlan.

procedure listed below is example to delete a vlan.

Switch#config term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#no vlan 10
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console
Switch#exit
Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will performed the operation and display OK, before returning to the prompt.

4 comments:

  1. I know this is just over a year old, but I hope someone is still looking here. The info above was very helpful for resolving a network drive mapping issue under a Cisco 2960G 48p GB switch.

    As I enabled fastport on a small range of ports (by the way, the means to select a range is different for the 2960g, the command being:

    interface range GigabitEthernet0/1-16
    )

    I got this warning from the switch:

    %Warning: portfast should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc... to this interface when portfast is enabled, can cause temporary bridging loops. Use with CAUTION

    %Portfast will be configured in 16 interfaces due to the range command but will only have effect when the interfaces are in a non-trunking mode.

    My question then - some ports for us have a VOIP phone set plugged in, and then from there a PC is plugged into the phone set. Am I right in thinking that I can't enable portfast on those ports because a VOIP phone is "Bridging" the connection to the PC? Or is that the wrong term, and portfast is ok for those ports as well?

    ReplyDelete
  2. How to access vlan 2 from the default vlan? I am on Cisco 2960G.

    ReplyDelete
  3. Those with water proof to 100m are suitable for virtually any
    activities underwater like swimming or diving. This must be available to you
    from the seller and will include the matching serial number,
    and also the original warranty. Soon after, Heuer was recognized with another patent to get a revolutionary new chronographic
    movement, and so the story began.

    Have a look at my webpage http://im.indli.com/

    ReplyDelete
  4. Thank you this was exremely helpful today

    ReplyDelete

Related Posts with Thumbnails