Installing Zebra/Quagga and playing with routing protocols

maidtweetNetworking and Communications

Oct 29, 2013 (3 years and 9 months ago)

85 views


1

Installing Zebra/Quagga and playing with routing protocols
................................
................................
....

1

What is Zebra?

................................
................................
................................
................................
......

1

What is Quagga?

................................
................................
................................
................................
...

1

Lab description

................................
................................
................................
................................
......

1

Installing Zebra/Quagga

................................
................................
................................
........................

2

Basic Zebra configuration

................................
................................
................................
.....................

2

Peer lab configuration

................................
................................
................................
...........................

3

Setting up the interfaces with Zebra
................................
................................
................................
......

5

Setting up RIP routing with Zebra

................................
................................
................................
........

6

Setting up RIP routing on the P02 routers
................................
................................
.............................

8

Propagated rou
tes with RIP
................................
................................
................................
...............

9

Failover test

................................
................................
................................
................................
.......

9

Basic lab configuration
................................
................................
................................
........................

10

Annexe
s

................................
................................
................................
................................
...................

12

Le débuggage

de Quagga

................................
................................
................................
....................

13

RIP Debug Commands
................................
................................
................................
....................

13

IP Access L
ist

................................
................................
................................
................................
......

13

Configuring and using MRLG

................................
................................
................................
............

13

What can you do with an encrypted Cisco router password ?

................................
............................

15

Cisco
-

Password Recovery Procedure
................................
................................
................................

16

TCPDUMP man page
................................
................................
................................
..........................

16

TCPDUMP examples

................................
................................
................................
..........................

16

Setting up OSPF routing with Zebra

................................
................................
................................
...

18

Installing Zebra/Quagga and playing with routing protocols


The intent of this lab is to become familiar with standard routing protocols

and to understand the
content of a simple router configuration file.


What is Zebra?

Zebra is TCP/IP routing software that supports BGP
-
4, BGP
-
4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and
RIPng. It is distributed under the GNU General Public License and runs on
Linux as well as other
UNIX variants.

Alternate software
like

gated or routed
will
not
be
covered by this lab.


What is

Quagga?

It’s a fork of Zebra. So, when Zebra or Quagga is written below, please understand Quagga.


Lab description

Our test platform fo
r Zebra is
your official Dell configuration including two NICs

:



an additional 3Com


aka eth1 with 3c59x module



and a motherboard built
-
in Intel

aka eth0 with e1000 module


in addition to a set of switches
(3Com SuperstakII 16465A)
and routers
(Cisco Cat
alyst 4000)
managed by

the
lab
instructor.


Note: An additional virtual NIC will be created during the lab using the so
-
called “dummy interface”.


2





Installing Zebra/Quagga

Before proceeding with the Zebra installation, we made sure that both network card
s were recognized
by Linux and were confirmed to be working.


An RPM for Zebra/Quagga already ships with your release (like
quagga
-
0.96.5
-
1.i386.rpm
) but
check
with the instructor and
make sure you use the latest one for installation. The Zebra
/Quagga

RPM
installs binaries, scripts, and configuration files as well as the requisite manuals, examples, and
documentation files.


Basic Zebra configuration

The zebra daemon is the actual routing manager that controls the other modules; it also provides the
primary

point of interaction with the user. This was the first thing we needed to configure, and we did it
through the
/etc/
quagga
/zebra.conf

file.

The Zebra RPM package includes a complete sample configuration file. However, at a minimum, we
really only needed t
o create a
/etc/quagga/zebra.conf

file containing the following lines:

Listing 1. A minimal Zebra configuration file


hostname speedmetal

password zebra

enable password zebra

The
hostname

directive specifies the name of the router whenever you enter inter
active configuration
mode. It can be any label and does not necessarily have to correspond to the hostname of the machine.

Speedmetal is the nickname of P01 aka s551p01.unice.fr.

The
password

directive specifies the password for logging into the interactiv
e Zebra terminal.

The
enable password

directive specifies the password for a higher level of access to Zebra, when you
want to make configuration changes.

Having created the /etc/quagga/zebra.conf file, we could now start the zebra daemon by executing:

