User Tools

Site Tools


network:cisco_cmd

Cisco command line

Show commands:

cisco1-main#show interface status
...
Gi1/0/20  p5-550-aix1       connected    8          a-full a-1000 10/100/1000BaseTX
Gi1/0/21  p5-550-VIOS1-p1    connected    1          a-full a-1000 10/100/1000BaseTX
Gi1/0/22  p5-550-HMC         connected    8          a-full  a-100 10/100/1000BaseTX
Gi1/0/23  libr3584-DC1       connected    8          a-half  a-100 10/100/1000BaseTX
....
cisco1-main#show interface Gi1/0/21
GigabitEthernet1/0/21 is up, line protocol is up (connected)
  Hardware is Gigabit Ethernet, address is d48c.b509.3e95 (bia d48c.b509.3e95)
  Description: p5-550-VIOS1-p1
  MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 1000Mb/s, media type is 10/100/1000BaseTX
  input flow-control is off, output flow-control is unsupported

cisco1-main#show running-config interface Gi1/0/21
Building configuration...

Current configuration : 217 bytes
!
interface GigabitEthernet1/0/21
 description p5-550-VIOS1-p1
 switchport trunk allowed vlan 522
 switchport mode dot1q-tunnel
 switchport nonegotiate
 no cdp enable
 no cdp tlv server-location
 no cdp tlv app
end

cisco1-main#show running-config interface Gi1/0/20
Building configuration...

Current configuration : 139 bytes
!
interface GigabitEthernet1/0/20
 description p5-550-tsm
 switchport access vlan 8
 switchport mode access
 switchport nonegotiate
end

cisco1-main#show running-config interface Gi1/0/30
Building configuration...

Current configuration : 194 bytes
!
interface GigabitEthernet1/0/30
 description ESX01-p3
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 2,8,10,22,33
 switchport mode trunk
 switchport nonegotiate
end
cisco1-main#show mac address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0180.c200.0000    STATIC      CPU
 All    0180.c200.0001    STATIC      CPU
...
   1    10bd.18f5.5d31    DYNAMIC     Po1
   1    10bd.18f5.5d32    DYNAMIC     Po1
   1    82a9.7000.1002    DYNAMIC     Gi1/0/21
   1    82a9.7000.2002    DYNAMIC     Gi1/0/21
   1    82a9.7000.4002    DYNAMIC     Gi1/0/21
   3    0000.74da.a917    DYNAMIC     Po1
   3    0009.6b71.bb2e    DYNAMIC     Gi1/0/37
   
switch1-distrib1#sh vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi1/0/40, Gi1/0/45, Gi1/0/48, Gi1/0/51, Gi1/0/52, Gi2/0/18, Gi2/0/40, Gi2/0/42, Gi2/0/43, Gi2/0/44, Gi2/0/47, Gi2/0/50, Gi2/0/51, Gi2/0/52
5    management-servers               active    Gi1/0/41, Gi1/0/42, Gi1/0/43, Gi1/0/44, Gi1/0/46, Gi2/0/48
....
9    test_vlan                        active    

Change parameter using command line:

First check the parameters set to the port:

switch1-distrib1# show running-config interface Gi1/0/47
Building configuration...

Current configuration : 84 bytes
!
interface GigabitEthernet1/0/47
 description none
 switchport access vlan 1
end

Update the parameters of the port using grant access:

switch1-distrib1# conf t
switch1-distrib1(config)#interface Gi1/0/47
switch1-distrib1(config-if)#desc wifi1
switch1-distrib1(config-if)#switchport access vlan 7
switch1-distrib1(config-if)#no shut
switch1-distrib1(config-if)#end

Save your change permanently:

switch1-distrib1# copy running-config startup-config
switch1-distrib1# exit

Change parameter on an etherchannel using command line:

First check the parameters set to the port:

Configure LACP

switch#configure terminal
switch(config)#interface port-channel 1
description CHEPRE - et1/17
switchport mode trunk
switchport trunk allowed vlan 401,403
spanning-tree port type edge trunk
speed 10000
flowcontrol receive on
flowcontrol send on

Add a port to portchannel

switch# configure terminal
switch(config)# interface ethernet 1/4
switch(config-if)# switchport mode trunk
switch(config-if)# channel-group 1

Users management

Most user management commands:

To establish a username-based authentication system, use the username command in global configuration mode. Use the no form of this command to remove an established username-based authentication.

username name {nopassword | password password | password encryption-type encrypted-password}

username name password secret

username name [access-class number]

username name [autocommand command]

username name [callback-dialstring telephone-number]

username name [callback-rotary rotary-group-number]

username name [callback-line [tty] line-number [ending-line-number]]

username name dnis

username name [nocallback-verify]

username name [noescape] [nohangup]

username name [privilege level]

username name user-maxlinks number

username [lawful-intercept] name [privilege privilege-level | view view-name] password password

no username name 

http://packetpushers.net/rocking-your-show-commands-with-regex/

network/cisco_cmd.txt · Last modified: 2022/11/17 09:52 by manu