List of basic network commands collected during my tenure as Network Engineer.
Health Check
Switch CPU, Memory, File System, Environment resources
Show version | inc software | uptime | Last
Show process CPU
show process cpu detailed
show process cpu sorted
show process cpu sorted | ex 0.00
show process cpu history
Show process memory sorted
show file systems
dir filesystem
dir crashinfo
show environment all
show environment stack
show spanning-tree summary
show spanning-tree detail
show logs
show proc cpu
show proc mem
show env all
show test
show mod
show version (uptime)
create switch hostname and enable password
Switch>enable
Switch#conf t
#hostname Test-Switch
#enable password Cisco
create VLAN
#conf t
#vlan 10
#name sales
#exit
configure interface to VLAN
To make a interface as access port mode:
----------------------------------------
config t -> go to interface
switch(Config)# interface range FastEthernet 1/1-2
switch(Config-if-range)#switchport mode access
switch(Config-if-range)#switchport access vlan 10
switch(Config-if-range)#exit
To view Vlan details:
--------------------
switch#show vlan brief
To view the trunk port:
-----------------------
switch#show int trunk
To make a port as trunk port:
------------------------------
switch(config)#int fastethernet 0/5
switch(config-if)#switchport mode trunk
switch(config-if)#switchport trunk allowed vlan 10,20
switch(config-if)#exit
configure range of interface to VLAN
#conf t
#interface range fastenthernet 0/2-10
#switchport mode access
#switchport access vlan 10
#exit
how to assign IP address to VLAN
#conf t
#interface vlan 10
#ip address 10.10.10.1 255.255.255.0
#exit
#show ip interface brief
configure inter VLAN routing
#conf t
#ip routing
inter Vlan routing or Router on Stick
-----------------------------
To communicate between two different vlan in differnt switch thru a router or layer 3 switch
Router configuration:
Router#config
Router(config)#interface fastethernet 0/0.10 (sub interface)
Router(config-subif)#encapsulation dot1q 10 (vlan id)
Router(config-subif)#ip address 10.0.0.50 255.255.255.0 (gateway ip of the vlan)
Router(config-subif)#no shutdown
Router(config-subif)#exit
Router#show ip route
DHCP server configure in switch:
#config t
#ip dhcp pool 10 (name for dhcp to understand)
#network 10.10.10.0 /24
#default-router 10.10.10.1 (same as the vlan ip)
#exit
exclude ip address from dhcp ip pool:
#ip dhcp excluded-address 10.10.10.1 10.10.10.10
**to save memory
#copy running-config startup-config
upgrade firmware
Backup/upload firmware:
#show flash
#copy flash tftp
source file?
delete firmware:
switch#delete flash://c3750-ipbase-mz.122-35.se5
Reset password for Router
reboot router and enter break to go rommon mode.
rommon 1 > confreg 0x2142
rommon 2 > reset
after booting.
Router>
Router>enable
Router#copy startup-config running-config
(copied the old configuration in running configuration)
ASRR431#conf t
ASR431(config t)#enable secret Cisco123
ASRR431(config t)#exit
ASRR431#wr
ASRR431#conf t
ASRR431(config t)#config-register 0x2102
ASRR431(config t)#exit
ASRR431#wr
Trunk link configuration between two switches (port 48)
show run interface fastenthernet 0/48
show interface trunk
#conif t
#interface fastethernet 0/48
#switchport trunk encapsulation dot1q
#switchport mode trunk
#exit
#switchport nonegotiate (for safe side)
BGP Basics and Commands
show ip bgp neighbor x.x.x.x advertise-routes
Show ip bgp
show ip bgp neignbor x.x.x.x received-routes
BGP Basics
---------
Protocol - IP
TYPE - Path vector
Transport - TCP (Port 179)
Administrative Distance - eBGP 20
Administrative Distance- iBGP 200
Metric = Attibutes (weight, local preference, next hop...etc)
Routing protocol of internet
PBR - Policy based routing, gives more control to administrator.
GRT - Global Routing table.
Range of ASN - 0 to 65535
0 and 65535 - Reserved
1-64511 - Internet Routing ISP
64512 - 65534 - Private User.
convergencies very slow
timer - hello 60 sec
Dead - 180 secs
External BGP or eBGP - BGP adjecencies between different autonomous systems.Runs between AS.
Internal BGP or iBGP - BGP adjecencies within the same autonomous system.
BGP Neighbor States
-------------------
1.Idle, 2.Connect, 3.Active 4.Opensent, 5.Openconfirm, 6.Established
BGP Message type
----------------
Open, Update, Keepalive, Notification
BGP Troubleshooting commands
----------------------------
show ip route [bgp] - to show BGP routes in routing table
clear ip bgp *[soft] - to reset a BGP connection using BGP soft
debug ip bgp [....] - to debug BGP communication packet
Rx#show ip bgp summary - tocheck neighbor status
Rx#show ip bgp neighbor <Neigbor-IP> - to verify neighbor detail information
Rx#show tcp brief - to verify TCP socket details
Rx#show process cpu - to verify BGP running process
Autonomous System:
------------------
its a collection of network/routers under a single common administrative domain(ABC organisation).
IGP, EGP (BGP)
Service providers use BGP
When exchange the route between two or more AS numbers then use protocol BGP.
Path vector
-----------
Sending route information with AS_path information.
BGP Features
-------------
Manually neighborship configuration
Loop prevention mechanism - whenever AS see its own AS number will not accept the route information.
Interfaces checking
show interfaces
show interface status
show interfaces status err-disabled
show run int Fo4/0/9
show interfaces accounting
show mac address-table
show mac address-table interface Gi1/0/1
Show module
show log
Firewall allow deny concept
A firewall is a part of a computer system or network that is designed to block unauthorized access while permitting authorized communications. It is a device or set of devices which is configured to permit or deny computer based application upon a set of rules and other criteria.
Deep Security firewall rules have both a rule action and a rule priority.
Bypass, Log Only, Force Allow, Deny, Allow
Rules are run in priority order from highest (Priority 4) to lowest (Priority 0).
A firewall policy defines how an organization's firewalls should handle inbound and outbound network traffic for specific IP addresses and address ranges, protocols, applications, and content types based on the organization's information security policies.
Types of Firewalls
------------------
Packet filtering
Proxy service
Stateful inspection
Next Generation Firewall (NGFW)
Failover Vs Failback
=====================
The failover operation is the process of switching production to a backup facility (normally your recovery site). A failback operation is the process of returning production to its original location after a disaster or a scheduled maintenance period.
Failover is a backup operational mode that automatically switches to a standby database, server or network if the primary system fails, or is shut down for servicing. Failover is an extremely important function for critical systems that require always-on accessibility.
Load Balancer
A load balancer is a device that acts as a reverse proxy and distributes network or application traffic across a number of servers. Load balancers are used to increase capacity (concurrent users) and reliability of applications. They improve the overall performance of applications by decreasing the burden on servers associated with managing and maintaining application and network sessions, as well as by performing application-specific tasks.
Load balancers are generally grouped into two categories: Layer 4 and Layer 7. Layer 4 load balancers act upon data found in network and transport layer protocols (IP, TCP, FTP, UDP). Layer 7 load balancers distribute requests based upon data found in application layer protocols such as HTTP.
Requests are received by both types of load balancers and they are distributed to a particular server based on a configured algorithm. Some industry standard algorithms are:
Round robin
Weighted round robin
Least connections
Least response time
Layer 7 load balancers can further distribute requests based on application specific data such as HTTP headers, cookies, or data within the application message itself, such as the value of a specific parameter.
Load balancers ensure reliability and availability by monitoring the "health" of applications and only sending requests to servers and applications that can respond in a timely manner.
dot1X protocol
The 802.1x standard defines a client-server-based access control and authentication protocol that prevents unauthorized clients from connecting to a LAN through publicly accessible ports unless they are properly authenticated. The authentication server authenticates each client connected to a switch port before making available any services offered by the switch or the LAN.
Until the client is authenticated, 802.1x access control allows only Extensible Authentication Protocol over LAN (EAPOL), Cisco Discovery Protocol (CDP), and Spanning Tree Protocol (STP) traffic through the port to which the client is connected. After authentication is successful, normal traffic can pass through the port.
Aruba’s ClearPass Policy Manager
CPPM:
=====
Aruba’s ClearPass Policy Manager Network Access Control (NAC) technology provides secure access for corporate, guest, BYOD, and IoT devices. Devices on networks can be secured when making wired, wireless, or VPN connections easily without compromising security.
Clearpass policy manager -Policy server
Clearpass Guest - Authentication
Clearpass Onboard - BYOD bring your own device onboard
CLearpass insight - reporting tool
Aurba which is combination of RADIUS Server, TACAC Server, Web Server, Advance policy manager server.
RADIUS Server - contains database of all the users
Onguard - for health verification of network devices.
Endpoint
Radius
Radius -Remote Access Dial-In User Service
======
To provide a centralized management system for the authentication, authorization, and accounting (AAA framework), Access Control Server (ACS) is used. For the communication between the client and the ACS server, two protocols are used namely TACACS+ and RADIUS.
RADIUS is an AAA (authentication, authorization, and accounting) protocol that manages network access. RADIUS uses two types of packets to manage the full AAA process: Access-Request, which manages authentication and authorization; and Accounting-Request, which manages accounting.
RADIUS uses UDP as Transport Layer Protocol
RADIUS uses UDP ports 1812 and 1813 / 1645 and 1646
RADIUS encrypts passwords only
RADIUS combines authentication and Authorization
RADIUS is an open protocol supported by multiple vendors
RADIUS is a light-weight protocol consuming less resources
RADIUS is limited to privilege mode
Mainly used for Network Access
TACACS
TACACS (Terminal Access Controller Access Control System)
======
TACACS+ uses TCP as Transport Layer Protocol
TACACS+ uses TCP port 49
TACACS+ encrypts the entire communication
TACACS+ treats Authentication, Authorization, and Accountability differently
TACACS+ is Cisco proprietary protocol
TACACS+ is a heavy-weight protocol consuming more resources
TACACS+ supports 15 privilege levels
Mainly used for Device Administration
ARP
Address Resolution Protocol
---------------------------
Used to resolve MAC address of device using the IP address.
for local network need MAC address instead of IP.
When try to communicate will check ARP Cache table whether the MAC is available, if so it will directly send the ICMP packet thru ping.
If the destination device MAC address not present in the ARP table it will send a ARP request, which will be broadcasted to all the device directly connected to the switch, by that the destination MAC address will be know to the source and be learned in ARP Table.
To check the ARP cache table whether any MAC learnt.
PC>arp -a
ARP request will have Source and destination IP address and Destination MAC address as FFFF.FFFF.FFFF.
when the destination Ip address reply to the broadcast, it will send its MAC address.
switch#show mac address-table
How ARP works in two network
----------------------------
Router#show ip interface brief
Source will chk ARP cache, if not send the ARP request to switch then go to router. Router will send its own MAC as reply, then source will send the ICMP to the Router, now router will send the ARP request to other network device and get the reply from destination device then it will forward to the source.
The device in different network will learn the routers MAC address only.
Spanning Tree Protocol
Spanning Tree Protocol
======================
Advantages:
Avoid Broadcast storm in the Layer 2 network.
Avoid Datbase inconsistency.
Avoid Duplicate and multiple copy of data transmission.
how STO works?
-------------
step1 -> Root Bridge election.
STP uses the 64big bridge ID for the selection of Root Bridge.
Bridge ID = Switch Priority + MAC address
Default Bridge priority for all Cisco switches is 32768.
The bridge (Switch) with the lowest Bridge Id will be selected as Root Bridge.
If more than one switch has same bridge id then the device with lowest MAC address will be selected as Root Bridge.
All ports at the Root Bridge will be in Forwarding State.
step2 -> Root Port selection.
Every Non Root Switches should have at least one ROot Port to reach the Root Bridge.
Root Ports are selected based on the below for 3 different setup:
Port that has the lowest path cost to reach Root Bridge.
If Path cost are same, Lowest switch ID(Priority + MAC) of the forwarding device is preferred.
If Path cost and switch Id is same, lowest physical port of the forwarding device is prefereed.
once the Root port is selected it will be always in forwarding state.
step3 -> selecting Designated and Non designated port.
Designated port will be in forwarding state, however it go through Blocking>Listening>Learning>Forwarding state step by step and Non designated ports will be in Blocking state.
Below are the selection criteria for Designated:
Port with the Least cost
Device with Least Local Switch ID (Switch Priority + MAC Address) is preferred.
If both the device has same switch ID, device that has least port number connected is preferred.
Root Bridge(RB)
Non Rood Bridge (NRB)
Root Port
Designated Port (DP)
BPDU (Bridge Protocol Data Unit)
BPDU is the message that is exchanged between the network devices using Spanning Tree Protocol to form a loop-free Topology.
2 types:
Configuration BPDU
Topology change Notification (TCN) BPDU
BPDU contain information like, Bridge ID, Switch Priority, Switch MAC address, port information,
Path cost:
All the non root switch will reach the Root Bridge through its Root Port. The Root Port is calculated in every switch with its path cost.
The port which has the lowest accumulated path cost value to reach the root bridge is selected as the Root Port.
Link Speed 10 Gbps (cost 2)
Link Speed 1 Gbps (cost 4)
IP Routing
Routing is a process of moving a packet from one network to other network by means of a device known as ROuter in the shortest distance path.
Static Routing
Dynamic Routing -> Interiro Gateway Protocol(IGP) & Exterior Gateway Protocol(EGP)
IGP -> Link State Routing Protocol (OSPF, ISIS)
Distance Vector Routing Protocol (RIP, IGRP)
Hybrid Routing Protocol (EIGRP)
EGP -> BGP
Config Default Route
--------------------
Router(config)#ip route 0.0.0.0 0.0.0.0 20.0.0.2
(destination ip address, subnet mast, next hop)
Config static route
-------------------
Router(config)#ip route 100.0.0.0 255.255.255.0 30.0.0.2
(destination network address, subnetmask, next hop)
EIGRP
EIGRP
=====
Enhanced Interior Gateway Routing Protocol
EIGRP is an IGP that is used to share the routes with other Routers within the same AS.
Hybrid Routing Protocol.
Maximum Hop count is 255
Classless Routing Protocol supports VLSM and Summarization.
Load Balancing can be done on both Equal & Unequal Path.
It supports to provide backup route.
Use Bandwidth & Delay as a common metrics.
Special Features:
----------------
It Uses Protocol Dependent Moduels (PDM) that provide support for different Network Layer protocols such as IP, IPX, AppleTalk.
Every EIGRP PDM maintains a seperate routing information that applies to a particular protocol, so each router will have
IP/EGRP Table, IPX/EIGRP table and AppleTalk/EIGRP table.
Efficient Neighbour discover, Hello packets are sent in regular intervals of time to directly connected routers to discover the neighbours.
Time intervals depends on the interface.
LAN = 5 seconds, WAN = 60 seconds.
Dead Interval = 3 * Hello Packet interval.
To manage communication between Neighbours it uses the class D address 224.0.0.10 to send Multicast traffic to all Neighbours in its table.
And maintain the list of Neighbour who have replied for the multicast it sends out. If it doesn't gets the reply then resend the same data using Unicast
and declared Dead, if it doesnt get a reply even after 16 Unicast attempts. This is often referred as Reliable Multicast.
In EIGRP, Diffusing update Algorithm(DUAL) is used for selecting and maintaining best path to each remote network, that support the following.
>Backup Route determination
>Supports Variable-Length Subnet Mast(VLSM)
>Dynamic route recoveries
>sending out queires for alternate route if no route found.
EIGRP Tables:
3 Types of tables are used in EIGRP, they are
Neighbour Table: Maintains the information about all the directly connected Neighbours
Topology Table: Maintains the list of all possible path to all possible remote networks
Routing Table: Maintains the list of only the best path to all possible remote networks
EIGRP Packets:
There are 5 packets used in EIGRP.
HELLO : used to discover neighbours
UPDATE : used to update the newly learnt Network to neighbours.
QUERY : if the current best path is down then this packet is sent to the neighbours to know the next best path to reach the destination.
REPLY : this is the reply packet for the query packet sent to the Neighbours.
ACK : this is the acknowledge packet sent for the reply packet.
EIGRP Metrics:
Unlike many other protocols that uses single factor to compare routes, EIGRP select the best possible path by using the following factors.
>Bandwidth
>Delay
>Load
>Reliability
>MTU(Maximum Transmission Unit)
By default, EIGRP uses only Bandwidth & Delay to determine the best path to a remote Network.
EIGRP Terms:
Feasible Distance (FD) is the possible distance from source to Destination.
Advertised Distance(AD) is the possible distance from next Neighbour to Destination.
Successor: Best Path from the source to Destination.
Feasible Succesor: Next best path from Source to destination.
FD of successor should be greater than AD of feasible successor.
Configuration Syntax:
--------------------
Router1(config)#router eigrp <AS number>
Router1(config-router)#nework <network id>
Router1(config-router)#network <network id>
Router1(config-router)#no auto-summary (by default EIGRP will do summarization, this is to stop that)
Model Configuration:
Router1(config)#router eigrp 10
Router1(config-router)#network 100.150.0.0 (advertise all directly connected network)
Router1(config-router)#network 20.10.10.0 (advertise all directly connected network)
Router1(config-router)#no auto-summary
EIGRP Commands:
---------------
Show ip eigrp neighbors (display all EIGRP neighbors)
Show ip eigrp topology (display entries in EIGRP topology table)
show ip route eigrp (displays only EIGRP entries in routing table)
Show ip route (Display the entire routing table)
OSPF
OSPF
====
show ip ospf database
show ip route
Show ip ospf neighbor
Open Shortest path first
It is an IGP, interior Gateway Protocol that is used to route the information within the Autonomous System.
It is a Link State protocol.
Open standard (can use with any router vendor)
Unlimited Hop Count (Cisco recommend 40 to 50 router in each area)
It uses Shortest Path First(SPF) Algorithm
Administrative distance is 110.
uses multicast address 224.0.0.5 & 224.0.0.6 to send the updates.
cost is the metric used.
cost can be calculated by formula COST = 10^8/bandwidth
support Equal cost load balancing
OSPF support only equal cost load balancing (EIGRP support equal and unequal)
classless routing protocol supports VLSM(Subnetting) and CIDR (RIP did not support subnetting VLSM)
uses the concept of Area to manage.(area concept is introduced to reduce LSA fludding)
Sends Hello packet (10 seconds) in regular intervals.
Dead timer = 4*hello timer.
Router ID plays an important role in OSPF.
Router only sends the changes in updates not the entire routing table. (whereas in RIP entire routing table is sent)
OSPF support authentication.
OSPF Tables:
-----------
There are 3 types of tables maintained in OSPF.
Neighbour Table
Database Table
Routing Table
Neighbour Table:
---------------
contian list of directly connected routers (neighbours)
it is also known as adjacency database.
show ip ospf neighbour
Database Table:
-----------------
Contain information about all possible routes in network within an Area.
It is also known as LSDB (Link State Database)
show ip ospf database
Routing Table:
---------------
contains the list of best path to each destination
show ip route
Router ID:
-----------
In general, Router ID is the name of the route.
If logical interface (loop back) is configures, the highest IP of the logical interface will be the router ID.
or else the highest IP of the physical interface will be the Router ID.
7 states of OSPF:
Down state - Router A sends multicast packet,
Init State - router B when receives this multicast packet , it will send unicast packet to router A.
Two way state - here neighbourship table will be formed between router A and B
Exstart state - negotiation take place for who should send the first database description packet (highest router id should share their database)
Exchange state - they will share the database
Loading state - they will compare the existing database with the newly received database and syn.
Full state - both router will be having the completely synched database.
OSPF Area:
Backbone Area or Transit Area:
This is the first area to be configured in OSPF with area id asd "0"
All other area in the OSPF network will be directly connected to this area.
Any traffic between different area will pass through this area and hence known as transit area.
Normal Area:
Apart from backbone area all other areas are known as Normal areas.
Unlike backbone area, a normal area doesnt allow traffic between different area to pass through it.
OSPF Router Types:
Ther are 3 types of routers in OSPF
Internal Router: All routers inside the area is known as internal router.
Backbone Router: Internal Router of backbone area is known as backbone router.
Area Border Router (ABR): Router that connects the normal area and backbone area is konwn as ABR.
LSA
LSA:
Link State Advertisement is a data packet that contains entire information about the link that includes info such as IP address, status of the interface(Up/Down), subnet mask, type of interface, bandwidth and delay.
LSA Types:
---------
Type 1 (Router LSA).
Type 2 (Network LSA)
Type 3 (Summary LSA)
Type 4 (Summary ASBR LSA)
Type 5 (Autonomous system external LSA)
Type 6 (Multicast LSA)
Type 7 (Not so stubby area LSA)
OSPF packet type:
----------------
Type 1 = Hello - used to discover neighbor
Type 2 = High level DBD (summary of LSDB)- Database discription - synchronisation between router
Type 3 = LSR - Link State Request - List of all missing LSA's
Type 4 = LSU - Link state update - Respond to LSA - whatever missing will be responded with update.
Type 5 = Link state Acknowledgement
Cost:
-----
Ethernet - 10
FastEthernet - 1
Loopback - 1
MPLS
MPLS
=====
Multi Protocol Label Switching
LDB - Labe distribution protocol (to generate labels)
CE - Customer Edge Router
PE - Provider Edge Router
LSR - Label Switch Router
Push swap and pop