Basic configuration: cisco switch configuration vlan (1)

Source: Internet
Author: User
Tags cisco switch

Vlan configuration ideas: access, Trunk)

1) create a Vlan

Configure static VLAN on an IOS-based switch:

 
 
  1. Switch # vlan database
  2.  
  3. Switch (vlan) # vlan-num name vlan-name
  4.  
  5. Switch (vlan) # exit
  6.  
  7. Switch # configure teriminal
  8.  
  9. Switch (config) # interface module/number
  10.  
  11. Switch (config-if) # switchport mode access // set the port mode to access
  12.  
  13. Switch (config-if) # switchport access vlan-num // set the vlan to which the port belongs
  14.  
  15. Switch (config-if) # end

Verify Configuration: show vlan

2) configure the trunk Link

The trunk is a point-to-point link between two catalyst Switch ports or between the catalyst Switch and the router. Trunk links can carry multiple VLANs.

Configure trunk links on IOS-based switches

 
 
  1. Switch (config) # interface mod/port
  2.  
  3. Switch (config-if) # switchport mode trunk // you can specify trunk as the port mode.
  4.  
  5. Switch (config-if) # switchport trunk encapsulation {isl | dotlq} // you can specify the frames encapsulated by the trunk.
  6.  
  7. Switch (config-if) # switchport trunk allowed vlan remove vlan-list // allow those VLANs to pass through trunk
  8.  
  9. Appendix: switchport trunk allowed vlan {add | all | unique T | remove} vlan-list)

No switchport

No switchport // The physical port is changed to a layer-3 Port, that is, the layer-3 port is used as the port on the router. After a port is configured as a layer-3 Port, an IP address can be allocated to the port, of course, you can still connect to a PC ,. Router port: A physical port is a port generated by the no switchport command in the port configuration status. IP addresses are required for all layer-3 routing ports for Route exchange.

Configuration example:

 
 
  1. Switch# configure terminal  
  2.  
  3. Switch(config)# interface gigabitethernet0/2  
  4.  
  5. Switch(config-if)# no switchport  
  6.  
  7. Switch(config-if)# ip address 192.20.135.21 255.255.255.0  
  8.  
  9. Switch(config-if)# no shutdown  
  10.  
  11. Switch(config-if)# end 

Appendix: show interfaces [interface-id] switchport // display the status of the L2 port, which can be used to determine whether the port is a L2 or L3 port. Eg: Switch # show interfaces fastethernet 0/1 switchport

There is still a lot of content about VLAN configuration. This article is just a part of it and I hope you can master it more.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.