0% found this document useful (0 votes)
4 views4 pages

CISCO Switches and Routers Commands

Uploaded by

lyonylpaul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

CISCO Switches and Routers Commands

Uploaded by

lyonylpaul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

VLAN and TRUNKING COMMANDS on switch

show vlan brief Shows all vlan interfaces


Interface range g1/0-3 Configuring interfaces
switch mode access First command in making access
port in vlan
switchport access vlan10 Assigning vlan number to a
particular vlan (any number would
do between 1 to 4094)
switchport trunk encapsulation Sets the encapsulation to dot1q
dot1q (802.1q)
switchport mode trunk Assigning a certain switch port as
trunk
switchport trunk allowed vlan Allowing vlan in a certain port.
10,20,30 Note that the vlan number can be
1 to 4094. Not necessarily 10, 20
and 30 always
switchport trunk native vlan 1001 Designating vlan number for native
vlan
show interfaces trunk Displays switch ports with
corresponding trunks
Router-On-A-Stick Command
interface (router port) e.g. interface g0/0
Interface (router number with vlan e.g. interface g0/0.10
number)
encapsulation dot1q (vlan e.g encapsulation dot1q 10
number)
(Take note that the vlan number
DOES NOT HAVE to reflect the
actual vlan number in the network
BUT IT IS HIGHLY RECOMMENDED
to match it with the existing vlan
number)
encapsulation dot1q (vlan no.) e.g.: encapsulation dot1 q 10
native native

This is used to assign a certain


VLAN to be come a native VLAN
ip address (last usable address in e.g. 192.168.1.126
the subnet) (subnet mask) 255.255.255.192 (for
192.168.1.0/26 network)
no interface (interface number) e.g.: no interface g0/0.10

This used to delete a subinterface


if it was previously used as trunk
port in router
MULTILAYER SWITCH COMMANDS
default interface (terminal number) E.g. default interface g0/1
This is used to reset an interface
from its previous config (like you
used as a trunk or access port for
vlan)
ip routing This command enable layer 3
routing on the switch

interface (port number) e.g.:


no switchport interface g0/1
no switchport

This is used to configure the


interface as a routed port
ip route 0.0.0.0 0.0.0.0 (next hop) e.g. ip route 0.0.0.0 0.0.0.0
192.168.1.194

this is used to configure a Gateway


of last resort. 0.0.0.0 is the address
for the cloud the next 0.0.0.0 is the
subnet mask
show ip route This is used to show the ip route
table
show interface status This shows the interfaces with
names status, vlan
interface (vlan no.) e.g.:
ip address (given ip address) interface vlan10
(subnet mask) ip address 192.168.1.62
no shutdown 255.255.255.192
no shutdown

This is used to configure (SVI)


Switch Vlan Interfaces
Dynamic Trunking Protocol (Cisco Proprietary Protocol) Commands
switchport mode dynamic A switchport in dynamic desirable
desirable mode will actively try to form a
trunk with other Cisco switches. It
will form a trunk if connected to
another switchport in the following
modes:

switchport mode trunk


switchport mode dynamic
desirable
switchport mode dynamic auto
show interfaces switchport
Switchport dynamic auto A switchport in dynamic auto will
not actively try to form a trunk
with other CISCO switches,
however it will form a trunk if the
switch connected to it is actively
trying to form a trunk. It will form a
trunk with a switchport in the
following modes:

switchport mode trunk


switchport mode dynamic
desirable
switchport nonegotiate The commands to disable DTP in
an interface
switchport mode access

VLAN Trunking Protocol (VTP) CISCO Proprietary Commands


show vtp status
vtp domain (domain name) e.g. vtp domain cisco

This command is used to assign a


name to a certain vtp domain

DHCP Configuration of CISCO 4


ip dhcp excluded-address (range of e.g:
addresses) ip dhcp excluded-address
192.168.1.1 192.168.1.10

1st step in configuring cisco router Specify a range of addresses that


as dhcp server won’t be given to DHCP clients

ip dhcp pool (poolname) e.g:

ip dhcp pool LAB_POOL

Create a DHCP pool where we can


2nd step in configuring cisco router choose the set of subnet addresses
as dhcp server to assign to dhcp clients

network (ip address) e.g:


network 192.168.1.0 / 24
3rd step in configuring cisco router
as dhcp server Specify the subnet of addresses to
be assigned to clients
dns-server (dns server address) e.g:
dns-server 8.8.8.8
4th step in configuring cisco router
as dhcp server soecify the DNS server that DHCP
clients should use.
domain-name (domain name of the e.g.:
network)
domain-name jeremysitlab.com
5 step in configuring cisco router
th
as dhcp server

default-router (router/gateway e.g.:


address)
default-router 192.168.1.1

6th step in configuring cisco router specify the default gateway


as dhcp server

lease (least time in days hours e.g:


minutes)
lease 0 5 30
7th step in configuring cisco router
as dhcp server

show ip dhcp binding shows the ip addresses of all


clients

interface (interface of router) e.g.:

ip helper-address (ip address of the int g0/1


dhcp server)
ip helper-address 192.168.10.10

this makes a particular CISCO


Router as DHCP Relay Agent

interface (interface of router) e.g.:

ip address dhcp int g0/1

ip address dhcp

this makes a particular CISCO


Router as DHCP Agent

You might also like