linux routers and community networks

35
Summer Course at Mekelle Institute of Technology. July, 2015. Linux Routers and Community Networks Llorenç Cerdà-Alabern http://personals.ac.upc.edu/llorenc [email protected] Universitat Politènica de Catalunya, Barcelona, Spain Revision: 0e36644 (2015-07-09) Llorenç Cerdà-Alabern Linux Routers and Community Networks 1 / 191

Upload: others

Post on 07-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Linux Routers and Community Networks

Summer Course at Mekelle Institute of Technology.

July, 2015.

Linux Routers andCommunity Networks

Llorenç Cerdà-Alabernhttp://personals.ac.upc.edu/llorenc

[email protected]

Universitat Politènica de Catalunya,

Barcelona, Spain

Revision: 0e36644 (2015-07-09)

Llorenç Cerdà-Alabern Linux Routers and Community Networks 1 / 191

Page 2: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Parts

I Introduction

II Lab 1: Basic Network Configuration

III Lab 2: RIP and OSPF

IV Lab 3: Firewall configuration

V Lab 4: Community Networks

VI Lab 5: Network Management

Llorenç Cerdà-Alabern Linux Routers and Community Networks 64 / 191

Page 3: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 65 / 191

Page 4: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

Description

Objectives

• Quagga is an open source routing software package thatprovides routing protocols support such as RIP, OSPF, IS-IS andBGP.

• Quagga is a brach of the original project called zebra.

• Quagga provides a Cisco IOS-like interface.

• In this lab we will review RIP and OSPF using Quagga.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 66 / 191

Page 5: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 67 / 191

Page 6: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

IOS fundamentals

Configuration modes

• Two modes:• exec: allows inspecting the router, e.g. show commands.• configuration: allows editing the router configuration.

• In confguration modes you edit the running-config.• To delete commands from running config: preceded by no.• The prompt indicates the mode, e.g. >, #, #(config-if), etc.• Case insensitive.• ? for help.• TAB for command completion.• Allows abbreviated commands as long there is no ambiguity. E.g. sh

for show, or conf term for configure terminal.• Quagga specific: accept address/mask notation, e.g. 10.0.0.1/24.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 68 / 191

Page 7: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 69 / 191

Page 8: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

Quagga set up

Quagga daemons

• zebra: general configuration.• ripd: RIP daemon.• ospfd: OSPF daemon

• Use telnet to connect to the deamons:root@OpenWrt:~# /etc/init.d/quagga startquagga.init: Starting zebra ... done.quagga.init: Starting ripd ... done.quagga.init: Starting ospfd ... done.root@OpenWrt:~# telnet localhost zebraEntering character modeEscape character is ’^]’.Hello, this is Quagga (version 0.99.22.3).Copyright 1996-2005 Kunihiro Ishiguro, et al.User Access VerificationPassword: zebraOpenWrt>OpenWrt> enableOpenWrt# ?clear Reset functionsconfigure Configuration from vty interface

...

Llorenç Cerdà-Alabern Linux Routers and Community Networks 70 / 191

Page 9: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 71 / 191

Page 10: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

Basic commands

Interfaces

• Show Interfaces:OpenWrt# show interfaceInterface br-lan is up, line protocol detection is disabledindex 5 metric 1 mtu 1500flags: <UP,BROADCAST,RUNNING,MULTICAST>HWaddr: 10:fe:ed:af:63:5einet 192.168.5.1/24 broadcast 192.168.5.255inet6 fd20:1d78:f920::1/60inet6 fe80::12fe:edff:feaf:635e/64

Interface dummy0 is downindex 11 metric 1 mtu 1500flags: <BROADCAST,NOARP>HWaddr: 06:31:12:18:c8:5c

• Assign IP address:OpenWrt# conf termOpenWrt(config)# int dummy0OpenWrt(config-if)# ip add 10.0.0.1/24

• Remove IP address:OpenWrt(config-if)# no ip add 10.0.0.1/24

