Commands
Commands
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 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.
Deleting a VLAN:
Switch (config) #no vlan [vlan id]
Switch# delete flash: vlan.dat (used to delete the whole vlan.dat database file)
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.