# s
ervice zebra start


Look at the /etc/services for zebra’s port and use one of the following commands

# netstat

an |grep 2601

or


# lsof

in | grep zebra



3

We were now able to enter the Zebra interactive session by telnetting into port 2601 of our machine
.

Listing 2. A sample Zebra session


[root@speedmetal zebra]# telnet 127.0.0.1 2601

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.


Hello, this is zebra (version 0.93b).

Copyright 1996
-
2002 Kunihiro Ishiguro.


User Access Verificatio
n


Password: zebra

speedmetal> enable

Password: zebra

speedmetal# ?


configure Configuration from vty interface


copy Copy configuration


debug Debugging functions (see also 'undebug')


disable Turn off privileged mode command


end

End current mode and change to enable mode.


exit Exit current mode and down to previous mode


help Description of the interactive help system


list Print command list


no Negate a command or set its defaults


quit E
xit current mode and down to previous mode


show Show running system information


terminal Set terminal line parameters


who Display who is on vty


write Write running configuration to memory, network, or terminal

speedmetal#

Get f
amiliar with the Command Line Interface (CLI).

Navigating within the interactive terminal is easy. For hints about the available commands, you can
press
?

at any time and the options will show on screen. If you're setting up your own Zebra router, this
con
figuration should be very familiar if you have Cisco experience. If needed, a
sk for instructor about
your “question
-
mark” friend
use when entering new commands.

At this point, only Zebra was configured and running; none of the other protocols were, as yet.

Later,
when we get to the meat of the configuration, we'll show you how we did that.

Peer

lab configuration

Our lab configuration consisted of two routers and your machine. The two routers communicated with
each other via a crossover RJ45 connection, and
each router connected to your machine through
Ethernet. This is shown in our connection diagram:

Figure 2. Peer Lab
logical
connection diagram

for user groups 1, 2 and 3


4


Figure 2bis. Peer Lab connection diagram showing your

machines for user groups 4, 5 and 6


Note: eth1 of P02 is linked to eth0 of P03 with a cross
-
over cable. Eth0 of P01 and eth0 of P02 are
connected to the 134.59.0.0/16 LAN of the infrastructure. Eth1 of P01 and eth1 of P03 a
re connected to
the independent 3Com switch.

Dummy interfaces are also configured on P02 and P03 with a .1 IP
address.



5

Setting up the interfaces with Zebra

Our first
steps

into routing with Zebra started with
RIP
. We installed Zebra on the
Dell P01

as
des
cribed above

(and others…)
. Since we needed another network interface on the
Dell
, we installed a
dummy network device like so:

# modprobe dummy

# ifconfig dummy0
10.0.x.1/24


w
ith
x==1
on P01
.

We telnetted into the Zebra port to begin configuration. Our d
ialog with Zebra followed this sequence:

Listing 3. Configuring IP interfaces


User Access Verification


Password: zebra

speedmetal> enable

Password: zebra

speedmetal# configure terminal

speedmetal(config)# interface
eth0

speedmetal(config
-
if)# ip address
134.59.27
.
1
/
27

speedmetal(config
-
if)# quit

speedmetal(config)# interface
eth1

speedmetal(config
-
if)# ip address 192.168.
0
.
1
/
24

speedmetal(config
-
if)# quit

speedmetal(config)# interface
dummy0

speedmetal(config
-
if)# ip address 10.0.
1
.1/24

speedmetal(config
-
if)# write

Configuration saved to /etc/
quagg
a/zebra.conf

speedmetal(config
-
if)# end

speedmetal# show run



Current configuration:

!

hostname speedmetal

password zebra

enable password zebra

!

interface lo

!

interface eth0


ip address
134.59.27
.
1
/
27

!

interf
ace dummy0


ip address
10.0.
1
.1/24

!

interface eth1


ip address
192.168.
0
.
1
/
24

!

!

line vty

!

end

Take note that we did not set the IP addresses on the
Dell

using the ordinary means; instead, we
configured them through Zebra. The settings are kept in the
configuration file, /etc/
quagga
/zebra.conf,
so every time the Zebra service starts up, these settings will take effect.


6

The contents of our zebra.conf file, as modified by Zebra, are:

