Tuesday, June 14, 2011

Configuring a switch for multiple VLANs

 Configuring a switch for multiple VLANs

The following is an example of how to configure a switch for multiple VLANs. It shows making the first 16 ports part of cluster-VLAN, the rest of the ports part of the default VLAN1, and the Gbps ports trunk.
# Connect to the Cisco switch
> telnet cisco
> enable

# Create the new VLAN
> vlan database
> vlan 2 name cluster-VLAN
> exit
# Confirm that the VLAN has been created
> show vlan brief

# Add ports to the VLAN
# Note that we also set each port with "spanning-tree portfast".
# Without this option, DHCP may fail because it takes too long
# for a port to come online after a node powers up.

> configure terminal

# The following needs to be done for each port being added to the VLAN
# For example "interface Fa0/3" for port 3.

> interface Fa0/{port number}
> switchport mode access
> switchport access vlan 2
> spanning-tree portfast
> exit

# When done, exit the configuration mode
> exit

# Verify that the ports are now part of the new VLAN
> show vlan brief

# Make the Fiber ports trunk all VLANS
> configure terminal
> interface Gi0/1
> switchport mode trunk
> switchport trunk encapsulation is1
> exit
> interface Gi0/2
> switchport mode trunk
> switchport trunk encapsulation is1
> exit
> exit

# Save the config
> copy running-config startup-config
> exit

No comments:

Post a Comment

Dear Reader, if you like My Blog content, feel free to comment on our blog posts.