Llorenç Cerdà-Alabern Linux Routers and Community Networks 72 / 191

Page 11: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

Basic commands

Routing table

• Show routing table:OpenWrt# show ip routeCodes: K - kernel route, C - connected, S - static, R - RIP,

O - OSPF, I - IS-IS, B - BGP, H - HSLS, o - OLSR,b - BATMAN, A - Babel,> - selected route, * - FIB route

K>* 0.0.0.0/0 via 192.168.1.1, eth0.2C>* 10.0.0.0/24 is directly connected, dummy0C>* 127.0.0.0/8 is directly connected, loC>* 192.168.1.0/24 is directly connected, eth0.2C>* 192.168.5.0/24 is directly connected, br-lan

• Add route to network 10.0.0.1/24 via gateway 192.168.1.1:OpenWrt# conf termOpenWrt(config-if)# ip route 10.0.0.1/24 192.168.1.1

Llorenç Cerdà-Alabern Linux Routers and Community Networks 73 / 191

Page 12: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

Basic commands

Show current configuration

OpenWrt# show running-configCurrent configuration:!password zebra!interface br-lanipv6 nd suppress-ra

!interface dummy0ipv6 nd suppress-ra

!interface eth0ipv6 nd suppress-ra

!interface eth0.1ipv6 nd suppress-ra

!interface eth0.2ipv6 nd suppress-ra

!interface lo!interface wlan0ipv6 nd suppress-ra

!access-list vty permit 127.0.0.0/8access-list vty deny any!ip forwarding

ipv6 forwarding!!line vtyaccess-class vty

!end

Llorenç Cerdà-Alabern Linux Routers and Community Networks 74 / 191

Page 13: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

Basic commands

Miscelanea

• Avoid expiration of telnet session:OpenWrt# conf termOpenWrt(config)# line vtyOpenWrt(config-line)# exec-timeout 0

• Save current configuration:OpenWrt# writeConfiguration saved to /etc/quagga/zebra.conf

• Change hostname (and prompt):OpenWrt# conf termOpenWrt(config)# hostname R1R1(config)#

Llorenç Cerdà-Alabern Linux Routers and Community Networks 75 / 191

Page 14: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 76 / 191

Page 15: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP review

Routing Information Protocol (RIP)

One of the oldest and more simple routing protocols. In summary, itworks as follows:

• The metric is the number of jumps until the destination: 1 ifthe destination is a network directly connected, 2 if it has to gothrough a router, etc.

• The routers send periodically (each 30 seconds) a broadcastRIP message in each interface with the known destinations andmetrics. Sent with UDP, source and destination port: 520.

• If we stop receiving RIP messages from a neighbour (180seconds), we assume that it is down.

• The metric’s value of infinity is 16.• RIP version 2: The netmask is added to the destinations sent in

the messages. The messages are sent to the multicast address:224.0.0.9 (all RIPv2 routers).

Llorenç Cerdà-Alabern Linux Routers and Community Networks 77 / 191

Page 16: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP review

RIP Convergence Problems

• Depending on the route update message order, convergenceproblems may arise (Count to Infinity):

• Evolution of D=N4 entry when R3 fails:

Llorenç Cerdà-Alabern Linux Routers and Community Networks 78 / 191

Page 17: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP review

Solutions to RIP Convergence Problems

• Split horizon: When the router sends the update, removes theentries having a gateway in the interface where the update issent.

• Triggered updates: Consists of sending the update before the 30seconds timer expires, when a metric changes in the routingtable.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 79 / 191

Page 18: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 80 / 191

Page 19: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP configuration

Network Command

• Set the interfaces that have to send or process RIP updatemessages.

• Set which directly connected networks to advertize.• Quagga implements RIPv2 by default and masks must be

provided to network command.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 81 / 191

Page 20: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP configuration

Route Summarization