Listing 4. /etc/zebra/zebra.conf, as modified by Zebra


!

! Zebra config
uration saved from vty

! 2003/08/20 00:07:51

!

hostname speedmetal

password zebra

enable password zebra

!

interface lo

!

interface eth0


ip address
134.59.27
.
1
/
27

!

interface dummy0


ip address
10.0.
1
.1/24

!

interface eth1


ip address
192.168.
0
.
1
/
24

!

!

line vty

!

We are also able to check the status of the interfaces using MRLG (see end of this document) by
selecting the default, "router1," choosing the radio button "show interface," and clicking "Execute."

Setting up RIP routing with Zebra

Now that we
had set up the network interfaces on our Dell/router, we configured it to work with RIP
updates. As we've already mentioned, Zebra implements the routing protocols using separate daemons,
so we first had to create a simple configuration file,
ripd.conf
, fo
r the RIP daemon in /etc/quagga.

Listing 5. A basic /etc/zebra/ripd.conf file


hostname speedmetal
-
rip

password zebra

enable password zebra

Then we started the ripd daemon:

# service ripd start

That done, we were able to configure the RIP daemon by telnet
ting into port 2602 of our Zebra router.

Listing 6. Configuring RIP


User Access Verification


Password: zebra

speedmetal
-
rip> enable

Password: zebra


7

speedmetal
-
rip# configure terminal

speedmetal
-
rip(config)# router rip

speedmetal
-
rip(config
-
router)# netwo
rk 10.0.0.0/8

speedmetal
-
rip(config
-
router)# network 192.168.0.0/16

speedmetal
-
rip(config
-
router)# end

speedmetal
-
rip# show run


Current configuration:

!

hostname speedmetal
-
rip

password zebra

enable password zebra

!

interface lo

!

interface eth0

!

interfa
ce dummy0

!

router rip


network
1
0.0.0.0/
8


network 192.168.0.0/16

!

line vty

!

end

speedmetal
-
rip# write

Configuration saved to /etc/
quagg
a
/ripd.conf

speedmetal
-
rip#

The resulting ripd.conf configuration file is:

Listing 7. Resulting /etc/
quagga
/ripd.con
f file


!

! Zebra configuration saved from vty

! 2003/08/19 13:50:30

!

hostname speedmetal
-
rip

password zebra

enable password zebra

!

interface lo

!

interface eth0

!

interface eth1

!

interface dummy0

!

router rip


network 10.0.0.0/8


network 192.168.0.0/
16

!

line vty

!


8

Setting up RIP routing on the
P02

routers

To facilitate configuration of the two other routers, which we named "P02" and "P03," we configured
only the basic settings needed to make the routers run properly. This included setting up the int
erface
IP addresses, the loopback address.

Listing 8. Configuring router
P02


Router#config terminal

Router(config)#hostname
P02

P02
(config)#int
eth0

P02
(config
-
if)#ip address
134.59.27
.
2

255.255.255.224

P02
(config
-
if)#no shut

P02
(config
-
if)# interface
eth
1

P02
(config
-
if)#ip address 1
72
.16.
0
.
2

255.255.255.
0

P02
(config
-
if)#no shut

P02
(config
-
if)#int
dummy
0

P02
(config
-
if)#ip address 10.0.
2
.1 255.255.255.0

P02
(config
-
if)#end

P02
#write

We followed a similar procedure for router P03.

Listing 9. Configuring rout
er P03


Router#config terminal

Router(config)#hostname
P03

P03
(config)#int
eth0

P03
(config
-
if)#ip address
172.16.0
.
3

255.255.255.
0

P03
(config
-
if)#no shut

P03
(config
-
if)# interface
eth1

P03
(config
-
if)#ip address
192.168
.
0
.
3

255.255.255.
0

P03
(config
-
if)#no s
hut

P03
(config
-
if)#int
dummy
0

P03
(config
-
if)#ip address 10.0.
3
.1 255.255.255.0

P03
(config
-
if)#end

P03
#write

Setting up RIP on the other routers is very similar to the commands in Zebra. We accessed both of the
other routers and issued the following comman
ds:

