Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Commands

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Commands

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Setting the BOOT variable:

S1 (config) #boot system flash: (storage) path.

Recover from a system crash:


Switch: set (to view the path of the switch BOOT environment variable)
Switch: flash_init (to view the current files in the flash)
Switch: dir flash: (to view the current directories in the flash)
Switch: BOOT = flash: (to change the BOOT environment variable path the switch uses
to load the new IOS in flash)
Switch: set (To verify the change of path)
Switch: boot (to boot the new IOS we should be prompted by switch>)

Configuring an SVI:
To do so we must have the management VLAN already created
Switch (config) #interface vlan [vlan ID]
Switch (config-if) # ip address [ip SMK]
Switch (config-if) # ipv6 address [ipv6/prefix]
Switch (config-if) #no shutdown
We also need to configure a default gateway for the switch to be reached from a
remote network:
Switch (config) #ip default-gateway [ip]

Configure an interface with duplex and speed settings:


Switch (config-if) #duplex [half/full/auto]
Switch (config-if) #speed [10/100/1000/auto]

Enabling Auto-MDIX on an interface:


Switch (config-if) #mdix auto (Note that to do so speed and duplex settings must be set
to auto)

Configure SSH:
S1#show ip ssh (if unrecognized command means switch does not support ssh)
S1 (config) # ip domain-name [text]
S1 (config) #ip ssh version 2 (enables ssh version 2 on switch)
S1 (config) #crypto key generate rsa (generates an RSA key, when we do so the admin
will be prompted by a modulus length)
S1 (config) #line vty 0 15
S1 (config-line) #transport input ssh (restricts access to only ssh)
S1 (config-line) #password [password]
S1 (config-line) #login local (enable lines)
Note: We can issue the S1# show ip ssh command to verify the version and if the ssh is
enabled.

Configure router interfaces:


R1 (config) #interface [interface id]
R1 (config-if) #ip address [ip SMK]
R1 (config-if) #ipv6 address [ipv6/prefix]
R1 (config-if) #description [text]
R1 (config-if) # no shutdown
R1 (config-if) # exit

Enabling a loopback interface:


R1 (config) #interface loopback [number]
R1 (config-if) #ip address [ip SMK]

VLAN creation commands:


Switch (config) #vlan [vlan id]
Switch (config-vlan) #name [vlan name]
Switch (config-vlan) #end

VLAN Port ACCESS assignment commands:


Switch (config) #interface [interface ID]
Switch (config-if) #switchport mode [access/trunk/dynamic auto/dynamic desirable]
Switch (config-if) #switchport mode access
Switch (config-if) #switchport access vlan [vlan id]
Switch (config-if) #end

Voice VLAN port assignment commands:


Switch (config-if) # mls qos trust [cos | device cisco-phone | dscp | ip-precedence]
Switch (config-if) #switchport voice vlan [vlan id]

To change the membership of a port back to the default:


Switch (config-if) # no switchport access vlan (for access port, now only assigned to
VLAN 1)
Switch (config-if) # no switchport trunk allowed vlan
Switch (config-if) # no switchport trunk native vlan (for trunk ports, now VLAN 1 is
native vlan and allows all vlans on the link)

Deleting a VLAN:
Switch (config) #no vlan [vlan id]
Switch# delete flash: vlan.dat (used to delete the whole vlan.dat database file)

VLAN Port TRUNK assignment commands:


Switch (config) #interface [interface ID]
Switch (config-if) #switchport mode trunk
Switch (config-if) #switchport trunk native vlan [vlan id]
Switch (config-if) #switchport trunk allowed vlan [vlan list] (separated by comma)
Switch (config-if) #end

Router sub-interface configuration:


R1 (config) #interface [interface id].[sub interface id]
R1 (config-subif) #encapsulation dot1q [vlan id] [native]
R1 (config-subif) #ip address [ip SMK] (this will be the DG address of the VLAN)
When all sub-interfaces have been created, enable the physical interface:
R1 (config) #interface [interface id]
R1 (config-if) #no shutdown

LACP Ether-channel configuration:


S1 (config) #interface range [interfaces separated by – or comma]
S1 (config-if-range) #channel-group [identifier number] mode
[active/passive/on/auto/desirable]
S1 (config-if-range) #exit
S1 (config) #interface port-channel [identifier number] (we can configure the whole
channel)
Configure a router as a DHCP server:
R1 (config) #ip dhcp excluded-address [low address] [high address]
R1 (config) #ip dhcp pool [pool name]
R1 (config) #network [network ip SMK]
R1 (config) #default-router [up to 8 ip addresses]
R1 (config) #dns-server [up to 8 ip addresses]
R1 (config) #domain-name [name]
R1 (config) #lease {days [hours (minutes) ] | infinite }

SHOW COMMANDS
The show commands are all applied in the PRIVILIGED EXEC mode.
- Show ip/ipv6 interface brief: this command displays line by line the interface, its
status (up/up), and its ip/ipv6: brief ip (normally two ipv6 and one ipv4)
information about the interface.
- Show interfaces [interface id]: displays interface status (up/up), ip information
(v6 link local and GUA and ipv4) and configuration (mtu, duplex settings, error
frames statistics…).
- Show running-config (with a parameter): displays the current configurations to
this parameter
- Show ip/ipv6 route: displays all the directly connected networks, local host route
interfaces.
- Show vlan brief: displays the vlan id, the vlan name, status and the ports
assigned to this vlan line by line each vlan.
- Show vlan id [vlan id]: Display information about the identified VLAN ID number
- Show vlan name [name]: display information about the identified VLAN name
- Show vlan summary: displays a summary about the existing vlans on the switch
(statistics)
- Show interfaces [interface id] switchport: displays if the switchport is enabled,
port mode, vlan assigned, and native vlan, and allowed vlans if it is a trunk
interface; it also shows the un-active vlans the port is assigned to.
- Show dtp interface [interface id]: displays the current dtp mode
- Show interfaces trunk: displays all the trunk interfaces, the vlans they allow, and
their status (active or not)
- Show interfaces port-channel [identifier number]: displays general status about
the port channel interface.
- Show etherchannel summary: displays line by line every etherchannel, on what
ports, its status and its protocol.
- Show interfaces [interface id] etherchannel: displays info about the interface
specified in the parameter which is in an ether-channel bundle.
- Show ip dhcp binding: displays ip to MAC mappings.
- Show ip dhcp server statistics: displays count information regarding the number
of DHCPv4 messages that have been sent and received.

You might also like