Basic commands Cisco switch configuration

1. Different vlan

Different routes need vlan
port disposed in a plurality of IP routing segment

2. Check port name

VLAN # SH SWA
   default the Active F0 /. 1, F0 / 2, F0 /. 3, F0 /. 4, F0 /. 5, F0 /. 6, F0 /. 7, F0 /. 8
F is the port Hinako
    default Active Gi / 1, Gi0 / 2, Gi0 /. 3, Gi0 /. 4, Gi0 /. 5, Gi0 /. 6, Gi0 /. 7, Gi0 /. 8
Gi of a port name is

3. Create dynamic aggregation

Switch(config)#interface range g0/21-22
Switch(config-if-range)#channel-group 1 mode active
Switch(config-if-range)#exit

4. Create a link type

There are three types of link Ethernet port: Access, Hybrid, Trunk. Access types can belong to a VLAN ports, ports for connecting PCs; Trunk port can belong to more than one VLAN, can receive and transmit packets of a plurality of VLAN, ports between switches generally used; Hybrid type of port can belong to more than one VLAN, can receive and transmit packets of a plurality of VLAN, the switch can be used to connect and to be connected to a computer user. Trunk Hybrid ports and ports that is different from the Hybrid port allows the packets of the plurality of VLAN transmitted without tags, and Trunk port only allows packets from the default VLAN is transmitted without tags.

Table 1-9 link type of the Ethernet port

Operation
 Command
 
Set the port Access Port
Switch (config) #interface Range G0 / 21-22
Switch (config) #switchport MODE Access
 
is provided as a Hybrid port
Switch (config) #interface Range G0 / 21-22
Switch (config) #switchport mode hybrid
 
set as Trunk port port
Switch (config) #interface Range G0 / 21-22
Switch (config) #switchport MODE Trunk
 
link type recovery port is the default port Access
 undo port link-type
 
three types of ports can co-exist on the same switch, but between Trunk and Hybrid ports can not be directly switched, only Access port, then to another type port. For example: Trunk port has to be set to the Hybrid port, you need to use Access port, then a Hybrid port.

By default, the port is Access port.

Note that: Access port to a VLAN must already exist and can not be the default VLAN; Hybrid port to the VLAN must already exist; Trunk port to a VLAN can not be the default VLAN.

Implementation of this configuration, the Ethernet port can forward packets of the specified VLAN. Hybrid and Trunk port can be added to more than one VLAN in order to achieve the same VLAN and VLAN communicate on the end of the switch on the switch. Hybrid port VLAN packets which can also be set to tag, which without tags, provide a foundation for the implementation of the different processing flow for different VLAN packets

The display command switch  

Cisco restart

All orders are Cisco restart reload

Switch display command:

switch # write; save the configuration
switch # show vtp; see vtp configuration
switch # show run; view the current configuration
switch # show vlan; view vlan configuration
switch # show interface; check the interface
switch # show int f0 / 0; See port information to
switch # show cdp nei; view corresponding to port information of the port upstream device and connected to the
switch # show ip int bir view port VLAN IP opened state overview
switch # show int status view port status overview of
switch # show inventory view of the optical module significant channel
switch # sh int etherchannel sum for "port aggregation / link bundling
switch # sh int port-channel for" port aggregation / link bundling
switch # show spanning-tree spanning tree view
switch # show access-list status See rule
switch #show history View history enter the command
switch # show errdisable recovery will see what protection can be automatically restored after a timeout
switch # show errdisable detect View err-disabled state reasons

 

6. Configure the vlan IP
S (config) #int vlan. 6
S (config-vlan) #no Shu
S (config-vlan) #ip the Add 10.2.20.1 255.255.255.254
SWA # WR
 7. The configuration of the switch and the IP gateway

 Gateway switch configuration: Switch (config) #ip default-gateway gateway

switch (config) #int vlan 1
    disposed ip address and mask:
switch (config-IF) #ip address 10.65.1.3 255.255.0.0
    disposed gateway switch:
switch (config) #ip defaule-Gateway 10.65.1.9
    view the current configuration :
Switch # SH RUN

8. Clear all Cisco Configuration

SWA#del vlan.dat
SWA#reload

9. Delete Dynamic Link

Switch(config)#interface range g0/21-22
Switch(config-if-range)#no channel-group 1
Switch(config-if-range)#exit

10. Set vtp

switch (config) #vtp domain; hair setting vtp domain
switch (config) #vtp password; vtp password provided hair
switch (config) #vtp mode server; vtp hair setting mode
switch (config) #vtp mode client; hair setting mode vtp

  11. Set the Cisco switches and IP subnet mask

switch # conf t
    enter default VLAN state:
switch (config). 1 #int VLAN
    setting ip address and mask:
switch (config-IF) #ip address 10.65.1.3 255.255.0.0
    disposed gateway switch:
