###### tags: `finished` :::success # INR lab 4 - OSPF ::: ## Task 1 - Prepare your network topology I created the topology according to figure "a)": <center> ![](https://i.imgur.com/GCfRVDd.png) Figure 1 - New topology </center> ## Task 2 - OSPF Learning & Configuring :::info 1. Deploy OSPF in your chosen network topology. ::: Example R1 ``` conf t int f1/0 ip address 192.168.1.1 255.255.255.0 no sh int f0/0 ip address 192.168.0.1 255.255.255.0 no sh int l0 ip address 10.10.10.10 255.255.255.255 router ospf 1 network 192.168.0.0 0.0.0.255 area 0 network 192.168.1.0 0.0.0.255 area 0 network 10.10.10.10 0.0.0.0 area 0 router-id 10.10.10.10 ``` The settings for each router are almost identical (with the exception of subnets and interfaces). This is an example of a typical configuration configuration for R1. The configuration on R4, for example, will differ by an additional subnet, which will be connected to the common subnet R1, R2 and R3 to ensure the operation of the OSPF protocol. ![](https://i.imgur.com/uiBYPV4.png) :::info 3. Which interface you will select as the OSPF router ID and why? ::: I chose to create a loopback interface, its advantage is that the loopback address is always active and cannot be inaccessible as a physical interface. :::info 4. What is the difference between advertising all the networks VS manual advertising (per interface or per subnet)? Which one is better? ::: If we are talking about OSPF, the difference is that only a DR router can do avalanche mailing throughout the network. Which is selected by the Hello protocol during the introduction of routers. In a broadcast network, such as Ethernet, the presence of DR reduces the amount of generated router protocol traffic. At that time, declaring manually, from interface to interface or from subnet to subnet, generates a large number of copies of the LSA. Therefore, I believe that the DR announcement and mailing on behalf of the entire network is better than a large flow of LSA from each router. :::info 5. If you have a static route in a router, how can you let your OSPF neighbors know about it? Approve and show it on practice. ::: For the router R1, we will create a static IP address, which will be a black hole: ``` #conf t #ip route 172.0.0.0 255.255.0.0 null 0 ``` ![](https://i.imgur.com/D6tdSlA.png) In order for the neighbors to find out about it, it is necessary to inform ospf about the appearance of a static route: ``` #router ospf 1 #redistribute static subnets ``` ![](https://i.imgur.com/nGEJBpm.png) :::info 6. Enable OSPF with authentication between the neighbors and verify it. ::: To configure authentication on subinterface, I used the following commands: ``` #int f0/0 #ip ospf message-digest-key 6 md5 qwerty #router ospf 1 #area 0 authentication message-digest ``` Using the MD5 algorithm to get a hash from a shared key and passing the hash instead of the password is a more secure method, so I chose it. In the picture below, you can see that after configuring authentication, R1 lost contact with neighbors who did not have this setting yet. ![](https://i.imgur.com/E3vmTSW.png) ## Task 3 - OSPF Verification :::info 1. How can you check if you have a full adjacency with your router neighbor? ::: I can check this using the `show ip ospf neighbour` command: ![](https://i.imgur.com/nKLRrM0.png) It is the State that displays the state in which the router is fully adjacent to its neighbor. :::info 2. How can you check in the routing table which networks did you receive from your neighbors? ::: I can check this using the `show ip route` command. We immediately see the connection type (O-ospf), which displays which subnet we have accessed through the neighbor's network. For example, we get into the subnet 192.168.30.0 via the f0/0 interface of the neighbor with the address 192.168.0.3 ![](https://i.imgur.com/qteNyso.png) :::info 3. Use traceroute to verify that you have a full OSPF network. ::: ![](https://i.imgur.com/kYyqG61.png) :::info 4. Which router is selected as DR and which one is BDR ? ::: ![](https://i.imgur.com/6zyEY5o.png) R1 - BDR R2 - DROTHER R3 - DR R4 - DR :::info 5. Check what is the cost for each network that has been received by OSPF in the routing table. ::: ![](https://i.imgur.com/FfvTW8N.png) ## References: 1. [Cisco docs](https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/13688-16.html) 2. [Habr - OSPF](https://habr.com/ru/post/418391/)