Cisco switch: network configuration and implementation

Source: Internet
Author: User
Tags cisco switch

Cisco switch network configuration: Gateway redundancy server load balancing

Virtual Router Redundancy protocol (vrouter Redundancy protocal, VRRP): Redundancy can be used on various devices.

Hot Backup Router Protocol HSRP): cisco proprietary Redundancy

Gateway Load Balancing protocol GLBP): The cisco dedicated redundancy gateway can also load balancing

Cisco switch network configuration: basic configuration

 
 
  1. > En // privileged mode from Normal Mode
  2.  
  3. # Configureterminal // enter the configuration mode, which can be abbreviated as conft)
  4.  
  5. (Config) # hostnameAAA // name the vswitch. This is useful when you log on remotely.
  6.  
  7. (Config) # enablesecretBBB // set the password for the vswitch, in plaintext: enablepasswordBBB
  8.  
  9.  
  10. (Config) # interfacevlan1 (intvlan1) // enter vlan1, default vlan
  11.  
  12. (Config-if) # ipaddress192.168.0.6255.255.255.0 // configure the management ip address of the vswitch
  13.  
  14. (Config-if) # noshutdown // activate feature vlan1
  15.  
  16.  
  17. (Config-if) # ipdefault-gateway192.168.0.254 // configure the default route
  18.  
  19. (Config-if) # exit // exit the Configuration Mode
  20.  
  21.  
  22. (Config) # interfacerangefastethernet0/1-10 // set the vswitch port to which the port belongs
  23.  
  24. (Config-if-range) # switchportmodeaccess // The vswitch is in static access mode.
  25.  
  26. (Config-if-range) # switchportaccessvlan20 // allow these ports to belong to vlan20
  27.  
  28.  
  29. (Config) # Set the interfacerangefastethernet0/11-22 // 11-22 ports of the switch
  30.  
  31. (Config-if-range) # switchportmodeaccess // set the above 10 ports to be in static Access Mode
  32.  
  33. (Config-if-range) # switchportaccessvlan30 // these ports belong to VLAN30 members
  34.  
  35.  
  36. (Config) # interfacerangefastethernet0/23-24 // enter the device port to be set
  37.  
  38. (Config-if-range) # switchportmodetrunk // set this port to switch trunk mode. The two ports will run data from multiple VLANs, and these two ports will become the main port
  39.  
  40. (Config-if-range) # switchporttrunkallowedvlan1.000030 // configure the vlan for running Relay (not all are specified, but it is best to specify one by one to minimize the number of broadcast packets in the network, this helps improve the stability of complex networks)

To configure the vlan, you can use: switchport trunk allowed vlan all

(Config-if-range) # switchport trunk encapsulation dot1q // encapsulate the 802.q Protocol

Cisco switch network configuration: vlan relay protocol VTP)

Vtp allows all VLANs to be created on a vswitch, and then transmits the vlan definitions created by the vswitch to all vswitches that need to be defined in the entire network using the mutual learning function of the vswitch. The deletion and modification of VLANs by colleagues will be transmitted to other switches. Vswitches that share the same vlan definition database form a vtp management domain. Each vtp management domain has a domain name. Vtp notification information is not exchanged between vswitches in different vtp management domains.

 
 
  1. AAAconfig) # vtpdomaintest // define the vtp domain name as the test configuration statement.
  2.  
  3. AAAconfig) # vtpmodeserver // set the vswitch to a vtp SERVER
  4.  
  5. AAAconfig) # vtppruning // activates the vtp cropping function. If all ports of a vswitch belong to the same vlan, it does not need to receive user data from other VLANs, in this case, the vtp cropping function is enabled.

The preceding three commands configure a vswitch as The vtp SERVER mode, so that vlan division can be performed on this switch, because he is a vtp server, other switches will learn his vlan information by themselves. The following configuration only needs to be configured on this switch;

 
 
  1. AAA # configureterminal // enter the Configuration Mode
  2.  
  3. AAA (config) # vlan10 // define vlan10
  4.  
  5. AAA (config-vlan) # namedianda // define a name for this vlan
  6.  
  7. AAA (config-vlan) # exit // switch from vlan mode to Configuration Mode
  8.  
  9. AAA # vlandatabase // enter vlan sub-mode in global Mode
  10.  
  11. AAA (vlan) # vlan3nameBBB // create a vlan3 and name it BBB