• By default, CISCO routers do route summarization. Thesummarization is done at the class boundary. For example, if inthe routing tables we have the subnets 10.0.1.0/24 and10.0.2.0/24, when sending a RIP message to the net192.168.0.0/24 it will be sent 10.0.0.0/8.

• In order for the router to be advertize static routes (including thedefault route): command redistribute static.

• The router uses two metrics: the administrative metric and therouting algorithm metric. If several routes to a same destination exist,the route with the lower administrative metric is chosen. Forexample, RIP has administrative metric 120 and OSPF 110.

R1# sh ip roCodes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,

I - ISIS, B - BGP, > - selected route, * - FIB routeR>* 17.16.4.0/24 [120/2] via 172.16.1.2, e0, 00:00:07...

• Verification command: show ip rip status.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 82 / 191

Page 21: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP configuration

RIP configuration example

root@OpenWrt:~# telnet localhost ripdEntering character modeEscape character is ’^]’.Hello, this is Quagga (version 0.99.22.3).Copyright 1996-2005 Kunihiro Ishiguro, et al.User Access VerificationPassword: zebraOpenWrt> enableOpenWrt# configure terminalOpenWrt> enableOpenWrt(config)# hostname ripdripd(config)# router ripripd(config-router)# redistribute staticripd(config-router)# network 172.16.0.0/24...ripd(config-router)# ^Zripdd# writeConfiguration saved to /etc/quagga/ripd.confripd# show ip rip ?status IP routing protocol process parameters and statistics

Llorenç Cerdà-Alabern Linux Routers and Community Networks 83 / 191

Page 22: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 84 / 191

Page 23: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP Lab setup

Objectives:

• We want to set upthis network.

• Configured usingquagga and RIP.

• Following theguidelines in thenext slides.

10.1.3.0/24

10.1.2.0/24

10.1.1.0/24

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1 .1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

10.2.1.0/24

10.2.2.0/24

10.2.3.0/24

10.3.1.0/24

10.3.2.0/24

10.3.3.0/24

10.4.3.0/24

10.4.2.0/24

10.4.1.0/24

10.5.3.0/24

10.5.2.0/24

10.5.1.0/24

10.6.3.0/24

10.6.2.0/24

10.6.1.0/24

10.7.3.0/24

10.7.2.0/24

10.7.1.0/24

10.8.3.0/24

10.8.2.0/24

10.8.1.0/24

10.9.3.0/24

10.9.2.0/24

10.9.1.0/24

10.10.3.0/24

10.10.2.0/24

10.10.1.0/24192.168.1.0/24

192.168.5.0/24

192.168.4.0/24

192.168.3.0/24

192.168.2.0/24

.1

.2

.3 .3

.4 .4

.5 .5

192.168.6.0/24 192.168.7.0/24.1

200.0.0.0/24

.1

.1 .2

AP ST

AP ST

AP ST

AP ST

.1 .2

.1 .2

.1 .2

.1 .2

ST

AP AP

AP STST ST

ST

ST ST

ST ST

PC3

PC2

PC1

G1

PC3

PC2

PC1

PC3

PC3

PC3

PC2

PC2

PC2

PC1

PC1

PC1

PC3

PC2

PC1

PC3

PC2

PC1

G2

PC3

PC2

PC1

G3

PC3

PC2

PC1

G4

PC3

PC2

PC1

G5 G6

G8

G9

G10

G7

CH1 CH6

CH132

CH100

CH108

CH116

CH124

R1

R2

R10

R9

R3 R8

R4 R7

R5 R6

.2

Internet

Llorenç Cerdà-Alabern Linux Routers and Community Networks 85 / 191

Page 24: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP Lab setup

Preparation

1 Install the packages kmod-dummy, quagga, quagga-ospfd,quagga-ripd and quagga-zebra.

2 Rename the file /etc/quagga/ospfd.conf to avoid starting the ospfddaemon:

~# mv /etc/quagga/ospfd.conf /etc/quagga/ospfd.conf.dst

