=====Routing protocols Overview=====
Now it is the time to configure routing protocol. The purpose of a routing protocol is to learn of available routes that exist on the network, build routing tables and make routing decisions. We will be using OSPF to design the network. There are two types of Routing Protocols – Distance Vector protocols and Link State protocols. In this lab part, we will be using the one of the Link state protocols – Open Shortest Path First routing protocol for communication between the routers.
Configuring OSPF routing protocol on routers in GNS3
{{:routers.jpg?500|}}
====Configuring OSPF routing protocol:====
Router1#conf t
Router1(config)#router ospf 1
Router1(config-router)#router-id 1.1.1.1
// where 1 is the process id which is an internally used identifier for routing process.
Router1(config-router) #network 180.0.2.0 0.0.0.255 area 0
// 0 is the area id for the network interface
Router1(config-router) #network 180.0.3.0 0.0.0.255 area 0
Router1(config-router) #network 180.0.7.0 0.0.0.255 area 2
Router1(config-router) #exit
Router2#conf t
Router2(config)#router ospf 1
Router2(config-router) # router-id 2.2.2.2
Router2(config-router) #network 180.0.3.0 0.0.0.255 area 0
Router2(config-router) #network 180.0.4.0 0.0.0.255 area 0
Router2(config-router) #network 180.0.5.0 0.0.0.255 area 0
Router2(config-router) #exit
Router3#conf t
Router3(config)#router ospf 1
Router3(config-router) # router-id 3.3.3.3
Router3(config-router) #network 180.0.5.0 0.0.0.255 area 0
Router3(config-router) #network 180.0.6.0 0.0.0.255 area 1
Router3(config-router) #exit
Router4#conf t
Router4(config)#router ospf 1
Router4(config-router) #router-id 4.4.4.4
Router4(config-router) #network 180.0.6.0 0.0.0.255 area 1
Router4(config-router) #network 180.0.7.0 0.0.0.255 area 2
Router4(config-router) #exit
**Configure OSPF routing authentication against fake router attack:**
Router1#conf t
//ospf configuration on interface FastEthernet0/0 on Router1
Router1(config)#int fa0/0
Router1(config-if)#ip ospf authentication-key ltulab
Router1(config-if)#ip ospf authentication
Router1(config-if)#exit
//ospf configuration on interface FastEthernet0/1 on Router1
Router1(config)#int fa0/1
Router1(config-if)#ip ospf authentication-key infosec
Router1(config-if)#ip ospf authentication
Router1(config-if)#exit
Router2#conf t
Router2(config)#int fa0/0
Router2(config-if)#ip ospf authentication-key ltulab
Router2(config-if)#ip ospf authentication
Router2(config-if)#exit
Router2(config)#int fa0/1
Router2(config-if)#ip ospf authentication-key ltulab
Router2(config-if)#ip ospf authentication
Router2(config-if)#exit
Router3#conf t
Router3(config)#int fa0/0
Router3(config-if)#ip ospf authentication-key ltulab
Router3(config-if)#ip ospf authentication
Router3(config-if)#exit
Router3(config)#int fa0/1
Router3(config-if)#ip ospf authentication-key cisco
Router3(config-if)#ip ospf authentication
Router3(config-if)#exit
Router4#conf t
Router4(config)#int fa0/0
Router4(config-if)#ip ospf authentication-key cisco
Router4(config-if)#ip ospf authentication
Router4(config-if)#exit
Router4(config)#int fa0/1
Router4(config-if)#ip ospf authentication-key infosec
Router4(config-if)#ip ospf authentication
Router4(config-if)#exit
====Configuring BGP Protocol:====
**Overview:**
The Border Gateway Protocol (BGP) is one of a family of IP Routing protocols, and is an Exterior Gateway Protocol (EGP). BGP (Border Gateway Protocol) is a protocol for exchanging routing information between gateway hosts (each with its own router) in a network of autonomous systems. The current version of BGP is BGP version 4. BGP is often the protocol used between gateway hosts on the Internet.
BGP is designed to exchange routing and reachability information between autonomous systems on the Internet.
**What it does ?**
In a vectoring protocol like BGP, the gateway routers exchange network reachability information with their nearest neighbors. In other words, the routers communicate to each other the sets of addresses ("address prefixes") that they can reach, and the next hop address to which data should be sent in order to reach those addresses.
The routing table contains a list of known routers, the addresses they can reach, and a cost metric associated with the path to each router so that the best available route is chosen.
Hosts using BGP communicate using the Transmission Control Protocol (TCP) and send updated router table information only when one host has detected a change. Only the affected part of the routing table is sent.
BGP communicates with autonomous (local) networks using Internal BGP (IBGP). In this lab you will be designing your network that includes both IBGP and EBGP.
**How it works ?**
In the world of BGP, each routing domain is known as an autonomous system, or AS. What BGP does is help choose a path through the Internet, usually by selecting a route that traverses the least number of autonomous systems: the shortest AS path. BGP only knows about these paths based on updates it receives.
Unlike Routing Information Protocol (RIP), a distance-vector routing protocol which employs the hop count as a routing metric, BGP does not broadcast its entire routing table. At boot, BGP neighbor, called peer will hand over its entire table. After that, everything relies on updates received. Peers are established by manual configuration between routers to create a TCP session on port 179. A BGP speaker sends 19-byte keep-alive messages every 60 seconds to maintain the connection. Among routing protocols, BGP is unique in using TCP as its transport protocol.
Route updates are stored in a Routing Information Base (RIB). A routing table will only store one route per destination, but the RIB usually contains multiple paths to a destination. It is up to the router to decide which routes will make it into the routing table, and therefore which paths will actually be used.
In many cases, there will be multiple routes to the same destination. BGP therefore uses path attributes to decide how to route traffic to
{{:routersbgp.jpg?300|}}
Configuring the routers and neighbors, after the IP configuration has been down (references up)
R1(config)#router bgp 100
R1(config-router)#bgp router-id 1.1.1.1
R1(config-router)#neighbor 10.0.12.2 remote-as 200
R1(config-router)#exit
R2(config)#router bgp 200
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#neighbor 10.0.12.1 remote-as 100
R2(config-router)#exit
R3(config)#router bgp 200
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#neighbor 10.0.34.2 remote-as 300
R3(config-router)#exit
R4#conf t
R4(config)#router bgp 300
R4(config-router)#bgp router-id 4.4.4.4
R4(config-router)#neighbor 10.0.34.1 remote-as 200
R4(config-router)#exit
R4(config)#do sh ip bgp summary
R1#conf t
R1(config)#router bgp 100
Page 84 of 96
R1(config-router)#network 10.0.1.0 mask 255.255.255.0
R1(config-router)#exit
R4#conf t
R4(config)#router bgp 300
R4(config-router)#network 1.1.0.0 mask 255.255.0.0
R4(config-router)#exit
R2#conf t
R2(config)#router bgp 200
R2(config-router)#neighbor 10.0.23.2 remote-as 200
R2(config-router)#exit
R3#conf t
R3(config)#router bgp 200
R3(config-router)#neighbor 10.0.23.1 remote-as 200
R3(config-router)#exit
R2#conf t
R2(config)#router bgp 200
R2(config-router)#neighbor 10.0.23.2 next-hop-self
R2(config-router)#exit
R3#conf t
R3(config)#router bgp 200
R3(config-router)#neighbor 10.0.23.1 next-hop-self
R3(config-router)#exit