commands
commands
(the default)
show startup-config
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
saves the configuration
_________________
Router(config)#write
Router(config)#write memory
===================================================================================
=================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++
router(conf)#show interface //shows all the interfaces and their error, properties
and all the available info
R1(config)#interface g0/0
R1(config-if)#no shutdown
R1(config-if)#interface g0/0.10
R1(config-subif)#encapsulation dot1q 10
R1(config-subif)#ip address 192.168.1.62 255.255.255.192
R1(config-subif)#interface g0/0.20
R1(config-subif)#encapsulation dot1q 20
R1(config-subif)#ip address 192.168.1.126 255.255.255.192
R1(config-subif)#interface g0/0.30
R1(config-subif)#encapsulation dot1q 30
R1(config-subif)#ip address 192.168.1.190 255.255.255.192
R1(config-subif)#
SVI creation // switch virtual interface, it is the default gateway for each
subnet, i/e, vlan
--------------
SW2(config)#interface vlan10
SW2(config-if)#ip address 192.168.1.62 255.255.255.192
SW2(config-if)#no shutdown
SW2(config-if)#interface vlan20
SW2(config-if)#ip address 192.168.1.126 255.255.255.192
SW2(config-if)#no shutdown
SW2(config-if)#interface vlan30
SW2(config-if)#ip address 192.168.1.190 255.255.255.192
SW2(config-if)#no shutdown
===================================================================================
=================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++
R1#show ip protocol
R1(config)##router RIP
R1(config)##router EIGRP 1 // the 1 is the autonomosy system (AS) number
R1(config)#passive-interface g0/1
R1(config)#no auto-summary
===================================================================================
=================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++
SW1(config-if-range)#channel-protocol lacp
SW1(config-if-range)#channel-group 1 mode active
SW1(config-if-range)#interface port-channel 1
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config)#interface range
SW1(config-if-range)#no switchport
SW1(config-if-range)#channel-group 2 mode on
SW1(config-if)#interface po2 // port channel 2
SW1(config-if)#ip address 10.0.0.2 255.255.255.252
SW1(config)#ip routing
SW1(config)# do show ip route
===================================================================================
=================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++
do show ip eigrp neighbors
do show ip eigrp topology
R1(config)#interface g0/0
R1(config-if)# ip ospf priority 255// <0-255> , if set to 0, the router can not be
either DR/BDR
R1# clear ip ospf process // to reset the router, it starts learning all ospf
routes again
R1# reload
R1(config-if)# ip ospf 1
R1(config-router)# shutdown // shuts down the ospf process 1
configuring HSRP //(hot standby routing protocol which is atype of first hop
redudency protocol)
R1(config)# interface g0/0
R1(config-if)# standby ? //
<0-255> // by default HSRP version 1 is used, which has small
group numbers, version 1 has 2 hexadecimal values allocated for group, i.e
(0000.0c07.acxx)
R1#show standby
R1#show interfaces g0/0 // to display information regarding the mac addresses and
others
R1(config)#ipv6 route 2001:db8:0:1::/64 g0/0
R1(config-if)#ipv6 enable // to enable IPv6 without explicitly configuring an Ipv6
address
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$ACL
R1(config)# access-list number 1 deny 1.1.1.1 // the following 3 methods are the
same, just used only for configuring ACL for a host
R1(config)# access-list number 1 deny
R1(config)# access-list number 1 deny host 1.1.1.1
===================================================================================
================================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$CDP $LLDP
R1(config)# no cdp run // to globally disable cdp (cisco descovery protocol) on the
whole network device
R1(config-if)#no cdp enable // to disable cdp in a particular interface
R1# show cdp neighbor detail // shows all the necessary details a cisco device is
connected to , ip, capability , local and neighbor interface, duplex , etc
R1# show cdp neighbor // shows interfaces, and capabilities
R1# show cdp interface // shows all the interfaces and the neighbour interface they
are connected to
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$NTP
R1#show clock
12:0:16.704 UTC Wed Dec 30 2020
R1#show clock detail
12:0:26.56 UTC Wed Dec 30 2020
Time source is user configuration
R1#show ntp associations // shows all the ntp servers configured, shows the stratum
of the ntp server that R1 is syched to
R1#show ntp status // shows the stratus of the R1
on R2
R2(config)#ntp server 10.0.0.1
what if there is no ntp server to synchronize to, what can the routers do? it is
possible to manually configure one server as the master, which will have stratum of
7 by default,
and other network devices can synchronize to it
R1(config)#ntp master
-----------------------------------------------------------------------------------
----------------------
R1 has an address of 1.1.1.1 , in this example
R2(config)#ntp authenticate
R2(config)#ntp authentication-key 3 md5 password
R2(config)#ntp trusted-key 3
R2(config)#ntp server 1.1.1.1 key 3 // specifing which key to use for each server,
in this case for server 1.1.1.1, this command is not needed on R1, the ntp server
it self (on the master, or the source)
R2(config)#ntp peer 10.0.0.2 key 3
R3(config)#ntp authenticate
R3(config)#ntp authentication-key 3 md5 password
R3(config)#ntp trusted-key 3
R3(config)#ntp server 1.1.1.1 key 3 // specifing which key to use for each server,
in this case for server 1.1.1.1, this command is not needed on the ntp server it
self (on the master, or the source)
R3(config)#ntp peer 10.0.0.2 key 3
-----------------------------------------------------------------------------------
------------
===================================================================================
==========================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$dhcp
R1#show ip dhcp binding // shows all the device clients that are currently assigned
ip address by the dhcp server
R1#show ip dhcp pool
---------------------------------------------------------------------
$dhcp_relay
------------------------------------------------------------------------
-------------------------------------------------------------------------
$dhcp_client
a router can become a dhcp client, i.e, its interfaces send dhcp descover messages,
and get ip addresses from dhcp server, this is not good option tho
R1(config)#interface g0/2
R1(conifg-if)#ip address dhcp // use the ip address assigned by dhcp
on pc
C:\Users\user> ipconfig /release
C:\Users\user> ipconfig /renew
------------------------------------------------------------------------
===================================================================================
==========================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$SNMP
===================================================================================
==============================================================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$telnet
R1(config)#line consol 0 // only one user at a time can connect and configure the
router
R1(config-line)#password ccna // configure a password
R1(config-line)#login //request the user for password when logging in via the
access consol port
to remotely telnet or ssh switches, you need to have an ip address, which can be
assigned using an svi
SW1(config)#interface vlan1
SW1(config-if)#ip address 192.168.1.253 255.255.255.0
SW1(config-if)#no shutdown
SW1(config-if)# exit
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$SSH
to enable ssh,
to connect from a pc
ssh -l username ip-address //
ssh username@ip-address
===================================================================================
===================================================================================
==============
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++
$TFTP $FTP
R1#write memory
R1#reload
R1#show version
R1#delete flash:c2900-universalk9-mz.SPA.155-3.M4a.bin
R1(config-if)#int g0/0
R1(config-if)#ip nat outside
R1(config-if)# exit
R1# clear ip nat translation * // clears the dynamic nat translation entries, not
the static entries
R1(config)#no ip nat inside source static 192.168.0.167 100.0.0.1 // the only way
to remove the static entries
R1(config-if)#int g0/0
R1(config-if)#ip nat outside // define the inside global, looking from inside the
network globally, what would the ip address be
R1(config-if)# exit
R1(config)#ip nat inside source list 1 pool POOL1 // translating from inside local
to inside global dynamically
R1(config-if)#int g0/0
R1(config-if)#ip nat outside // define the inside global, looking from inside the
network globally, what would the ip address be
R1(config-if)# exit
R1(config)#ip nat inside source list 1 pool POOL1 overload // translating from
inside local to inside global with the port number
-----------------------------------------------------------------------------------
---------------------------------------------
or without specifiying the pool one can ask the outer to use its outside interface
as the address for translation
R1(config)#ip nat inside source list 1 interface g0/1 overload // configure PAT by
mapping the acl to the interface and enabling overload
===================================================================================
===================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++
$VoIp $QoS Voice over Ip, QoS
SW1(config)# interface g0/0
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 10
SW1(config-if)#switchport voice vlan 11 // SW1 will use CDP to tell phone1 to tag
its message in vlan 11, the voice over ip message will use separate vlan from the
PC using untagged (as it is using access port) vlan 10.
SW1#show interfaces trunk // this command won't show any result in this case,
because even if 2 vlans, (vlan 10, and vlan 11) exist , the intergace g0/0 is not a
trunk port, it is an access port.
SW1#show interfaces g0/0 trunk // this command in turn will show "status : not
trunking"
----------------------------------------------
supplying power over the ethernet (PoE)
===================================================================================
=============================================================================
SW1(config)#vlan 10
SW1(config-vlan)#name Data_Vlan
SW1(config-vlan)#vlan 50
SW1(config-vlan)#name Voice_Vlan
SW1(config)#interface g0/3
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport trunk allowed vlan 1,10,50
SW1(config-if)#exit
SW1(config)# do write
R1(config)#interface g0/0.50
R1(config-subif)#encapsulation dot1q 50 // the 50 is the vlan number
R1(config)#do write //
R1(config)# telephony-service
R1(config-telephony)#max-dn 2 // maximum directory numbers, we have 2 here
R1(config-telephony)#max-ephones 2 // maximum phone numbers, we have 2 here
R1(config-telephony)#ip source-address 192.168.2.1 port 2000 //
R1(config-telephony)#auto assign 1 to 2
R1(config-telephony)#exit
R1(config)#ephone-dn 1
R1(config-telephony-dn)#number 2001
R1(config-telephony-dn)#exit
R1(config)#ephone-dn 2
R1(config-telephony-dn)#number 2002
R1(config-telephony-dn)#exit
R1(config)#do write
===================================================================================
===================================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++
SW1(config)#interface g0/0
SW1(config-if)#switchport port-security
command rejected: interface is a dynamic port // port-security can only be
configured on trunk and access modes, not on dynamic auto and dynamic desirable
SW1(config-if)#do show interface g0/0 switchport // shows what administrative mode
the switch is on
SW1(config-if)#switchport mode access // changes the mode of the interface in to
access
SW1(config-if)#switchport port-security // now port security is enabled on this
command with default setting,
SW1(config-if)#do show port-security interface g0/0 // to show what the setting
are, which shows the default setting now
SW1(config)#interface g0/0
SW1(config-if)#shutdown
SW1(config-if)#no shutdown
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++
$dhcp_snooping
SW1(config)#do show ip dhcp snooping binding // to show the dhcp snooping table,
which shows the devices that obtained dhcp service
===================================================================================
=========================
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++
$DAI $Dynamic_ARP_Inspectioin
------------------------------------------------------------
$ARP_ACL // when a static Ip address is configured on a host, it might not be
inserted in the dhcp snooping binding table, which the DAI uses, and hence the
legitmate request from this host will be dropped
// to resolve this problem, ARP_ACL should specify about this host ,
1)configure ISAKMP policy to establish the IKE(internet key exchange) tunnel, phase
1 of the VPN
R1(config)#crypto isakmp enable
3)create accesslist
R1(config)#access-list 100 permit ip 172.16.1.0 0.0.0.255 192.168.10.0
0.0.0.255
4) create crypto map for the IPsec
R1(config)#crypto map mymap 20 ipsec-isakmp
R1(config-crypto-map)# set peer 11.11.11.1
R1(config-crypto-map)#set transform-set myset
R1(config-crypto-map)#match address 100
R1(config-crypto-map)#exit
5)Apply the crypto map to the outgoing itnerface of the VPN device
R1(config)#interface s0/0/0
R1(config)# crypto map mymap
===================================================================================
=========================================
virtualoization port channel
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++
$VRF //virtual routing and forwarding
SPR1# show ip route // wont display information about the vrfs, it will just
display routes recorded in the global configuration mode
SPR1# show ip route vrf customer1
SPR1# ping 192.168.1.1 // the result wont work, as the ping is looking in the
global configuration not in the vrf
SPR1# ping vrf customer1 192.168.1.1 // will work
===================================================================================
=========================================