Listing 10. Configuring router
P02

for RIP


P02
#conf t

Enter configuration commands, one per line. End with CNTL/Z.

P02
(config)#router rip

P02
(config
-
router)#network 10.0.
2
.0

P02
(config
-
router)#network 1
72.16
.0.0

P02
(config
-
router)#network
134.59
.2
7
.0

P02
(config
-
router)#version 2

P02
(config
-
router)#end

P02
#write

And, on router P03
:


9

Listing 11. Configuring router
P03

for RIP


P03
#conf t

Enter configuration commands, one per line. End with CNTL/Z.

P03
(config)#router rip

P03
(config
-
router)#network 10.0.
3
.
0

P03
(config
-
router)#network 1
72.16
.0.0

P03
(config
-
router)#network 192.168.
0
.0

P03
(config
-
router)#version 2

P03
(config
-
router)#end

P03
#write

The
router rip

command turns on the RIP process. The
network

command tells the router which
networks will be propa
gated by RIP.

Propagated routes with RIP

Now that the
other

routers and Zebra were all configured, we checked that th
e routes were being
propagated using the
"show ip route"

and
“show ip protocols”

command.


Write down what your router answers. Use Etherea
l to look for RIP packets and analyse them.

Here is an example of
generated the following report:

Listing 12. Zebra reflecting RIP routes


Codes: K
-

kernel route, C
-

connected, S
-

static, R
-

RIP, O
-

OSPF,


B
-

BGP, >
-

selected route, *
-

FIB ro
ute


R>* 10.0.0.0/24 [120/2] via 192.168.2.2, eth0, 00:11:05

R>* 10.0.1.0/24 [120/2] via 192.168.1.2, eth1, 00:02:08

C>* 10.0.2.0/24 is directly connected, dummy0

K * 127.0.0.0/8 is directly connected, lo

C>* 127.0.0.0/8 is directly connected, lo

R>* 192.1
68.0.0/30 [120/2] via 192.168.2.2, eth0, 00:11:05

C>* 192.168.1.0/30 is directly connected, eth1

C>* 192.168.2.0/30 is directly connected, eth0

The routes learned through RIP are marked with an R.


Failover test

To test for

route failover, we disconnect

t
he network connection from router
P02
, which led to network
10.0.
2
.0/24. After a total timeout of about two minutes, Zebra
should learn

about the alternate route to
network 10.0.
2
.0/24, going through router
P03
.
Write down the modifications
in the
new
list
ing
returned by the
"show ip route"

command.

Why was the total timeout more than two minutes? The default timeout for RIP is 30 seconds, but the
RIP protocol specifies three retries (total of 90 seconds) before it determines a route is invalid and
another
period for flushing the invalid route (another 240 seconds). RIP has generally been known to
be slow to responding to connection failures, and this behavior is clearly demonstrated here.


10

Basic

lab configuration


Figure 3. Basic Lab connection diagram

for u
ser groups 1, 2 and 3



Figure 3
bis. Peer Lab connection diagram showing your machines for user groups 1, 2 and 3


11


Setting up the interfaces with Zebra

We installed Zebra on the Dell P01 as des
cribed above (and others…) and also Dell P02, Dell P03.
Since we needed another network interface on the Dell, we installed a dummy network device

We telnetted into the Zebra port to begin configuration. Our dialog with Zebra followed this sequence:

Listi
ng

13
. Configuring IP interfaces

on P01


User Access Verification


Password: zebra

speedmetal> enable

Password: zebra

speedmetal# configure terminal

speedmetal(config)# interface
eth0

speedmetal(config
-
if)# ip address
134.59.27
.
1
/
27

speedmetal(config
-
if)#
no ip split
-
horizon

speedmetal(config
-
if)# quit

speedmetal(config)# interface
eth1

speedmetal(config
-
if)# ip address 192.168.
0
.
1
/
24

speedmetal(config
-
if)#
no ip split
-
horizon

speedmetal(config
-
if)# quit

speedmetal(config)# interface
dummy0

speedmetal(confi
g
-
if)# ip address 10.0.
1
.1/24

speedmetal(config
-
if)# write

Configuration saved to /etc/
quagg
a/zebra.conf