3 Start quagga deamons (check that ospfd does not start):root@OpenWrt:/etc/quagga# /etc/init.d/quagga startquagga.init: Starting zebra ... done.quagga.init: Starting ripd ... done.root@OpenWrt:/etc/quagga#

4 Have a look to the configuration files: /etc/quagga.

5 Configure the network of figure using quagga.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 86 / 191

Page 25: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

RIP Lab setup

RIP Testing

1 Check the routing tables. Does RIP quagga daemon doroute-summarization?

2 Use traceroute to figure out the path to different destinations.

3 Check the RIP messages sent by the router using tcpdump:~# tcpdump -vni eth0.1 port 520

4 Disable Split Horizon in one interface, and observe the routesthat are advertized by in the update messages.

ripd# conf termripd(config)# int eth0ripd(config-if)# no ip rip split-horizon

5 Disconnect one network and observe the trigger updates andmetric 16.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 87 / 191

Page 26: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 88 / 191

Page 27: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

OSPF review

Open Shortest Path First (OSPF)

• Standardized inside the IETF, aim of having a highperformance protocol.

• Link state protocol: send information on neighbors networksand routers.

• Link State Advertisements, LSA: Send information to all otherrouters using flooding.

• Each router maintains network topology database.• Algorithm Shortest Path First (SPF) to calculate optimal routes.• The metric is dimensionless (does not represent the number of

hops). The infinite metric is 0xFFFF.• A hello protocol to discover neighbors.• OSPF does not carry data via UDP or TCP. Instead, OSPF encapsulates

messages into IP datagrams directly using protocol number 89.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 89 / 191

Page 28: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

OSPF review

OSPF areas

• Designated Router (DR) and a Backup Designated Router(BDR). The DR is the only router in the broadcast domain thatsends LSA.

• Router ID (RID): IP address of the router greatest value ordummy interface.

• Priority for the election of the DR and BDR: highest RID.• Area: increases scalability. All networks inside an area can be

aggregated in a single prefix.• There must be a backbone area 0, to which all other areas are

connected. Area 0 cannot be discontiguous.• Routers can be Internal Routers (IR), if they have all the

interfaces in the same area or Area Border Router (ABR) if theyhave interfaces in more than one area.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 90 / 191

Page 29: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 91 / 191

Page 30: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

OSPF configuration

Commands

• First you should configure an IP dummy interface in order to fixthe RID.

• network command works similarly to RIP, but specifying thearea.

• Area route aggregation is achieved using the range commandin ABR routers.

• Default route is distributed using the commanddefault-information originate.

• Verification commands: show ip ospf ?.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 92 / 191

Page 31: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

OSPF configuration

OSPF configuration example

~# telnet localhost ospfdEntering character modeEscape character is ’^]’.Hello, this is Quagga (version 0.99.22.3).Copyright 1996-2005 Kunihiro Ishiguro, et al.User Access VerificationPassword: zebraOpenWrt> enableOpenWrt# configure terminalOpenWrt(config)# hostname ospfdospfd(config)# router ospfospfd(config-router)# network 10.0.1.0/24 area 0ospfd(config-router)# network ...ospfd(config-router)# area 1 range 172.16.0.0/16ospfd(config-router)# default-information originateospfd(config-router)# ^Zospfdd# writeConfiguration saved to /etc/quagga/ospfd.confospfd# show ip ospf ?border-routers for this areadatabase Database summaryinterface Interface informationneighbor Neighbor listroute OSPF routing table

Llorenç Cerdà-Alabern Linux Routers and Community Networks 93 / 191

Page 32: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part III

Lab 2: RIP and OSPF

Outline

Description

IOS fundamentals

Quagga set up

Basic commands

RIP review

RIP configuration

RIP Lab setup

OSPF review

OSPF configuration

OSPF Lab setup

Llorenç Cerdà-Alabern Linux Routers and Community Networks 94 / 191

