2 Ccna Notes
2 Ccna Notes
OSI LAYERS
NETWORKING PROTOCOLS
IP ADDRESS
SUBNETTING
ROUTING
SWITCHING
VLAN
PORT SECURITY
ACL
NAT
DHCP DNS
PAT
IPV6
FIREWALL
OSI LAYERS
* Open System Interconnect
Explains :
How data is transferred from source to destination and how data gets
converted into different format before reaching the destination.
Function :
It is a universal standard which all manufacturers should follow in order
to connect with the internet.
OSI - 7 layer and each layer has a device placed.
LAYERS
DEVICES
ENCAPSULATION DATA
FUNCTIONS
APPLICATION
COMPUTER
DATA
In built system app or 3rd party apps
PRESENTATION
COMPUTER
DATA
Encryption/Decryption & Data Integrity
SESSION
COMPUTER
DATA
Authentication, Authorisation
TRANSPORT
CABLES
SEGMENTS
Segmentation, Flow Control, Error Control
NETWORK
ROUTER
PACKETS
IP Addressing, Path Determination
DATALINK
SWITCH
FRAMES
Mac Addressing, Multiplexing
PHYSICAL
NIC, HUB
BITS
Converting to 0’s and 1’s
NETWORKING PROTOCOLS
Protocols - set of rules for two computers to communicate with each other.
1. TCP/IP
2. UDP
3. DNS
4. DHCP
Normally, a computer communication happens in packets. All these packets are like
courier packets with a from and to address.
These two protocols are responsible for two computer to communicate with each
other.
TCP
UDP
Will always check if the recipient is available or not.
Will not check
Will always expect an acknowledgement from the recipient
Will not expect
Will be slow
Will be fast
No data loss
Data loss will occur
It is called heavy weighted protocol
It is called light weighted protocol
Ex : normal browser communication
Ex: Whatsapp, voip calls.
TCP FLAGS
RST - RESET
ACK - ACKNOWLEDGE
SYN - SYNCHRONIZE
FIN - FINISH
URG - URGENT
PSH - PUSH
TCP PORTS
Range = 0 - 65535
HTTP : 80
In case if the port is open, it will allow traffic. If not it will not allow
traffic.
TCP HEADER
IP ADDRESS - IPV4
IP - INTERNET PROTOCOL
CONTENTS
1. IP RANGE
2. DECIMAL TO BINARY CONVERSIONS
3. WHY IP IS 32 BIT
4. WHY RANGE IS 255
5. CLASSES OF IP
6. SUBNET MASK
7. NID & BID
8. PRIVATE IP RANGE
9. DEFAULT SUBNET MASK
10. CALC OF NO OF N/W AND HOST PORTIONS
IP RANGE
0.0.0.0
0.0.0.1
0.0.0.2
.
.
.
.
255.255.255.255
WHY IP IS 32 BIT?
0.0.0.0 - 00000000.00000000.00000000.00000000
.
.
.
255.255.255.255 - 11111111.11111111.11111111.11111111
Calculation - 2 power n
When 2 power 8 = 256
00000000
00000001
00000010
00000100
.
.
.
We take from 0 so range is 0-255
CLASSES OF IP
Important
CLASS RANGE
A 0 - 127
B 128 - 191
C 192 - 223
-------
D 224 - 239 MILITARY & RESERVED PURPOSE
E 240 -254 Reserved for Future uses and also R&D Process
CLASS A
0.0.0.0
0.0.0.1
.
127.255.255.255
CLASS B
128.0.0.0
128.0.0.1
.
.
191.255.255.255
CLASS C
192.0.0.0
192.0.0.1
.
.
223.255.255.255
Ex :
100.0.0.1 - A
132.10.0.2 - B
192.168.1.3 - C
SUBNET MASK
Assgined to
CLASS A Larger MNC N.H.H.H
CLASS B Midlevel comp N.N.H.H
CLASS C Small Comp & Home Users N.N.N.H
Network ID
Its like ur department name
Ex: Computer Science Department - It represents all the students studying in that
department
Its the collective representation of all computers in ur network or lan - usually
in IP
To find NID
1. Find class
2. Get number of network and host portions
3. Make host portions zero.
192.168.1.10
Class - C
SM - N.N.N.H
NID - 192.168.1.0 FIRST IP ADDRESS
DG - 192.168.1.1 SECOND IP ADDRESS
BID - 192.168.1.255 LAST IP ADDRESS
100.10.10.5
Class - A
SM - N.H.H.H
NID - 100.0.0.0
DG - 100.0.0.1
BID - 100.255.255.255
128.15.10.10
Class - B
SM - N.N.H.H
NID - 128.15.0.0
DG - 128.15.0.1
BID - 128.15.255.255
Broadcast ID
When we need to send a single msg to all the computers in our LAN. Then ill use
broadcast ID
IMPORTANT
We cannot use/assign the above 3 IP address to any computer.
PRIVATE IP ADDRESS
Is Ip address UNIQUE ?
Private IP
Used only inside a LAN
When this IP goes out of LAN, it becomes invalid and it changes to public IP
Ex: INdia being our LAN, We use INR only inside INdia, when go abroad, we convert
INR to USD.
We can view, edit, change
It is assigned by user or admin
Public IP
Used only outside a LAN
When this IP comes inside LAN, it becomes invalid and it changes to private IP
Ex: INdia being our LAN, We use INR only inside INdia, when go abroad, we convert
INR to USD.
We can view but cannot edit, change
It is assigned by ISP (internet service provider)
CLASS Public IP Range Private IP
A 0.0.0.0 - 127.255.255.255 10.0.0.0 - 10.255.255.255
B 128.0.0.0 - 191.255.255.255 172.16.0.0 -
172.31.255.255
C 192.0.0.0 - 223.255.255.255 192.168.0.0-
192.168.255.255
A
NO of n/w = 2 power 8-1 = 127 n/w
No f host = 2 power 24 and -2 = 16777216 hosts
SUBNETTING
DEST IP
192.168.1.3 11000000.10100000.00000001.00000011
SUB MASK
255.255.255.0 11111111.11111111.11111111.00000000
A=B, SWITCH DECIDES THAT PACKET BELONGS INSIDE LAN AND WILL NOT SEND IT TO ROUTER
A NOT EQUAL TO B, SWITCH DECIDES PACKET BELONGS TO ANOTHER LAN, SO IT WILL FORWARD
IT TO THE ROUTER.
USES OF SUBNETTING
* TO MINIMIZE COST
* TO MINIMIZE IP WASTAGE
11111111.11111111.11111111.11111100
SCENARIO 1
SALES - 120
HR - 120
n=0
2 power 0 = 1>=2 false
n=1
2 power 1 = 2>=2 true
CLASS C
DSM - 255.255.255.0 - 11111111.11111111.11111111.00000000
NO OF N/W = 2 power n
NO OF HOST = 2 power h and -2
A + B = C + 2 = D - 1 = E
SALES
0 - A
126 - B
HR
192.168.1.128 ----------------192.168.1.255
128 - A
126 - B
SCENARIO 2
LAB 1 - 30
LAB 2 - 30
LAB 3 - 30
LAB 4 - 30
LAB 5 - 30
SCENARIO 1 & 2
* SAME COMPANY
* SAME NO OF HOSTS
WE FOUND ‘n’ - NO OF N/W TO BE BORROWED
In Scenario 3
* Different company
* Different no of hosts
* We need to find ‘h’
SBI - 120
HDFC - 30
ICICI - 60
HSBC - 30
SBI - 120
FIND CLASS
FIND ‘h’
2 power h and -2 >= Req no of host
FIND CSM
CALC NO OF N/W AND HOST
You will or you should get 2 networks and 126 hosts each
IP ASSIGNING
ICICI - 60
FIND CLASS
FIND ‘h’
FIND CSM
You will not take the default subnet mask, you will take the previous custom subnet
mask and use the host bits and convert the remaining to network bits.
CALC NO OF N/W AND HOST
You will or you should get 2 networks and 62/60 hosts each
IP ASSIGNING
HSBC - 30
FIND CLASS
FIND ‘h’
FIND CSM
You will not take the default subnet mask, you will take the previous custom subnet
mask and use the host bits and convert the remaining to network bits.
CALC NO OF N/W AND HOST
You will get 2 networks with 30 hosts each. You will use one 30 host for HSBC and
other 30 host for hdfc
IP ASSIGNING
ROUTER
A. INTRODUCTION
B. ROUTER PORTS
C. ROUTER RULES
D. ROUTER MODES
E. ROUTER BASIC CONFIGURATION
INTRODUCTION
THE MAIN FUNCTION OF A ROUTER IS TO FIND THE BEST PATH.
WHAT DIFFERENCE DOES IT MAKE TO HAVE A ROUTER?
Bandwidth utilisation - We use router to use maximum of our bandwidth without any
loss. If our internet speed is 10 mbps, we can use the maximum of that with router,
and incase if we use a modem we will have loss.
Incase if we dont have a router, our isp will take care of routing needs.
ROUTER PORTS
INTERFACE - used to connect a router with other devices (router, Switch)
Ex:
-Ethernet interface - Old and Slow - Et
-Fast ethernet interface - Fast and new - Fe
-Gigabit ethernet interface - Very fast and advanced - Ge
All the above 3 will look the same. (RJ45 port), but differs in speed -
-Serial Interface
Used to connect two routers.
D. ROUTER MODES
1.User Mode
Router >
Its just a login mode, we cannot configure anything in this mode.
To enter into next mode,
Router > enable or
Router > en
2.Previledge mode
Router #
This mode we cannot configure anything in router, but we can see what is already
configured in router using SHOW command
We use this mode for Troubleshooting
In order to go to the next mode
To go to next mode
Router # configure terminal
Router # conf t
TO DO
1. Assign password for USER MODE
2. Command to rename the NAME OF ROUTER
3. TELNET configuration for router
4. Router Basic Configuration
1. Assign password
router>en
type password:
router#
4. Basic Configuration
Router> enable
Router# configure terminal
Router(config)# Interface fastethernet 0/0
int fas
tab tab tab is to complete the command
Verify
PC 192.168.1.2
CMD
ping 192.168.1.1
reply from 192.168.1.1 / Configuration is right
Request timed out
Destination host unreachable / Error in configuration
ROUTING
Process of making two routers communicate with each other.
Or
Process of filling IP tables either manually or automatically.
TO DO
1. Create Template in Packet tracer with 3 routers
2. Identify Master and Slave end of Serial cable in packet tracer
3. Set Clock rate as "64000" for master end and "not set" for slave end
TYPES OF ROUTING
A. STATIC ROUTING
-Process of filling ip tables with UNKNOWN NID / NETWORKS.
-Configured for smaller networks
B. DYNAMIC ROUTING
-Process of filling ip tables with KNOWN NID / NETWORKS.
-Configured for larger networks
STATIC ROUTING
We need to enter Unknown network ids
When we configure static routing in router, we get the following options
Network - Network ID
Mask - Subnet Mask
Next Hop - IP address
TODO
1. Open template in packet tracer
2. Configure Static routing
3. Verify configuration
4. Save As - Static routing
DYNAMIC ROUTING
In dynamic we configure router with KNOWN NETWORK ID's
-All the above routing protocols will identify best path differently.
-This is based on METRIC (based on what criteria best path is identified)
-Based on the purpose, we use any one of routing protocol
WORKING OF PROTOCOLS
RIP (Routing Information Protocol)
Metric - Hop Count
Best Path - Minimum Hop Count will be considered as best path.
Its an old protocol and not commonly used now a days due to false positive.
CONFIGURATION COMMANDS
RIP
#ROUTER RIP
#NETWORK (NETWORK ID)
EIGRP
#ROUTER EIGRP (AUTONOMOUS NUMBER)
#NETWORK (NETWORK ID)
OSPF
#ROUTER OSPF (PROCESS ID)
#NETWORK (NETWORK ID) (WILD CARD MASK) AREA (AREA NUMBER)
PROCESS ID
-Its a number
-Number range is from 0 - 65535 (we can assign any number)
-It should be different for all 3 routers
-It is like Landline Number.
WILD CARD MASK
-It is inverse of ur subnet mask
Calculation
Global Subnet mask - 255.255.255.255
Default Subnet mask - 255.255.255.0 (-)
Wild card mask - 0 . 0 . 0. 255
TO DO
- Open Template
- Configure RIP
- Verify
- Save as Routing RIP
Repeat the same for OSPF and EIGRP
OSPF
ROUTER A
ROUTER B
ROUTER C
EIGRP
ROUTER A
ROUTER B
ROUTER C
------------------------------------------------------------------------------
SWITCHING
-SWITCH PORTS
-SWITCH RULES
-SWITCH MODES
-BASIC CONFIG
SWITCH PORTS
-BASED ON FUNCTIONALITY
1. ACCESS PORT
-used for connecting a switch with another device(comp,router)
2. TRUNK PORT
-used to connect two switches
SWITCH RULES
* When you are trying to connect a switch to a router, you will connect in 0/1 to
router’s 0/0 port.
* When you are trying to connect a switch with another switch, you will connect in
0/24 to another switch’s 0/1
SWITCH MODES
BASIC CONFIGURATION
#INTERFACE FASTETHERNET 0/2
#SWITCHPORT MODE ACCESS
#EXIT
If you have many ports that has to be assigned as access mode, then you can use the
RANGE command
---------------------------------------------------------------------------------
18-03-2020
Disadvantages of Subnetting
- its time consuming - when we have more number of computers
- it is configured at user end, so users can change the ip configuration of
computers any time,. this is a security issue.
VLAN
- Subnetting depends on two factors - IP RANGE & CUSTOM SUBNET MASK
- vlan doesnt depend on both of these, because we configure the ports of a switch
and not computers.
PACKET TRACER 1
Create two VLANs
SALES 100 & HR 200
SWITCH>EN
#SHOW VLAN
#CONF T
#VLAN 100 //STEP1
#NAME SALES //STEP1
#EXIT
#EXIT
#SHOW VLAN
#CONF T
#INTERFACE FA0/2 //STEP 2
#SWITCHPORT MODE ACCESS //STEP 2
#SWITCHPORT ACCESS VLAN 100 //STEP 3
#EXIT
#SHOW VLAN
Verify
PING
192.168.1.2 -- 192.168.1.3
No reply
PACKET TRACER 2
0/24 OF SWITCH 1
SWITCH>EN
#CONF T
#INT FA0/24
#SWITCHPORT MODE TRUNK
#SWITCHPORT TRUNK ALLOWED VLAN ALL
0/1 OF SWITCH 2
SWITCH>EN
#CONF T
#INT FA0/1
#SWITCHPORT MODE TRUNK
#SWITCHPORT TRUNK ALLOWED VLAN ALL
Verify
Ping from Sales of switch1 to sales of switch2
Sales of switch1 to hr of switch2
---------------------------------------------------------------
PORT SECURITY
Disadvantages of VLAN
When attacker computer from outside our LAN tries to connect to sales vlan 100 of
switch 1, what will happen?
He will be able to connect and he can access all the documents of sales vlan, this
is a security risk and port security is used to stop this.
PACKET TRACER 1
#INT FA0/2
#SWITCHPORT MODE ACCESS
#SWITCHPORT PORT SECURITY
#SWITCHPORT PORT-SECURITY MAXIMUM 1
#SWITCHPORT PORT-SECURITY MAC ADDRESS STICKY
#SWITCHPORT PORT-SECURITY VIOLATION SHUTDOWN
VERIFY
REMOVE THE CONNECTION FROM 0/2, CONNECT A NEW COMPUTER TO 0/2,
PORT WILL TURN RED
------------------------------------------------------------------
TYPES OF ACL
A. STANDARD ACL
B. EXTENDED ACL
A. STANDARD ACL
- Its old and used in smaller networks
- It is permits / denies traffic based on "SOURCE IP ADDRESS"
- Configured close to "DESTINATION"
- Number Range 0 - 99
B. EXTENDED ACL
- Its new and used in larger networks
- It is permits / denies traffic based on
"SOURCE IP ADDRESS"
"DESTINATION IP ADDRESS"
"PROTOCOL"
"PORT NUMBER"
- Configured close to "SOURCE"
- Number Range 100 - 199
2.IMPLEMENTATION OF ACL
#INTERFACE<TYPE><NO>
#IP ACCESS-GROUP<NO> IN/OUT
3.VERIFICATION OF ACL
#SHOW IP ACCESS-LIST
4.VERIFICATION-IMPLEMENTATION OF ACL
#SHOW IP INTERFACE <TYPE><NO>
router A,
#access-list 10 deny 192.168.3.2 0.0.0.0
#interface fast ethernet 0/0
ip access-group 10 in
verify
3.2 - > 1.2 ping
NOTE -
WILD CARD MASK FOR ACL WILL HAVE THE FOLLOWING CRITERIA
NORMAL WILD CARD MASK WILL BE THE INVERSE OF UR SUBNET MASK
BUT HERE WE HAVE TWO SCENARIOS
SCENARIO 1 - WHEN WE CONFIGURE FOR A SINGLE HOST / IP
i.e 192.168.1.2, then Wild card mask will be all zeros 0.0.0.0
SCENARIO 2 - WHEN WE CONFIGURE FOR A ENTIRE NETWORK
i.e 192.168.1.0, then Wild card mask will be 0.0.0.255
IN :REQUEST TIMEOUT
OUT :DESTINATION HOST UNREACHABLE
-----------------------------------
EXTENDED ACL
ACL CREATION
#ACCESS-LIST <NO>PERMIT/DENY<PROTOCOL><SOURCE IP><SOURCE WILDCARD MASK><DESTINATION
IP><DESTINATION WILDCARD MASK><OPERATOR><PORT NO>
IMPLEMENTATION OF ACL
#INT <TYPE><NO>
#IP ACCESS-GROUP <NO>IN/OUT
Note:
1. More specific statements should be at top
2. More generic statements should be at bottom
WHEREAS BGP CAN PROVIDE ROUTING TO ROUTERS WITH DIFFERENT AUTONOMOUS NUMBER.
CONFIGURATION
ROUTER A
#ROUTER BGP (AUT NO- A)
#NETWORK (NID)
#NEIGHBOR (NEXT HOP IP ADDRESS) REMOTE-AS (REMOTE ROUTER AUT NO- B)
If we go for the first option A. and save the config and restart ur computer.
When computer restarts and login, whether ur computer will have ip assigned or not.
NO
IP will be assigned only after completion of DORA Process
Wireless Options
SSID
BSSID
FREQUENCY
CHANNEL
SECURITY - WEP, WPA, WPA2
AUTHENTICATION - AES, TKIP
ADMIN / MAINTENACE
find option to change default username and password for modem
(admin - admin, admin - password, admin - )
NAT
NETWORK ADDRESS TRANSLATION
The main objective of configuring NAT is - When someone pings our server, our
server should not directly reply to them instead, a different ip address should
reply.
Ex: When we ping google.com, we get a reply from google.co.in
Config PT
1.Router A & B - static routing
2.Verify - 192.168.1.2 --> 10.0.0.2
reply from 10.0.0.2
3.Configure NAT
4. Repeat Step 2
Reply from 200.1.1.2
- EACH INTERNAL LAN COMPUTER(PRIVATE IP) WILL HAVE A SINGLE IP ADDRESS(PUBLIC IP)
MAPPED BUT USES DIFFERENT PORTS TO DIFFERENTIATE EACH SESSION
- NAT CONFIGURATION DEFINES WHICH IP SHOULD RESPOND WHEN SOMEONE PINGS TO A SERVER
(EX: WHEN WE PING GOOGLE.COM, GOOGLE.CO.IN RESPONDS)
- PAT CONFIGURATION DEFINES WHICH IP SHOULD BE SHOWN WHEN WE PING TO ANY COMPUTER
OR SERVER (EX: WHEN WE PING GOOGLE.COM, PRIVATE IP WILL BE MASKED AND PUBLIC IP
WILL BE DISPLAYED TO GOOGLE SERVER)
CONFIGURATION
1. CONFIGURE IP TO ROUTERS & COMPUTERS
2. CONFIGURE ROUTING
3. CONFIGURE TELNET TO 2 ROUTERS
4. CONFIGURE GENERAL NAT IN ROUTERS
5. CREATE NAT POOL
6. CREATE ACL
7. APPLY NAT RULE
8. VERIFY
-CONFIGURE TELNET TO ROUTERS
ROUTER A & B
ROUTER(CONFIG)#LINE VTY 0 4
verify from pc
telnet 192.168.1.1
router>
-VERIFY
FROM COMPUTER 10.0.0.2
> TELNET 20.0.0.2 /IT WILL LOGIN TO ROUTER B
ROUTER> ENABLE
ROUTER# SHOW USER /IT WILL NOT DISPLAY 10.0.0.2 IP
GO TO ROUTER A
ROUTER# SHOW IP NAT TRANSLATIONS
FIREWALL
Security Device - Both Hardware & Software
Implements all the configurations of Router & Switch.
5.FIREWALL RULES
- Inbound Rules
- Outbound Rules
7. CONFIGURATION STEPS
--------------------------------------------------------
STEPS TO CONFIGURE FIREWALL
STEP 1 - REMOVE DEFAULT IP ADDRESS AND DHCP SCOPE RANGE
STEP 2 - ASSIGN IP,NAME AND SECURITY LEVEL TO VLAN 1 & 2
STEP 3 - LINK CORRESPONDING VLAN 1& 2 WITH THE RESPECTIVE INTERFACE
STEP 4 - CONFIGURE DHCP & DNS SERVER
STEP 5 - CONFIGURE DEFAULT ROUTE
STEP 6 - OBJECT NETWORK CREATION & ENABLING NAT
STEP 7 - CREATE ACCESS CONTROL LIST
---------------------------------------------------------
ciscoasa(config)#interface vlan 2
ciscoasa(config-if)#ip address 210.2.2.2 255.255.255.0
ciscoasa(config-if)#no shutdown
ciscoasa(config-if)#nameif outside
ciscoasa(config-if)#security-level 0
----------------------------------------------------------------
VERIFY
1.Change ip of computers from inside network to Dynamic
2.Ip should be automatically assigned by firewall.
Ex: 172.16.1.5
3. Now ping from 172.16.1.5 to 20.20.20.2 (DNS Server)
we should get reply.
The IP and the port no will be the details of any proxy server
EXAMPLE
If we use our location to be from china
Google --> Free Proxy List --> China
You will get list of ip and port choose any one and you can set you Proxy server
TODO
- WEBSITE BASED PROXY
- OS BASED PROXY - Tails OS
- CHAIN PROXIES
VPN
- VIRTUAL PRIVATE NETWORK
- USED TO SECURE OUR TRAFFIC
- WITH THE HELP OF TECHNOLOGY CALLED IPEC IP SECURITY
- IPSEC SECURES WITH THE HELP OF ENCRYPTION
- PROVIDES END TO END ENCRYPTION
VPN TUNNELLING
- USED TO END TO END TUNELLING - TUNNEL IS VIRTUAL
- IT BYPASS AN INTERMEDIATE ROUTER FROM SOURCE TO DESTINATION
- IP SEC BYPASS ALL TRAFFIC
CONFIGURATION COMMANDS
ROUTER A
#INTERFACE TUNNEL 0
#IP ADDRESS 100.0.0.1 255.0.0.0
#TUNNEL SOURCE SERIAL 0/0/1
#TUNNEL DESTINATION 40.0.0.2
ROUTER C
#INTERFACE TUNNEL 1
#IP ADDRESS 100.0.0.2 255.0.0.0
#TUNNEL SOURCE SERIAL 00/0/1
#TUNNEL DESTINATION 20.0.0.1
TODO
1)CONFIGURE IN PACKET TRACER
2)VERIFY 10.0.0.2 -------->50.0.0.2
3)50.0.0.2 ---> TRACERT 10.0.0.2
4)CONFIGURE VPN
PORT STATUS
- FORWARD
- LEARN
- LISTEN
- DOWN
STEPS IN STP
CONFIGURATION COMMANDS
1)SWTICH>EN
#CONF T
#SPANNING-TREE MODE RAPID-PVST
#SPANNING-TREE VLAN 1
#SPANNING-TREE VLAN 1 ROOT PRIMARY
2)SWITCH 2
EN
CONF T
SPANNING-TREE MODE RAPID-PVST
SPANNING-TREE VLAN 1 ROOT SECONDARY
3)SWITCH 3
EN
CONF T
SPANNING-TREE MODE RAPID-PVST
SPANNING-TREE VLAN 1 ROOT SECONDARY
SWITCH 2
INT RANGE FA 0/1 - 0/24
SWITCHPORT MODE ACCESS
SPANNING-TREE BPDUGUARD ENABLE
TODO
1)Configure in packet tracer
2)Ping From pc to pc and check whether you get a reply
3)Configure STP
4)Repeat step 2