speedmetal(config
-
if)# end




Listing

1
4
. Configuring IP interfaces

on P02


User Access Verification


12


Password: zebra

speedmetal> enable

Password: zeb
ra

speedmetal# configure terminal

speedmetal(config)# interface
eth0

speedmetal(config
-
if)# ip address
134.59.27
.
2
/
27

speedmetal(config
-
if)#
no ip split
-
horizon

speedmetal(config
-
if)# quit

speedmetal(config)# interface
eth1

speedmetal(config
-
if)#
shutdown

speedmetal(config
-
if)# quit

speedmetal(config)# interface
dummy0

speedmetal(config
-
if)# ip address 10.0.
2
.1/24

speedmetal(config
-
if)# write

Configuration saved to /etc/
quagg
a/zebra.conf

speedmetal(config
-
if)# end




Listing

1
5
. Configuring IP interfaces

o
n P03


User Access Verification


Password: zebra

speedmetal> enable

Password: zebra

speedmetal# configure terminal

speedmetal(config)# interface
eth0

speedmetal(config
-
if)#
shutdown

speedmetal(config
-
if)# quit

speedmetal(config)# interface
eth1

speedmetal(
config
-
if)# ip address 192.168.
0
.
3
/
24

speedmetal(config
-
if)#
no ip split
-
horizon

speedmetal(config
-
if)# quit

speedmetal(config)# interface
dummy0

speedmetal(config
-
if)# ip address 10.0.
3
.1/24

speedmetal(config
-
if)# write

Configuration saved to /etc/
quagg
a/
zebra.conf

speedmetal(config
-
if)# end




Listing
1
6. Configuring RIP

on P01


User Access Verification


Password: zebra

speedmetal
-
rip> enable

Password: zebra

speedmetal
-
rip# configure terminal

speedmetal
-
rip(config)# router rip

speedmetal
-
rip(config
-
route
r)# network 10.0.0.0/8

speedmetal
-
rip(config
-
router)# end

speedmetal
-
rip#



Shutdown interface eth0 on P02 and look at the routes shown on P01 and P02 concerning 10.0.2.0/24.
Explain what you saw.


13

Annexes

Le débuggage

de Quagga

show interface

:
montre

l’
état de l’interface.


show ipforward

:
montre si l’IPforwarding est activé ou désactivé sur la machine
.



s
how ip protocole

: montre les protocoles de routages actifs et leur configuration.
Il permet de voir les routeurs avec lesquels il y a échanges de ta
bles.



s
how ip route

: montre l’état de l’apprentissage des routes par le routeur. (routes
statiques, routes dynamiques, réseaux directement connectés)



d
ebug ip rip


: pour débugger RIP



bandwidth <1
-
10000000
>



Interface Command

no bandwidth <1
-
10000
000>



Interface Command

Set bandwidth value of the interface in kilobits/sec. This is for calculating OSPF

cost. This command
does not affect the actual device configuration.


RIP Debug Commands

Debug for RIP protocol.


debug rip events




Debug rip even
ts.

debug rip
will show RIP events. Sending and receiving packets, timers, and changes in interfaces are
events shown with
ripd
.

debug rip packet

Debug rip packet.

debug rip packet
will display detailed information about the RIP packets. The origin and po
rt number of
the packet as well as a packet dump is shown.

debug rip zebra

Debug rip between zebra communication.

This command will show the communication between
ripd
and
zebra
. The main information

will include
addition and deletion of paths to the kern
el and the sending and

receiving of interface information.

show debugging rip

Display
ripd
’s debugging option.

show debugging rip
will show all information currently set for ripd debug.


IP Access List

access
-
list
name
permit
ipv4
-
network

access
-
list
nam
e
deny
ipv4
-
network


Configuring and using MRLG

The Multi
-
Router Looking Glass, or MRLG, written by John Frazier of EnterZone, is a Web
-
based

14

utility that can be used to display the interfaces and routes recognized by Zebra. MRLG is really
nothing more tha
n a Web interface to the Zebra shell with a limited set of commands, but in the course
of our testing, we found it to be a quick and useful way to display routes. So, before getting to the
configuration of the Zebra protocols, we'll show you how we install
ed it.