Page 33: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

OSPF Lab setup

Objectives:

• We want to set upthis network.

• Configured usingquagga and OSPF.

• Following theguidelines in thenext slides.

.2

.2

.2

.2

.2

.2

.2

.2

.2

.2

.2

.2

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.1

.1

.2

.2

.2

.1

.2

.3 .3

.4 .4

.5 .5

200.0.0.0/24

.1

.129

.65.1

.129

.65.1

172.16.3.0/24

172.16.2.0/24

172.16.1.0/24

.1

.1.1

172.16.4.0/24

172.16.7.0/24

172.16.6.0/24

172.16.5.0/24

172.17.3.0/24

172.17.2.0/24

172.17.1.0/24172.17.4.0/24

172.17.7.0/24

172.17.6.0/24

172.17.5.0/24

.1

.1.1

172.18.3.0/24

172.18.2.0/24

172.18.1.0/24

172.18.7.0/24

172.18.6.0/24

172.18.5.0/24172.18.4.0/24

172.19.4.0/24

172.19.3.0/24

172.19.2.0/24

172.19.1.0/24

172.19.7.0/24

172.19.6.0/24

172.19.5.0/24

.1

.1.1

172.20.3.0/24

172.20.2.0/24

172.20.1.0/24

172.20.7.0/24

172.20.6.0/24

172.20.5.0/24172.20.4.0/24

.110.0.1.0/24 10.0.2.0/24

area 1

area 2

area 3

area 4

area 5

dummy0 of router i:192.168.0.i/32

10.0.3.0/24area 0

AP ST

AP ST

AP ST

AP ST

ST

AP AP

AP STST ST

ST

ST ST

ST ST

.2.1

.2.1

.2.1

.2.1

.2.1

PC3

PC2

PC1

G1

PC3

PC2

PC1

PC3

PC3

PC3

PC2

PC2

PC2

PC1

PC1

PC1

PC3

PC2

PC1

PC3

PC2

PC1

G2

PC3

PC2

PC1

G3

PC3

PC2

PC1

G4

PC3

PC2

PC1

G5 G6

G8

G9

G10

G7

CH1 CH6

CH124

R1

R2

R10

R9

R3 R8

R4 R7

R5 R6

.2

Internet

CH100

CH108

CH132

CH116

Llorenç Cerdà-Alabern Linux Routers and Community Networks 95 / 191

Page 34: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

OSPF Lab setup

Network Configuration

1 Reboot the routers to clean the configuration of RIP Lab.

2 Rename the desired daemons to start:~# mv /etc/quagga/ripd.conf /etc/quagga/ripd.conf.dst~# mv /etc/quagga/ospfd.conf.dst /etc/quagga/ospfd.conf

3 Start quagga deamons (check that ripd does not start):root@OpenWrt:/etc/quagga# /etc/init.d/quagga startquagga.init: Starting zebra ... done.quagga.init: Starting ospfd ... done.root@OpenWrt:/etc/quagga#

4 Have a look to the configuration files: /etc/quagga.

5 Assign IP addresses to interfaces using zebra daemon.

6 Configure OSPF using ospfd daemon.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 96 / 191

Page 35: Linux Routers and Community Networks

Lab 2: RIP andOSPF

Description

IOSfundamentals

Quagga set up

Basiccommands

RIP review

RIPconfiguration

RIP Lab setup

OSPF review

OSPFconfiguration

OSPF Labsetup

Lab 2: RIP and OSPF

OSPF Lab setup

OSPF Testing

1 Check the routing tables.

2 Check the routing metrics.

3 Use traceroute to figure out the path to different destinations.

4 Activate area range aggregation and check routing table entries.

5 Capture OSPF messages sent by the router using tcpdump:~# tcpdump -vni eth0.1 proto 89

6 Disconnect one network and observe the LSA messagescaptured with tcpdump, and the changes in the routing tables.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 97 / 191