switch (config) #ip defaule-gateway 10.65.1.9
    view the current configuration:
Switch # SH RUN
SWA the Write #

  12. Cisco telnet login method

Start --cmd --- telnet

13. Cisco preservation methods

In global configuration mode
Router # copy running-config startup- config // save the current configuration
or
Router # write
will do

14. Cisco View vlan

SWA # sh vlan

15. Cisco view the current configuration

   View the current configuration:
Switch # SH RUN

      16. Cisco restore factory settings

  Switch#erase startup-config

  Switch#reload

There are prompted to save the configuration you select no 

    17. Cisco will join the port vlan

SWA (config) #int f0 / 5 (f is the port number sh vlan can see the port number, the port number is not the same as we are Gi)
SWA (config-IF) #switchport Access vlan 2
SWA (config-IF) # F0 int /. 6
SWA (config-IF) #switchport Access VLAN 2
SWA (config-IF) #int F0 /. 7
SWA (config-IF) #switchport Access VLAN 2
SWA (config-IF) # End
SWA # SH VLAN
SWA #wr (save)

    18. Cisco and computer connection

First, the software can not connect to the real device:
select a PC, a device (switch, router line)
connection and PC equipment, cable select blue cable, English should be a console --- meaning the console. Connection, select the RS232 interface on the PC, select CONSOLE interface on the device
Once connected, double-click the PC icon, a window opens, click on the desktop (desktop), and then select the terminal (terminal), click OK, on it!

    19. Cisco entered

Switch>enable
Switch#

20. Cisco mode

Oh finally found a question about the cisco up.

Hello friends, I use my own language Ha, ha a little long, but it will help you learn to Kazakhstan. Cisco router user interface are the following:
1. The user performs mode (the User EXEC Mode)
2. privileged execution mode (the Privileged EXEC Mode)
3. Global Mode (Free Join the Configuration Mode)
4. monitor mode (ROM Monitor Mode) An BREAK + Ctrl
5. the installation mode (setup mode) to enter privileged mode line setup
6.Boot mode (RXBoot mode)

1, 2 and 3 are used. Here I will formally answer you asked.

Router a boot, go in the interface prompt is ">", like this child Ha, "Router>" This is the user EXEC mode, also the lowest level mode allows only a limited number of basic monitoring commands in this mode command will not allow any change in the router configuration.

What should we do Zenong To configure the router, then you have to come into the "privileged execution mode" of (that is, enter "enable" command in user EXEC mode). It appears like the prompt "#", such as "Router #". Compared user EXEC mode, which offers more commands and privileges, such as debug commands, and more detailed testing.

As for the "Global Mode", it is the configuration (global) system and a corresponding configuration details (such as IP interfaces, the routing protocol) when the incoming interface, the stuff in this configuration is the overall impact. Global Configuration Mode prompt like this "(config) #", for example, I cite here the example in respect of a "Router (config) #".

And to configure specific stuff must enter from the global configuration mode corresponding to the sub-configuration mode. For example:
Router (config-IF) // # specific interface configuration
Router (config-line) # // line mode configuration, such as the console and vty Ha
Router (config-router) # // router mode, such as a routing protocol Time

Baidu does not know replies not powerful enough, or I can re-mark and more beautiful typography, so that friends more easily understood.

A brief summary of your next question is, privileged execution mode is primarily used for debugging global configuration mode is used to configure. And their relationship, to reach global configuration mode, you have to come at the privileged EXEC mode Kazakhstan.


While the corresponding command Kazakhstan see below:

Router>
Router> enable // execution mode from the user to enter the privileged EXEC mode
Password: // If you set a password privileged EXEC mode, then have to enter a password when entering Kazakhstan
Router #
Router # // Exit from the privileged EXEC mode return to the user EXEC mode
Router>

// Here I demonstrate how to get global configuration mode from user mode to perform a step by step Ha:
Router> enable
Router #
Router # the configure Terminal
Router (config) #

 

  21. Cisco Configuration vlan and save

SWA#vlan database
SWA(vlan)#vlan 2
SWA(vlan)#vlan 3
SWA(vlan)#exit
SWA#write

 22. Cisco Configuration Telnet

111 (config) # line vty 0 4 to enter the virtual thread configuration mode, in this mode can to
configure telnet function
111 (config-Line) # the Login
111 (config-Line) # password XXX configure the telnet password, the default network equipment telnet function is
turned off automatically after opening the password with
a password 111 (config) # enable password XXX enable entering the configuration mode, a case-sensitive
111 (config) # enable secret XXX enable entering the configuration mode code is encrypted password, Show
RUN is invisible
111 (config) Line # 0 Console
111 (config-Line) Login #
111 (config-Line) # password XXX user enters user mode code
111 (config-line) # logging synchronous sync input
111 (config-line) # exec -timeout 0 0 ban for some time because there is no input jump
111 # SWA # write to save the configuration
                               23. Cisco batch landing