MRLG requires the
Net::Telnet

Perl package so that it can communicate with the Zebra shell.
Unfortunately, this package is not included as part of the stock Red Hat 9 distribution, so we had to
download it (see
Resources

for a link).

Since MRLG runs as a CGI application, we also needed to install a Web server. If you're trying this
yourself, you can use the stock httpd RPM that comes with Red
Hat 9.

We copied the mrlg.cgi file from /usr/share/doc/zebra
-
0.93b/tools to /var/www/cgi
-
bin. Then, we
modified line 36 of mrlg.cgi, changing it from:

$url="http://www.sample.com/mrlg.cgi";

to:

$url="http://127.0.0.1/cgi
-
bin/mrlg.cgi";

We also modified the

block from lines 168 to 174 so that it read as follows:


if ($Form{'router'} eq 'router1')


{

$server = '127.0.0.1';

$login_pass = 'zebra';

$bgpd = "2605";

$zebra = "2601";

$full_tables=1;

To access MRLG, point the browser to http://127.0.0.1/cgi
-
bin/mrlg.cgi.


15

Figure 1. The Multi
-
Router Looking Glass




What can you do with an encrypted Cisco router password ?


Some helpful
links for decoding:

http://users.skynet.be/glu/ciscopw.htm

http://www.kazmier.com/computer/cisco
-
apps.html

http://download.boson.com/utils/bos pass.exe

http://www.solarwinds.net/T00Is/Profes
sional/Categories/Cisco Networks.htm#Decrvpt

More info:

"Passwords and privileges commands"

http://'www.cisco.com/univercd/ cc/td/doç/product/sofuvare/ios 120/ 12cgcr/ secur r/ srprt5/srpas s.htm


16

"Configuring passwords and privileges"

http://www.cisco.com
/univercd/cc/td/ doc/product/ software/ios 120/ 12cgcr/ secur
c/scprt5/scpa ss.htm

"Configuring Terminal Access Security"

http:/ /www .cisco.com/univercd/cc/tc/doc/product/software/ios 112/l12cg_
cr/2cbook/2cauthen .htm#xtocid2183020


"Multiple Levels of
Privileges Examples"
http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed
cr/secu_c/scprt5 /scpasswd.htm

# 37123


Cis
co
-

Password Recovery Procedure

for the Cisco 2000, 2500, 3000,
4000
, AccessPro, 7000 (RP), AGS, IGS, STS
-
10x



http://www.cisco.com/warp/public/474/pswdrec_2500.html


TCPDUMP man p
age

http://www.ethereal.com/docs/man
-
pages/tcpdump.8.html

TCPDUMP examples

Displaying all packets from SSH connections

# tcpdump dst port 22

Displaying all except SSH connections

#
tcpdump not port 22

Listening on interface eth1, not converting addresses

to names, without a timestamp on
each dump line, snarfing 0 bytes of data from each packet rather than the default of 68
,
transfer direction source
from

host 100.0.0.1



# tcpdump
-
i eth1
-
nt
-
s 0 src host 100.0.0.1


17


18

Setting up OSPF routing with Zebra

Having done RIP, we moved on to OSPF routing. Although OSPF and RIP can be used
together, we preferred to work with a simpler configuration and used OSPF exclusively.
To disable RIP from Zebra, we simply shut down the ripd service.

# service ripd stop

As b
efore, we started with a basic configuration file for OSPF, in this case, ospfd.conf,
still in /etc/zebra.

Listing 16. A basic /etc/zebra/ospfd.conf file


hostname speedmetal
-
ospf

password zebra

enable password zebra

Then, we started the OSPF service:

# s
ervice ospfd start

Configuring OSPF is actually simpler than configuring RIP: at the most basic, we only
need to tell OSPF to broadcast all the routes it knows.

The port for OSPF configuration is 2604.

Here was our dialog for OSPF configuration.

Listing 17
. OSPF configuration dialog


[root@speedmetal zebra]# telnet 127.0.0.1 2604

User Access Verification


Password: zebra

speedmetal
-
ospf> enable

Password: zebra

speedmetal
-
ospf# configure terminal

speedmetal
-
ospf(config)# router ospf

speedmetal
-
ospf(config
-
ro
uter)# network 0.0.0.0/0 area 0

speedmetal
-
ospf(config
-
router)# end

speedmetal
-
ospf# write

Configuration saved to /etc/zebra/ospfd.conf

speedmetal
-
ospf# show run



Current configuration:

!

hostname speedmetal
-
ospf

password zebra

enable password zebra


19

!

!

r
outer ospf


network 0.0.0.0/0 area 0

!

line vty

!

end

speedmetal
-
ospf#

The resulting configuration file,
ospfd.conf
, was:

Listing 18. /etc/zebra/ospfd.conf as modified by Zebra


!

! Zebra configuration saved from vty

! 2003/08/19 14:22:17

!

hostname spe
edmetal
-
ospf

password zebra

enable password zebra

!

!

!

interface lo

!

interface eth0

!

interface eth1

!

interface dummy0

!

router ospf


network 0.0.0.0/0 area 0

!

line vty

!

Setting up OSPF on the Cisco routers

To remove RIP from the routers and add OSPF
, we executed the following commands:

Listing 19. Removing RIP and adding OSPF


RouterA#conf term

RouterA(config)no router rip

RouterA(config)#router ospf 100

RouterA(config
-
router)#network 0.0.0.0 255.255.255.255 area 0

RouterA(config
-
router)end

We perfo
rmed the same steps for both router A and router B.


20

Propagated routes with OSPF

Our MRLG report looked like this:

Listing 20. Zebra reflecting OSPF routes


Codes: K
-

kernel route, C
-

connected, S
-

static, R
-

RIP, O
-

OSPF,


B
-

BGP, >
-

selected
route, *
-

FIB route


O>* 10.0.0.0/32 [110/11] via 192.168.2.2, eth0, 00:00:01

O>* 10.0.1.1/32 [110/11] via 192.168.1.2, eth1, 00:02:53

O 10.0.2.0/24 [110/10] is directly connected, dummy0, 00:03:31

C>* 10.0.2.0/24 is directly connected, dummy0

K * 127.0
.0.0/8 is directly connected, lo

C>* 127.0.0.0/8 is directly connected, lo

O>* 192.168.0.0/30 [110/58] via 192.168.2.2, eth0, 00:00:01


via 192.168.1.2, eth1, 00:00:01

O 192.168.1.0/30 [110/10] is directly connected, eth1, 00:0
3:21

C>* 192.168.1.0/30 is directly connected, eth1

O 192.168.2.0/30 [110/10] is directly connected, eth0, 00:03:31

C>* 192.168.2.0/30 is directly connected, eth0

Note that the routes to 10.0.0.1/32 and 10.0.1.1/32 are marked with O, indicating that
the
y were learned through OSPF.

When we disconnected the connection from the Zebra router to router A, the routes were
automatically updated. MRLG reported the following:

Listing 21. Zebra reflecting OSPF routes after failover


Codes: K
-

kernel route, C
-

co
nnected, S
-

static, R
-

RIP, O
-

OSPF,


B
-

BGP, >
-

selected route, *
-

FIB route


O>* 10.0.0.1/32 [110/59] via 192.168.2.2, eth0, 00:01:10

O>* 10.0.1.1/32 [110/11] via 192.168.1.2, eth1, 00:09:46

O 10.0.2.0/24 [110/10] is directly connected, dum
my0, 00:10:24

C>* 10.0.2.0/24 is directly connected, dummy0

K * 127.0.0.0/8 is directly connected, lo

C>* 127.0.0.0/8 is directly connected, lo

O>* 192.168.0.0/30 [110/58] via 192.168.1.2, eth1, 00:01:10

O 192.168.1.0/30 [110/10[ is directly connected, e
th1, 00:10:14

C>* 192.168.1.0/30 is directly connected, eth1

O 192.168.2.0/30 [110/10] is directly connected, eth0, 00:10:24

C>* 192.168.2.0/30 is directly connected, eth0

Due to the link
-
state nature of OSPF, failover was much faster: the new routes we
re
propagated in under 30 seconds.