It is very helpful to know about Switch configuration. Here we mainly explain the statements and steps for Cisco switch configuration. Last time, I introduced how to correctly connect to the vswitch. Today I will use some configuration snippets to introduce the port configuration. Because most of the configuration examples on the Internet are the results of show-run. This is not conducive to the novice's understanding of the command configuration process. Therefore, I have noted the Cisco switch configuration snippets and notes, hoping to help the novice understand how to correctly configure the switch as soon as possible.
When you enter a command in IOS, the abbreviation is not confusing as long as the abbreviation is used. You can use the abbreviation when using the Cisco switch configuration command. For example, Switch> enable: in user mode, only enable is available for commands starting with en. Therefore, Switch> en can be abbreviated as Switch> enable. You can also use the TAB key to automatically complete the command, such as Switch> en. Press the TAB on the keyboard to automatically complete Switch> enable.
Shortcut Key:
1. Ctrl + A: move the cursor quickly to the beginning of the line
2. Ctrl + E: move the cursor quickly to the end of the entire row.
3. Esc + B: 1 word backward
4. Ctrl + B: the return value is 1 Character
5. Esc + F: 1 word forward
6. Ctrl + F: 1 character forward
7. Ctrl + D: delete a single 1 Character
8. Backspace: delete a single 1 Character
9. Ctrl + R: Re-display 1 line
10. Ctrl + U: erase 1 whole line
11. Ctrl + W: delete 1 word
12. Ctrl + Z exit from global mode to privileged Mode
13. Uparrow or Ctrl + P: displays the last command that has been input.
14. Downarrow or Ctrl + N: display the enable password and Host Name of the command you just entered.
Switch.>/* User direct mode prompt
Switch.> enable/* enter privileged Mode
Switch. #/* privileged mode prompt
Switch. # configterminal/* enter the Configuration Mode
Switch. (config) #/* configuration mode prompt
Switch. (config) # hostnamePconline/* set the host name Pconline
Pconline (config) # enablepasswordpconline/* set the Enable password to pconline
Pconline (config) # enablesecretnetwork/* Set enable password to network
Pconline (config) # linevty015/* set the virtual terminal line
Pconline (config-line) # login/* Set login verification
Pconline (config-line) # passwordskill/* set the virtual terminal Login Password
Note: by default, if you do not set the virtual terminal password, you cannot telnet from the remote end. The system will prompt you to set the login password during remote telnet. Many new users will think that nologin cannot log on from the remote end. In fact, nologin means that you can telnet from the remote end to the switch without verifying the password. It is dangerous for anyone to telnet to the switch, note that the Cisco switch configures IP addresses, default gateways, domain names, and domain name servers:
It should be noted that the IP address, gateway, domain name, and other information set on the vswitch is used to manage the vswitch, and has nothing to do with the network devices connected to the vswitch, that is to say, even if you do not configure IP information, you can still work by inserting the network cable into the port.
Pconline (config) # ipaddress192.169.1.1255.20.255.0/* set the vswitch IP Address/
Pconline (config) # ipdefault-gateway192.169.1.254/* set the Default Gateway
Pconline (config) # ipdomain-namepconline.com/#set Domain Name
Pconline (config) # ipname-server200.0.0.1 /*
Set the Domain Name Server to configure the switch port properties: the default port of the switch is set to automatically detect the port speed and duplex status, that is, Auto-speed, Auto-duplex, generally, you do not need to set each port. However, according to the Cisco technical whitepaper, we recommend that you directly configure the speed and duplex information for the Cisco switch when the network device of the access port is changed.
The speed command can be set to 10,100 or auto, representing 10 Mb/s, 100 Mb/s, and automatic negotiation speed. The duplex command can also be set to full, half, or auto, representing the full, half, and automatic negotiation duplex statuses, respectively. The description command is used to describe a specific port name. We recommend that you describe a special port. Assume that the current speed of the device connecting to port 1 is 100 Mb/s, And the duplex status is full duplex:
Pconline (config) # interfacefastethernet0/1/* enter the configuration mode of interface 0/1
Pconline (config-if) # speed100/* set the port speed to 100 Mb/s
Pconline (config-if) # duplexfull/* set this port to full duplex
Pconline (config-if) # descriptionup_to_mis/* set the port description to up_to_mis
Pconline (config-if) # end/* return to privileged Mode
Pconline # showinterfacefastethernet0/1/* query the configuration result of port 0/1
Configure the vswitch port mode:
The port operating mode of a vswitch can be divided into three types: Access, Multi, and Trunk. The trunk-mode port is used for switches and vswitches, vswitches and vrouters. Most of the ports are used for Cascade network devices. Therefore, they are also called trunk mode. Access is mostly used in Access layer, also called Access mode. For the time being, we will first introduce the Trunk mode, the Access mode, and the Multi mode. We will introduce the VLAN settings later.
Interfacerange can be used to configure a set of ports in a unified manner. If the port is known to be directly connected to the PC and will not be connected to the route switch and hub, you can use the spanning-treeportfast command to set the fast port, the fast port no longer goes through the four statuses of the Spanning Tree and directly enters the forwarding status, improving the access speed. Pconline1 (config) # interfacerangefastethernet0/1-20/* Configure port 1-20; Pconline1 (config-if-range) # switchportmodeaccess/* set the port to access mode; pconline1 (config-if-range) # spanning-treeportfast/* Set Port 1-20 as the fast port.
The switch can work in Trunk mode through automatic negotiation, but as required, if the port is a main road, it should be clearly indicated that the port belongs to the Trunk mode: Pconline1 (config) # interfacefastethernet0/24/* Configure port 24. The Pconline1 (config-if) # switchportmodetrunk/* port is in the trunk mode.
Today, we will introduce some basic Cisco switch configurations and precautions for ports. VLAN configuration in the intermediate part of the vswitch will be widely used in the future. Although it is a few simple commands, if you want to reach the professional level, you must be able to reach the skillful use stage.