Cisco switch network configuration: Configure routes and define ip addresses

 
 
  1. AAA (config) # iprouting // if this is an aggregation switch, it also provides the routing selection function between VLANs for the entire network. This is to enable the routing function of the layer-3 switch.
  2.  
  3. AAA (config) # interfacevlan10
  4.  
  5. AAA (config-if) # idaddress192.168.251.252.165.255.255.0 // define the IP address for vlan10
  6.  
  7. AAA (config-if) # noshutdown // activate it
  8.  
  9. AAA (config-if) # Set each vlan in the preceding three statements
  10.  
  11. AAA (config-if) # exit
  12.  
  13. AAA (config) # ifroute0.0.0.00.0.0.0gigabitethernet0/1 // The default route command indicates that the data is sent from the first port of the Gigabit Switch.

Enable and view the routing function of a layer-3 Switch

 
 
  1. #iprouting
  2.  
  3. #showiproute
  4.  
  5. 10.1.0.0/24issubnetted,2subnets
  6.  
  7. 10.1.1.0isdirectlyconnected,vlan3
  8.  
  9. 10.1.2.0isdirectlyconnected,vlan2

Cisco switch network configuration: Channel Design

To improve the throughput of main roads and achieve Redundancy Design, bind two Gigabit ports of core switch A to implement A Mbps Gigabit Ethernet channel, and then connect to another core switch, set A as follows:

 
 
  1. Aconfigure) # interfaceport-channel1 // create an Ethernet channel,
  2.  
  3. Aconfigure-if) # switchportmodetrunk
  4.  
  5. Aconfigure-if) # duplexfull
  6.  
  7. Aconfigure-if) # speed1000
  8.  
  9. Aconfigure-if) # interfacerangegigabitethernet2/1-2 // 2 ports 1-2
  10.  
  11. Aconfigure-if) # channel-group1modedisirablenon-silent // Add the current interface to the corresponding Ethernet channel and specify the Ethernet channel mode
  12.  
  13. Aconfigure-if) # noshutdown

Cisco switch network configuration: Spanning Tree STP

The priority of the production tree is 0-61440, and the increment is 4096. The smaller the priority, the higher the priority. The default value is 32768.

In global switch mode:

A # spanning-tree vlan 3 priority 4096 // change the vlan3 priority

Here 4096 can also be the following number: 28672x2 = 8192,4096*3 = 12288,4096*4 = 16384,4096*5 = 20480,4096*6 = 24576,4096*7 =

Backbonefast function of the vswitch

By default, when a vswitch is powered on, each port has to go through four stages of the Spanning Tree: blocking, listening, learning, and forwarding. Each port takes up to 50 s. Including 20 s blocking time, 15 s listening time, 15 s learning delay time)

The backbonefast function enables the blocked port to directly enter the forwarding state without waiting for the maximum survival time of a generated book for about 30 s. This improves the convergence speed of the switch.

A # spanning-tree backbonefase

Cisco switch network configuration: VRRP is configured on a layer-3 switch.

 
 
  1. VRRPVirtualRouterRedundancyprotocal) vrovirtualredundancy protocol is designed for LAN with multicast or broadcast capabilities.
  2.  
  3. A # conft
  4.  
  5. Aconfig) # track100interfaceGigabitethernet1/1/1line-protocal // define a tracking target number 100, and the tracked object is GE1/1/1.
  6.  
  7. Aconfig) # interfacevlan3 // enter vlan3 virtual sub-Port
  8.  
  9. Aconfig-if) # vrrp1ip10.1.1.253 // enable vrrp and set the virtual IP Address
  10.  
  11. Aconfig-if) # vrrp1priority120 // set the VRRP priority of the layer-3 Switch
  12.  
  13. Aconfig-if) # vrrp1preempt // configure Vrrp Preemption
  14.  
  15. Aconfig-if) # vrrp1track100decrement30: track the target by 100. When the target fails, the priority is reduced by 30)
  16.  
  17. Aconfig-if) # configure vrrp Authentication Mode for MD5 vrrp1authenticationMD5key-stringabc123, authentication password for abc123)

The cisco switch network configuration problems have been introduced to you. I hope you can understand them, especially for enterprise users, and pay more attention to network configuration and implementation issues.

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.