IP ADDRESS,ROUTING TASMI, S.Si,. M.Kom,. MTCNA, MTCRE
NETWORK FUNDAMENTAL
IP ADDRESS
IP (Internet Protocol) is the one of the protocols used to facilitate communication between hosts on the network. IP is an unreliable but best effort delivery protocol. IP address is an identifier belongs to a host in order to communicate with other host on the network. IP formally divided in two type, a. IPv4, 32 bits length, represented in decimal, separated by dot (.), so called dotted decimal b. IPv6, 128 bits length, represented in hexadecimal separated by colon (:) Since IPv6 is still on implementation worldwide and not specifically discuss in this course, all ‘IP address’ that we used in this course refer to IPv4 address. 32 bits of an IP address divided in two parts, a. Network portion b. Host portion
IP ADDRESS (Cont) These portions is determined by the netmask/subnet mask following the IP address (netmask/subnet mask is explained on later slides). Network portion identify a network, so called network ID or network address. Network ID can be concluded by ANDing an IP address with its subnet mask. Host portion identify total hosts that can be contained on a network. A network contains a network address, a broadcast address, and usable IP addresses. Two or more devices on a network can communicate (without any routing process involved) if they are on the same range of a network.
NETWORK FUNDAMENTAL
IP ADDRESS CLASSESS OF IP ADDRESS Class A Class B Class C Class D Class E
: 0.0.0.0 – 127.255.255.255 00000000.00000000.00000000.00000000 s.d 0111111.11111111.11111111.111111111 : 128.0.0.0 – 191.255.255.255 10000000.00000000.00000000.00000000 s.d 10111111.11111111.11111111.11111111 : 192.0.0.0 – 223.255.255.255 11000000.00000000.00000000.00000000 s.d 11011111.11111111.11111111.11111111 : 224.0.0.0 – 239.255.255.255 11100000.00000000.00000000.00000000 s.d 11101111.11111111.11111111.11111111 : 240.0.0.0 – 255.255.255.255 11110000.00000000.00000000.00000000 s.d 11111111.11111111.11111111.11111111
Indication of class High order bits (left most bits on binary digit) On implementation, only class A to C can be used to address a host. Class D reserved for multicast address Class E reserved for further research
NETWORK FUNDAMENTAL
IP ADDRESS
NETMASK/ SUBNET MASK/ PREFIX LENGTH Function
: to determine a network scope, by ANDing an IP address with its netmask/subnetmask Component : network bit (represented by binary digit 1) host bit ( represented by binary digit 0) a netmask or subnet mask is formed of network bits followed by the host bits, in a sequence order Default Subnet Mask (by class): Class A : written in dotted decimal as 255.0.0.0 written in prefix length as /8 written in bit as 11111111.00000000.00000000.00000000 Class B : written in dotted decimal as 255.255.0.0 written in prefix length as /16 written in bit as 11111111.11111111.00000000.00000000 Class C : written in dotted decimal as 255.255.255.0 written in prefix length as /24 written in bit as 11111111.11111111.11111111.00000000 The Conclusion : a.By default, class A IP Address have (128 – 2) networks, and (2^24 -2) usable IP addresses for each network. b.By default, class B IP Address have (64 x 256) networks, and (2^16 -2) usable IP addresses for each network. c.By default, class C IP Address have (32 x 256 x 256) networks, and (2^8 -2) usable IP addresses for each network.
NETWORK FUNDAMENTAL PRIVATE VS PUBLIC IP ADDRESS
Related to RFC 1918, class A to C applicable addresses are divided into two parts, a. Private IP address Non routable address on public network (internet), for use in Local Area Network. Private address range are, * Class A : 10.0.0.0 – 10.255.255.255 * Class B : 172.16.0.0 – 172.31.255.255.255 * Class C : 192.168.0.0 – 192.168.255.255 b. Public IP address Routable address on public network (internet), the IP address allocation is controlled by IANA through its regional representative (RIR). Private addresses can be routed on internet after the translation process (NAT = Network Address Translation) NAT is a mechanism used to solve the lack of public IP address by translating private IP addresses into one or many public IP addresses.
Device R1 R2
Interface Fa0/0 S0/0/0 Fa0/0 S0/0/0
PC1
N/A
PC2
N/A
IP Address
Subnet Mask
Default Gateway
Subneting • Alamat IP didesain untuk digunakan secara berkelompok (sub-jaringan/subnet). • Subneting adalah cara untuk memisahkan dan mendistribusikan beberapa alamat IP. • Host/perangkat yang terletak pada subnet yang sama dapat berkomunikasi satu sama lain secara langsung (tanpa melibatkan router/routing).
Page 29
•
•
Subneting Apabila jaringan dianalogikan sebuah jalan, apabila disepanjang jalan cuma ada 8 rumah, ketua RT mengumumkan sesuatu dari rumah ke rumah lewat jalan itu. Apabila sepanjang jalan sudah penuh rumah butuh ada gang-gang . Butuh ada ketua RT tiap gang untuk meminimalis transportasi saat pengumuman dan mengatur urusan RTnya sendiri
Notasi Subnet • Subnet ditulis dalam format 32 bit (seperti IP), atau dalam bentuk desimal (prefix Length)
• Sebagai contoh, network 192.168.1.0 yang memiliki subnet mask 255.255.255.0 dapat direpresentasikan di dalam notasi prefix length sebagai 192.168.1.0/24.
Network ID dan Broadcast •
•
X-NoR
Dalam kelompok IP address ada 2 IP yang sifatnya khusus – Network ID : identitas suatu kelompok IP / Subnet. – Broadcast : alamat IP yang digunakan untuk memanggil semua IP dalam satu kelompok. Untuk menentukan network id dan broadcast dari sebuah alamat IP dengan subnet mask tertentu, dapat dilakukan dengan operasi logika AND Alamat IP 10000011 01101011 10100100 00011010 (131.107.164.26) Subnet Mask 11111111 11111111 11110000 00000000 (255.255.240.0) ------------------------------------------------------------------- AND Network ID 10000011 01101011 10100000 00000000 (131.107.160.0) Broadcast
10000011 01101011 10101111 11111111 (131.107.175.255)
Perhitungan IP Subnet Prefix
Subnet Mask
Jumlah IP
Jumlah Host (Jml IP − 2)
255.255.255.(256-jml IP)
/24
255.255.255.0
256
254
/25
255.255.255.128
128
126
/26
255.255.255.192
64
62
/27
255.255.255.224
32
30
/28
255.255.255.240
16
14
/29
255.255.255.248
8
6
/30 /31
255.255.255.252 255.255.255.254
4 2
2 -
/32
255.255.255.255
1
-
Perhitungan Subnet Rumus menghitung Jumlah IP address dalam subnetmask:
2(32-n) , dimana n=prefix subnet Contoh, IP kelas C: 20.20.20.20/30, Tentukan Range IP, IP Host , Network ID, Broadcast dan Subnet Masknya: • Jumlah IP dalam subnet: Gunakan Rumus 2(32-30) = 22 = 4 • Range IP Range IP dicari berdasarkan kelipatan Jumlah IPnya (kelipatan 4): 20.20.20.0 s/d 20.20.20.3 20.20.20.4 s/d 20.20.20.7, (8-11),(12-15)…terus sampai (252-255) IP address pada soal (20.20.20.20) ada pada range: 20.20.20.20 s/d 20.20.20.23
Perhitungan Subnet IP kelas C: 20.20.20.20/30, Tentukan Range IP, IP Host , Network ID, Broadcast dan Subnet Masknya : • Network ID dan Boradcast: Dari range IP yang telah ditemukan (20.20.20.20 s/d 20.20.20.23) IP terkecil digunakan untuk network ID, terbesar untuk Broadcast Network ID 20.20.20.20, Broadcast 20.20.20.23 Range IP dikurangi Network ID dan broadcast • IP Host
•
IP host 20.20.20.21 s/d 20.20.20.22 Jumlah IP host jumlah IP dalam subnet dikurangi dua Subnet mask 255.255.255.(256 – jumlah IP) Subnet mask
255.255.255.252
Kerjakan Soal Berikut Tentukan jumlah IP, network id & broadcast, IP Host, dan subnet mask dari IP address berikut: 1. 11.11.11.11/26 9. 99.99.99.99/25 10. 100.100.100.100/27 2. 22.22.22.22/28 11.111.111.111.111/30 3. 33.33.33.33/25 12. 122.122.122.122/25 4. 44.44.44.44/29 13. 133.133.133.133/28 5. 55.55.55.55/27 14.144.144.144.144/24 6. 66.66.66.66/28 15.155.155.155.155/26 16.166.166.166.166/29 7. 77.77.77.77/30 8. 88.88.88.88/31
Contoh Soal Subneting Dalam suatu jaringan host A dan B menggunakan subnet mask berbeda, IP host A adalah192.168.0.200/26 sedangkan B akan menggunakan subnet /25. Berapakah Range IP B yang boleh dipakai agar antar host bisa saling komunikasi? Syarat terjadinya koneksi antar A & B beda subnet : IP A harus ada di range subnet B, IP B harus ada di range subnet A. • Range IP address A 192.168.0.193 s/d 192.168.0.254 • Range IP address B 192.168.0.129 s/d 192.168.0.254 • B hanya boleh menggunakan IP address 192.168.0.193 s/d 192.168.0.254 • B tidak boleh menggunakan IP address 192.168.0.129 s/d 192.168.0.192
Contoh Subneting
IP 204.17.5.0/24 1. 2. 3. 4. 5.
Tentukan Jumlah subnet?? Tentukan Network ID /Network address setiap subnet ?? Tentukan jumlah host setiap subnet Tentukan IP Broadcast setiap subnet?? Tentukan IP pertama dan IP terakhir setiap Subnet??
1.
n
2 = , dimana n adalah banyak angka 1 di octet terakhir 3
2 =8
2.
256 – 224 = 32
32 + 32 = 64, 64+32=96, 96+32=128, 128+32=160, 160 +32 = 192, 192+ 32 = 224
3.
x
2 = , dimana x adalah banyak angka 0 di octet terakhir 5
2 = 32 Subnet
Network ID
Subnetmask
IP Pertama
IP Terakhir
IP Bordcast
1
204.17.5.0
255.255.255.22 4
204.17.5.1
204.17.5.30
204.17.5.31
2
204.17.5.32
IDEM
204.17.5.33
204.17.5.62
204.17.5.63
3
204.17.5.64
204.17.5.65
204.17.5.94
204.17.5.95
4
204.17.5.96
204.17.5.97
204.17.5.126
204.17.5.127
5
204.17.5.128
204.17.5.129
204.17.5.158
204.17.5.159
6
204.17.5.160
204.17.5.161
204.17.5.190
204.17.5.191
7
204.17.5.192
204.17.5.193
204.17.5.222
204.17.5.223
8
204.17.5.224
204.17.5.225
204.17.5.254
204.17.5.255
Contoh Soal 1. IP Host A 192.168.1.34/25 dan IP Host B 192.168.1.129/24, bisakah antara Host A dan Host B berkomunikasi? Jawab: Range subnet A = 192.168.1.0 – 192.168.1.127 } Host B 192.168.1.129 Range subnet B = 192.168.1.0 – 192.168.1.255 } Host A 192.168.1.34 IP host B tidak termasuk pada range subnet A, Host A dan Host B tidak dapat berkomunikasi
IP Bogon • IP Bogon adalah IP yang tidak dapat dipakai karena tidak diatur dalam aturan organisasi internet. • IP bogon biasanya muncul karena kesalahan konfigurasi yang tidak disengaja atau sengaja untuk tujua tertentu • Contoh IP bogon : 0.0.0.0/8, 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, dsb • Bogons dapat difilter menggunakan ACLs atau BGP blackholing. • IP bisa digolongkan IP bogon untuk saat ini, namum bisa jadi kedepanya bukan merupakan IP bogon lagi jika ditetapkan oleh organisasi internet internasional (IANA).
192.168.123.0/24
IP address 192.168.123.0/26
• How many subnets are needed for this network? ____________________ • What is the subnet mask for this network in dotted decimal format? ____________________ • What is the subnet mask for the network in slash format? ____________________ • How many usable hosts are there per subnet? ____________________
LENGKAPI ADDRESS TABLE Device
R1
R2
Interface
IP Address
Subnet Mask
Default Gateway
Fa0/0
N/A
S0/0/0
N/A
Fa0/0
N/A
S0/0/0
N/A
PC1
NIC
PC2
NIC
Gateway dan Default Gateway • Static routing dilakukan dengan pengaturan arah paket data yang melalui router, dengan menentukan GATEWAY untuk dst address/network tertentu • Gateway bisa berupa IP ADDRESS atau INTERFACE • IP GATEWAY router harus satu subnet dengan salah satu IP Interface router • IP GATEWAY merupakan IP didepan device • Hanya ada 1 Gateway untuk satu network • Default Gateway adalah pengaturan untuk dst-address menggantikan semua ip yang ada di internet. Dst-address = 0.0.0.0 0.0.0.0 (0.0.0.0/0)
LAB Gateway
192.168.50.1 192.168.10.1 192.168.30.1
192.168.10.2
192.168.50.2 192.168.30.2
KONFIGURASI ROUTER CISCO
1
3
2
Konfigurasi IP Address
Konfigurasi IP Address
Routing Ada dua tipe Routing • Dynamic Routing –rute dibuat secara otomatis • Saat akan menambahkan IP address pada interface • Informasi routing yang akan didapat dari protocol routing dinamis seperti : RIP, OSPF dan BGP
• Statick Routing – rute dibuat manual oleh admin untuk mengatur ke arah mana trafik tertentu akan diarahkan • Defult route adalah salah satu contoh static routing
DASAR PEMILIHAN ROUTING • Rule routing yang paling spesifik tujuan nya 192.168.0.5 • Contoh : destination 192.168.0.0/29 lebih spesifik dari 192.168.0.0/24
• Distance • Router akan memilih distance yang Paling kecil
• Roud Robin • Router akan memilih secara sequential
Dasar Pemilihan Routing • Contoh kasus : untuk koneksi dengan destination 192.168.0.1, manakah urutan prioritas rule yang digunakan Destination
Gateway
Distance
Priority
192.168.0.0/27
192.168.1.1
1
2
192.168.0.0/29
192.168.2.1
1
1
192.168.0.0/24
192.168.3.1
5
4
192.168.0.0/24
192.168.4.1
1
3
Konfigurasi Static Routing • IP route command – To configure a static route use the following command: ip route – Example: • Router(config)# ip route network-address subnet-mask {ip-address | exitinterface }
LAB – Static Routing 172.16.3.0/30
192.168.20.0/24
RI
R2
192.168.10.0/24
Web Server
LAB – Static Routing Interface
ROUTER I
Fa0/0 Fa0/1 Fa0/0
172.16.3.2 192.168.20.1 172.16.3.1
255.255.255.252 255.255.255.0 255.255.255.252
N/A N/A N/A
Fa0/1
192.168.10.1
255.255.255.0
N/A
PC0
NIC
192.168.20.254
255.255.255.0
192.168.20.1
Web Server
NIC
192.168.10.254
255.255.255.0
192.168.10.1
ROUTER II
IP Address
Subnet Mask
DefaultGateway
Device
Continue with configuration dialog? [yes/no]: n Press RETURN to get started! Tekan tombol enter untuk memulai Memberi nama Router Router>enable Router#configure terminal Router(config)#Hostname ROUTER_I
Membuat Banner Router_I(config)#banner motd #Selamat Datang di Router_I# Membuat Password Router_I#configure terminal Router_I(config)#line console 0 Router_I(config-line)#password cisco Router_I(config-line)#login Router_I(config-line)#exit Router_I(config)#enable password cisco Router_I(config)#enable secret cisco Router_I(config)#service password-encryption (mengencryption-password) Mensetting U/ Telnet Router_I(config)#line vty 0 4 Router_I(config-line)#password cisco Router_I(config-line)#login Router_I(config-line)#exit
Simpan configure ke NVRAM Router_I(config)#ctrl+z Router_I#copy run start -->> kemudian tekan enter 2 x Setting IP di Interface 0/0 Router_I(config)#interface fastEthernet 0/0 Router_I(config-if)#ip address 172.16.3.2 255.255.255.252 Router_I(config-if)#no shutdown Router_I(config-if)#exit Setting IP di Interface 0/1 Router_I(config)#interface fastEthernet 0/1 Router_I(config-if)#ip address 192.168.20.1 255.255.255.0 Router_I(config-if)#no shutdown Router_I(config-if)#exit Simpan configure ke NVRAM Router_I(config)#ctrl+z Router_I#copy run start -->> kemudian tekan enter
2x
Configurasi Untuk Router II Memberi nama Router Router>enable Router#configure terminal Router(config)#Hostname ROUTER_II Membuat Banner Router_II(config)#banner motd #Selamat Datang di Router II#
Simpan configure ke NVRAM Router_II (config)#ctrl+z Router_II #copy run start -->> kemudian tekan enter 2 x Setting IP di Interface 0/0 Router_II (config)#interface fastEthernet 0/0 Router_II (config-if)#ip address 172.16.3.2 255.255.255.252 Router_II (config-if)#no shutdown Router_II (config-if)#exit
Membuat Password Router_II#configure terminal Router_II(config)#line console 0 Router_II(config-line)#password cisco Router_II(config-line)#login Router_II(configline)#exit
Setting IP di Interface 0/1 Router_II (config)#interface fastEthernet 0/0 Router_II (config-if)#ip address 192.168.10.1 255.255.255.0 Router_II (config-if)#no shutdown Router_II (config-if)#exit
Router_II (config)#enable password cisco Router_II (config)#enable secret cisco Router_II (config)#service password-encryption (mengencryption)
Simpan configure ke NVRAM Router_II (config)#ctrl+z Router_II #copy run start -->> kemudian tekan enter 2 x
Mensetting U/ Telnet Router_II (config)#line vty 0 4 Router_II (config-line)#password cisco Router_II (config-line)#login Router_II (config-line)#exit
PC 0 IPADDRESS SUBNETMASK DEFAULGATEWAY
192.168.20.254 255.255.255.0 192.168.20.1
SERVER IPADDRESS SUBNETMASK DEFAULGATEWAY
192.168.10.254 255.255.255.0 192.168.10.1
Router_I(config)#ip route 192.168.10.0 255.255.255.0 172.16.3.1 Perintah
Keterangan
ip route
Identifikasi rute statik
192.168.10.0
Alamat IP Stub Network
255.255.255.0
Subnet Mask
172.16.3.1
Alamat IP Router B
Konfigurasi R1
Router_II(config)#ip route 192.168.10.0 255.255.255.0 172.16.3.1 Konfigurasi R2
Troubleshooting • Troubleshooting static routes may require some of the following commands: –Ping –Traceroute –Show IP route –Show ip interface brief –Show cdp neighbors detail
Link-State Routing Protocols
Introduction
Link-State Routing • Link state routing protocols – Also known as shortest path first algorithms – These protocols built around Dijkstra’s SPF
Link-State Routing • Dikjstra’s algorithm also known as the shortest path first (SPF) algorithm
Link-State Routing • The shortest path to a destination is not necessarily the path with the least number of hops
Link-State Routing • Link-State Routing Process – How routers using Link State Routing Protocols reach convergence • • • •
Each routers learns about its own directly connected networks Link state routers exchange hello packet to “meet” other directly Connected link state routers Each router builds its own Link State Packet (LSP) which includes information about neighbors such as neighbor ID, link type, & bandwidth • After the LSP is created the router floods it to all neighbors who then store the information and then forward it until all routers have the same information • Once all the routers have received all the LSPs, the routers then construct a topological map of the network which is used to determine the best routes to a destination
Link-State Routing • Directly Connected Networks • Link
– This is an interface on a router
• Link state – This is the information about the state of the links
Link-State Routing • Sending Hello Packets to Neighbors – Link state routing protocols use a hello protocol – Purpose of a hello protocol: • To discover neighbors (that use the same link state routing protocol) on its link
Link-State Routing • Sending Hello Packets to Neighbors – Connected interfaces that are using the same link state routing protocols will exchange hello packets – Once routers learn it has neighbors they form an adjacency • 2 adjacent neighbors will exchange hello packets • These packets will serve as a keep alive function
Link-State Routing • Building the Link State Packet – Each router builds its own Link State Packet (LSP) – Contents of LSP: • State of each directly connected link • Includes information about neighbors such as neighbor ID, link type, & bandwidth
Link-State Routing • Flooding LSPs to Neighbors – Once LSP are created they are forwarded out to neighbors – After receiving the LSP the neighbor continues to forward it throughout routing area
Link-State Routing • LSPs are sent out under the following conditions: – Initial router start up or routing process – When there is a change in topology
Link-State Routing • Constructing a link state data base – Routers use a database to construct a topology map of the network
Link-State Routing
Link-State Routing • Shortest Path First (SPF) Tree – Building a portion of the SPF tree – Process begins by examining R2’s LSP information • R1 ignores 1st LSP • Reason: R1 already knows it’s connected to R2
Link-State Routing • Building a portion of the SPF tree – R1 uses 2nd LSP • Reason: R1 can create a link from R2 to R5 - this information is added to R1’s SPF tree
Link-State Routing • Building a portion of the SPF tree – R1 uses 3rd LSP • Reason: R1 learns that R2 is connected to 10.5.0.0/16 • This link is added to R1’s SPF tree
Link-State Routing • Determining the shortest path – The shortest path to a destination determined by adding the costs & finding the lowest cost
Link-State Routing • Once the SPF algorithm has determined the shortest path routes, these routes are placed in the routing table
Link-State Routing Protocols Advantages of a Link-State Routing Protocol Routing protocol
Builds Topological map
Router can independently determine the shortest path to every network.
Convergence
A periodic/ event driven routing updates
Use of LSP
Distance vector
No
No
Slow
Generally No
No
Link State
Yes
Yes
Fast
Generally Yes
Yes
Link-State Routing Protocols • Requirements for using a link state routing protocol – Memory requirements • Typically link state routing protocols use more memory
– Processing Requirements • More CPU processing is required of link state routing protocols
– Bandwidth Requirements • Initial startup of link state routing protocols can consume lots of bandwidth
Link-State Routing Protocols • 2 link state routing protocols used for routing IP – Open Shortest Path First (OSPF) – Intermediate System-Intermediate System (IS-IS)
OSPF
Objectives • Describe the background and basic features of OSPF. • Identify and apply the basic OSPF configuration commands. • Describe, modify and calculate the metric used by OSPF. • Describe the Designated Router/Backup Designated Router (DR/BDR) election process in multiaccess networks. • Describe the uses of additional configuration commands in OSPF.
Introduction
Introduction to OSPF • Background of OSPF – Began in 1987 – 1989 OSPFv1 released in RFC 1131 – This version was experimental & never deployed – 1991 OSPFv2 released in RFC 1247 – 1998 OSPFv2 updated in RFC 2328 – 1999 OSPFv3 published in RFC 2740
Introduction to OSPF • OSPF Message Encapsulation – OSPF packet type • There exist 5 types
– OSPF packet header • Contains - Router ID and area ID and Type code for OSPF packet type
– IP packet header • Contains - Source IP address, Destination IP address, & Protocol field set to 89
Introduction to OSPF • OSPF Message Encapsulation – Data link frame header – Contains - Source MAC address and Destination MAC address
Introduction to OSPF OSPF Packet Types
Introduction to OSPF • Hello Protocol • OSPF Hello Packet – Purpose of Hello Packet • Discover OSPF neighbors & establish adjacencies • Advertise guidelines on which routers must agree to become neighbors • Used by multi-access networks to elect a designated router and a backup designated router
Introduction to OSPF • Hello Packets continued – Contents of a Hello Packet router ID of transmitting router
• OSPF Hello Intervals – Usually multicast (224.0.0.5) – Sent every 30 seconds for NBMA segments
• OSPF Dead Intervals – This is the time that must transpire before the neighbor is considered down – Default time is 4 times the hello interval
Introduction to OSPF • Hello protocol packets contain information that is used in electing – Designated Router (DR) • DR is responsible for updating all other OSPF routers
– Backup Designated Router (BDR) • This router takes over DR’s responsibilities if DR fails
Introduction to OSPF • OSPF Link-state Updates – Purpose of a Link State Update (LSU) • Used to deliver link state advertisements
– Purpose of a Link State Advertisement (LSA) • Contains information about neighbors & path costs
Introduction to OSPF • OSPF Algorithm • OSPF routers build & maintain link-state database containing LSA received from other routers – Information found in database is utilized upon execution of Dijkstra SPF algorithm – SPF algorithm used to create SPF tree – SPF tree used to populate routing table
Introduction to OSPF
• Administrative Distance – Default Administrative Distance for OSPF is 110
Introduction to OSPF • OSPF Authentication – Purpose is to encrypt & authenticate routing information – This is an interface specific configuration – Routers will only accept routing information from other routers that have been configured with the same password or authentication information
Basic OSPF Configuration • Lab Topology • Topology used for this chapter – Discontiguous IP addressing scheme – Since OSPF is a classless routing protocol the subnet mask is configured in
Basic OSPF Configuration • The router ospf command • To enable OSPF on a router use the following command – R1(config)#router ospf process-id – Process id • A locally significant number between 1 and 65535 • This means it does not have to match other OSPF routers
Basic OSPF Configuration • OSPF network command – Requires entering: • network address • wildcard mask - the inverse of the subnet mask • area-id - area-id refers to the OSPF area – OSPF area is a group of routers that share link state information
– Example: Router(config-router)#network networkaddress wildcard-ask area area-id
Basic OSPF Configuration • Router ID
– This is an IP address used to identify a router – 3 criteria for deriving the router ID • Use IP address configured with OSPF router-id command – Takes precedence over loopback and physical interface addresses
• If router-id command not used then router chooses highest IP address of any loopback interfaces • If no loopback interfaces are configured then the highest IP address on any active interface is used
Basic OSPF Configuration • OSPF Router ID • Commands used to verify current router ID – Show ip protocols – Show ip ospf – Show ip ospf interface
Basic OSPF Configuration • OSPF Router ID • Router ID & Loopback addresses – Highest loopback address will be used as router ID if routerid command isn’t used – Advantage of using loopback address • The loopback interface cannot fail OSPF stability
• The OSPF router-id command – Introduced in IOS 12.0 – Command syntax • Router(config)#router ospfprocess-id • Router(config-router)#router-idip-address
• Modifying the Router ID – Use the command Router#clear ip ospf process
Basic OSPF Configuration • Verifying OSPF • Use the show ip ospf command to verify & trouble shoot OSPF networks • Command will display the following: – Neighbor adjacency • No adjacency indicated by – Neighboring router’s Router ID is not displayed – A state of full is not displayed
• Consequence of no adjacency – No link state information exchanged – Inaccurate SPF trees & routing tables
Basic OSPF Configuration Verifying OSPF - Additional Commands Command
Show ip protocols
Show ip ospf
Show ip ospf interface
Description Displays OSPF process ID, router ID, networks router is advertising & administrative distance Displays OSPF process ID, router ID, OSPF area information & the last time SPF algorithm calculated Displays hello interval and dead interval
Basic OSPF Configuration • Examining the routing table • Use the show ip route command to display the routing table – An “O’ at the beginning of a route indicates that the router source is OSPF – Note OSPF does not automatically summarize at major network boundaries
OSPF Metric • OSPF uses cost as the metric for determining the best route – The best route will have the lowest cost – Cost is based on bandwidth of an interface • Cost is calculated using the formula – 108 / bandwidth – Reference bandwidth • Defaults to 100Mbps • Can be modified using • Auto-cost reference-bandwidth command
OSPF Metric • COST of an OSPF route – Is the accumulated value from one router to the next
OSPF Metric • Usually the actual speed of a link is different than the default bandwidth – This makes it imperative that the bandwidth value reflects link’s actual speed • Reason: so routing table has best path information
• The show interface command will display interface’s bandwidth – Most serial link default to 1.544Mbps
Basic OSPF Configuration • Modifying the Cost of a link • Both sides of a serial link should be configured with the same bandwidth – Commands used to modify bandwidth value • Bandwidth command – Example: Router(config-if)#bandwidthbandwidth-kbps
• ip ospf cost command – allows you to directly specify interface cost – Example: R1(config)#interface serial 0/0/0 – R1(config-if)#ip ospf cost 1562 •
Basic OSPF Configuration • Modifying the Cost of the link • Difference between bandwidth command & the ip ospf cost command – Ip ospf cost command • Sets cost to a specific value
– Bandwidth command • Link cost is calculated
OSPF and Multiaccess Networks • Challenges in Multiaccess Networks • OSPF defines five network types: – Point-to-point – Broadcast Multiaccess – Nonbroadcast Multiaccess (NBMA) – Point-to-multipoint – Virtual links
OSPF in Multiaccess Networks • 2 challenges presented by multiaccess networks – Multiple adjacencies – Extensive LSA flooding
OSPF in Multiaccess Networks • Extensive flooding of LSAs – For every LSA sent out there must be an acknowledgement of receipt sent back to transmitting router – Consequence: lots of bandwidth consumed and chaotic traffic
OSPF in Multiaccess Networks • Solution to LSA flooding issue is the use of – Designated router (DR) – Backup designated router (BDR)
• DR & BDR selection – Routers are elected to send & receive LSA
• Sending & Receiving LSA – DR others send LSAs via multicast 224.0.0.6 to DR & BDR – DR forward LSA via multicast address 224.0.0.5 to all other routers
OSPF in Multiaccess Networks • DR/BDR Election Process – DR/BDR elections DO NOT occur in point to point networks
OSPF in Multiaccess Networks • DR/BDR elections will take place on multiaccess networks as shown below
OSPF in Multiaccess Networks • Criteria for getting elected DR/BDR 1. DR: Router with the highest OSPF interface priority 2. BDR: Router with the second highest OSPF interface priority 3. If OSPF interface priorities are equal, the highest router ID is used to break the tie
OSPF in Multiaccess Networks • Timing of DR/BDR Election – Occurs as soon as 1st router has its interface enabled on multiaccess network • When a DR is elected it remains as the DR until one of the following occurs – The DR fails – The OSPF process on the DR fails – The multiaccess interface on the DR fails
OSPF in Multiaccess Networks • Manipulating the election process – If you want to influence the election of DR & BDR then do one of the following: • Boot up the DR first, followed by the BDR, and then boot all other routers • OR • Shut down the interface on all routers, followed by a no shutdown on the DR, then the BDR, and then all other routers
OSPF in Multiaccess Networks • OSPF Interface Priority • Manipulating the DR/BDR election process continued – Use the ip ospf priority interface command. – Example:Router(config-if)#ip ospf priority {0 - 255} • Priority number range 0 to 255 – 0 means the router cannot become the DR or BDR – 1 is the default priority value
More OSPF Configuration • Redistributing an OSPF Default Route • Topology includes a link to ISP – Router connected to ISP • Called an autonomous system border router • Used to propagate a default route – Example of static default route: • R1(config)#ip route 0.0.0.0 0.0.0.0 loopback 1 – Requires the use of the default-information originate command – Example of default-information originate command: • R1(config-router)#default-information originate
More OSPF Configuration • Fine-Tuning OSPF • Since link speeds are getting faster it may be necessary to change reference bandwidth values – Do this using the autocost referencebandwidth command – Example: • R1(config-router)#autocost referencebandwidth 10000
More OSPF Configuration • Fine-Tuning OSPF • Modifying OSPF timers
– Reason to modify timers • Faster detection of network failures
– Manually modifying Hello & Dead intervals • Router(config-if)#ip ospf hello-interval seconds • Router(config-if)#ip ospf dead-interval seconds
– Point to be made • Hello & Dead intervals must be the same between neighbors
LAB-- OSPF Interface loopback 2.2.2.2/32
192.168.150.0/24
Router 2
192.168.100.0/24
Interface loopback 1.1.1.1/32 Router 1
Router 3
192.168.90.0/24
`
Interface loopback 3.3.3.3/32
`
192.168.75.0/24
LAB --- OSPF Konfigurasi R1 Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int lo 0 Router(config-if)# %LINK-5-CHANGED: Interface Loopback0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up Router(config-if)#ip add 1.1.1.1 255.255.255.255 Router(config-if)#ex Router(config)#int fa0/1 Router(config-if)#ip add 192.168.90.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#ex Router(config)#int fa0/0 Router(config-if)#ip add 192.168.150.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#ex Router(config)#
LAB --- OSPF Konfigurasi R2 Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int lo 0 Router(config-if)# %LINK-5-CHANGED: Interface Loopback0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up Router(config-if)#ip add 2.2.2.2 255.255.255.255 Router(config-if)#ex Router(config)#int fa0/1 Router(config-if)#ip add 192.168.100.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#ex Router(config)#int fa0/0 Router(config-if)#ip add 192.168.150.254 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#ex Router(config)#
LAB --- OSPF Konfigurasi R3 Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int lo 0 Router(config-if)# %LINK-5-CHANGED: Interface Loopback0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up Router(config-if)#ip add 3.3.3.3 255.255.255.255 Router(config-if)#ex Router(config)#int fa0/1 Router(config-if)#ip add 192.168.100.254 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#ex Router(config)#int fa0/0 Router(config-if)#ip add 192.168.75.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#ex Router(config)#
LAB --- OSPF • Konfigurasi PC1 IP Address Netmask Default Gateway
: 192.168.90.10 : 255.255.255.0 : 192.168.90.1
Konfigurasi PC2 IP Address Netmask Default Gateway
: 192.168.90.20 : 255.255.255.0 : 192.168.90.1
Konfigurasi Server IP Address Netmask Default Gateway
: 192.168.75.200 : 255.255.255.0 : 192.168.75.1
LAB --- OSPF Routing OSPF di R1 Router(config)#router ospf 10 Router(config-router)#network 1.1.1.1 0.0.0.0 area 0 Router(config-router)#network 192.168.90.0 0.0.0.255 area 0 Router(config-router)#network 192.168.150.0 0.0.0.255 area 0 Router(config-router)#ex
Routing OSPF di R2 Router(config)#router ospf 10 Router(config-router)#network 2.2.2.2 0.0.0.0 area 0 Router(config-router)#network 192.168.100.0 0.0.0.255 area 0 Router(config-router)#network 192.168.150.0 0.0.0.255 area 0 Router(config-router)#ex
Routing OSPF di R3 Router(config)#router ospf 10 Router(config-router)#network 3.3.3.3 0.0.0.0 area 0 Router(config-router)#network 192.168.100.0 0.0.0.255 area 0 Router(config-router)#network 192.168.75.0 0.0.0.255 area 0 Router(config-router)#ex
Selanjutnya coba lakukan test koneksi dengan melakukan ping ke masing-masing PC ke Server