off  
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs  
echo WScript.Sleep 300 >>telnet_tmp.vbs  
echo sh.SendKeys "open 你的网络设备telnet登录IP" >>telnet_tmp.vbs  
echo WScript.Sleep 300 >>telnet_tmp.vbs  
echo sh.SendKeys "{ENTER}" >>telnet_tmp.vbs  
echo WScript.Sleep 300 >>telnet_tmp.vbs  
echo sh.SendKeys "你的用户名{ENTER}">>telnet_tmp.vbs  
echo WScript.Sleep 300 >>telnet_tmp.vbs  
echo sh.SendKeys "你的密码{ENTER}">>telnet_tmp.vbs  
echo WScript.Sleep 300 >>telnet_tmp.vbs  
echo sh.SendKeys "conf{ENTER}">>telnet_tmp.vbs  
start telnet  
cscript //nologo telnet_tmp.VBS                                  24. The Cisco delete vlan
del telnet_tmp.vbs 

jjf {cinfig} #no vlan 10 deleted vlan10
JJF {} #end cinfig return to privileged mode
jjf {cinfig} sh vlan view vlan  
SWA the Write #

                              25. Cisco set trunk mains

Provided trunk mains
    connecting port into two trunk switches.
SWA (config) #int F0 /. 8
SWA (config-IF) #switchport MODE trunk
SWA (config-IF) #switchport allowed VLAN trunk l, 2,3 (only allowed on this trunk link in a vlan 1 2 3 go, this is the vlan trim.)
SWA (config-IF) #switchport Trunk encap dot1q (can not be dot1q vlan trunking protocol (802.1q) switches are generally comes)
SWA (config-IF) #end
SWA # sh run

SWB(config)#int f0/1
SWB(config-if)#switchport mode trunk
SWB(config-if)#switchport trunk allowed vlan 1,2,3
SWB(config-if)#switchport trunk encap dot1q
SWB(config-if)#end
SWB#sh run
26.思科型号

Cisco Catalyst 2960G-24TC-L 24 10/100/1000 Ethernet ports, including four ports for the dual

                                  26. Cisco remote login pingIP address (do batch)

off
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "open 登陆交换机IP地址" >>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "{ENTER}" >>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "用户名{ENTER}">>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "登录密码{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "ping 192.168.0.2{ENTER}" >>telnet_tmp.vbs
start telnet
cscript //nologo telnet_tmp.vbs
echo del telnet_tmp.vbs
                               27.Cisco remote switch landing configuration

 1. Enter vlan 1 interface mode
Switch (config) #interface vlan 1
2. Open port vlan 1
Switch (config-IF) #no the shutdown
3. Configure vlan IP address of a
switch (config-if) #ip address 172.16.10.99 255.255.255.0
three, the Telnet switch arranged
  1. set privileged mode password global configuration mode
switch (config) #enable password Cisco
2. set the virtual terminal (virtual terminal) in the global mode line number
switch (config) # VTY 0. 4 line
switch (config-line) #
3. login password provided by the user in the virtual terminal mode line configuration net (password must be set to use telnet management IP switch)
switch (config-line) #Password NET
. 4 use the login command to test whether you can telnet in line configuration mode
Switch (config-line) #login
Switch (config-line) #
If no prompt appears, indicating successful set, if prompted five elements, indicating set incorrectly.
Fourth, the use Telnet PC1 switch machine
1. PC1 is connected to FastEthernet0 / 3-port switch with a direct line.
"IP Configuration" on PC1 2. Open the "desktop", choose static configuration, set the IP address 172.16.10.100, subnet mask of 255.255.255.0.
3. Open the "Command Prompt" on PC1 "desktop."
4. At the command prompt using the telnet command remote login switch (switch management IP address 172.16.10.99)
172.16.10.99 PC> telnet
Trying 172.16.10.99 ...
the User Access Verification
Password:
After the password prompt text appears next input switch is set in front telnet login password net (not show any sign when the password is input), the user to enter the configuration mode switch.
5. Enter the password to enter privileged mode Global Mode
input enable command in the user configuration mode, then the privileged mode password input configured Cisco (not show any sign when the password is input) mode to enter global configuration subsequent network settings .
Switch> enable
Password:
 28. The Cisco restart

All orders are Cisco restart reload

                                   29. Remote Login and do batch

off
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "open 192.168.6.100" >>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "{enter}" >>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "root{ENTER}">>telnet_tmp.vbs
echo WScript.Sleep 300 >>telnet_tmp.vbs
echo sh.SendKeys "jjf1{ENTER}">>telnet_tmp.vbs

start telnet
cscript //nologo telnet_tmp.vbs
echo del telnet_tmp.vbs


Translating "enb"...domain server (255.255.255.255) 快捷键 
ctrl shift + 6        no ip domain

Guess you like

Origin www.cnblogs.com/jians/p/12155554.html