Running OSPF on your Ubuntu Server……

I was wondering if there was a possibility to this.  I really do not see much of a reason for other than the neatness factor.  I was looking over some old RIP information and seeing that version 1 would run on some older windows server 2000 machines I wondered if it were possible to pass OSPF routes to a Linux based server.  There is a Program called Quagga which will emulate almost a stripped down looking IOS as a Daemon within Linux.  Neat stuff!   You can run OSPFv2, OSPFv3, RIP , BGP and RIPng.  So if I wanted a more specific route through OSPF rather than having a default route on my servers it is possible.  Of if I wanted to have some sort of secondary process of OSPF on my cores or routers only to do the routing on my servers it would be possible.  So heres a step by step way I configured it just to test.

First install Quagga

apt-get install quagga

Next specify which of the routing protocols you want to use for Qugga
In this case this post is dedicated towards OSPF. But theres all sorts of
flexibility here

burnyd@dynamips:~$ cat /etc/quagga/daemons
# This file tells the quagga package which daemons to start.
#
# Entries are in the format: <daemon>=(yes|no|priority)
# 0, “no” = disabled
# 1, “yes” = highest priority
# 2 .. 10 = lower priorities
# Read /usr/share/doc/quagga/README.Debian for details.
#
# Sample configurations for these daemons can be found in
# /usr/share/doc/quagga/examples/.
#
# ATTENTION:
#
# When activation a daemon at the first time, a config file, even if it is
# empty, has to be present *and* be owned by the user and group “quagga”, else
# the daemon will not be started by /etc/init.d/quagga. The permissions should
# be u=rw,g=r,o=.
# When using “vtysh” such a config file is also needed. It should be owned by
# group “quaggavty” and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
#
zebra=yes
bgpd=no
ospfd=no
ospf6d=no
ripd=no
ripngd=no
isisd=no

change this to

zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no

I would recommend restarting Quagga just in case.

burnyd@dynamips:~$ sudo /etc/init.d/quagga restart

Now copy the “sample Daemons” and put then in /etc/quagga Depending on what Distro these could be located in other places but since this is Ubuntu 11.04 it is located in the following..

/usr/share/doc/quagga/examples/zebra.conf.sample

We need to take zebra.conf.sample and ospfd.conf.sample and move them into the path of /etc/quagga

burnyd@dynamips:~$ sudo cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf
burnyd@dynamips:~$ sudo cp /usr/share/doc/quagga/examples/ospfd.conf.sample /etc/quagga/ospfd.conf

then add permissions.

burnyd@dynamips:~$ sudo chmod 770 /etc/quagga/zebra.conf

burnyd@dynamips:~$ sudo chmod 770 /etc/quagga/ospfd.conf

Next make sure to forward traffic from Quagga over your ethernet device, otherwise this will not work!

sudo su -c “echo 1 > /proc/sys/net/ipv4/ip_forward”

restart Quagga again..

Next go ahead and telnet to your local host on port 2064.  I cannot recall what the default password is since I changed it.  But it should be located within /etc/quagga/ospfd.conf where you can change it with a file editor.

burnyd@dynamips:~$ telnet localhost

Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.

Hello, this is Quagga (version 0.99.17).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

User Access Verification

Password:
ospfd> en
ospfd#

At this point this looks like a stripped down IOS for the most part. I have Eth0 at 192.168.2.211 on my data network / vlan. I am running OSPF on that interface on a few of my devices here both on my core switch and my Wanrouter. So those used to OSPF I have to advertise Eth0 to OSPF.

I first have to specify the interface I want to run OSPF over

ospfd(config)# int eth0
ospfd(config-if)# ospf network broadcast

then specify my ospf options.

ospfd# conf t
ospfd(config)#router ospf
ospfd(config-router)#network 192.168.2.0/24 area 0.0.0.0

So I go ahead and check my regular routing table on dynamips box and….

burnyd@dynamips:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.17.245 192.168.2.253 255.255.255.255 UGH 0 0 0 eth0
2.2.2.2 192.168.2.253 255.255.255.255 UGH 0 0 0 eth0
1.1.1.1 192.168.2.254 255.255.255.255 UGH 0 0 0 eth0
192.168.7.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
192.168.6.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
192.168.4.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
192.168.3.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
10.10.1.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
192.168.9.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
192.168.8.0 192.168.2.254 255.255.255.0 UG 0 0 0 eth0
0.0.0.0 192.168.2.254 0.0.0.0 UG 0 0 0 eth0
burnyd@dynamips:~$

ospfd# sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL
2.2.2.2 1 Full/Backup 33.075s 192.168.2.253 eth0:192.168.2.211 0 0 0
1.1.1.1 1 Full/DR 38.384s 192.168.2.254 eth0:192.168.2.211 0 0 0

On my Core switch and wan router..

WANROUTER#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DR 00:00:36 192.168.4.254 Vlan4
1.1.1.1 1 FULL/DR 00:00:30 192.168.3.254 Vlan3
1.1.1.1 1 FULL/DR 00:00:36 192.168.2.254 Vlan2
192.168.2.211 1 FULL/DROTHER 00:00:31 192.168.2.211 Vlan2

cs1#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/BDR 00:00:30 192.168.4.253 Vlan4
2.2.2.2 1 FULL/BDR 00:00:31 192.168.3.253 Vlan3
2.2.2.2 1 FULL/BDR 00:00:37 192.168.2.253 Vlan2
192.168.2.211 1 FULL/DROTHER 00:00:31 192.168.2.211 Vlan2

Advertisements
Post a comment or leave a trackback: Trackback URL.

Comments

  • Rizki Satya Utami  On May 17, 2013 at 7:33 am

    Thank you so much for this. helps me on my project 😀

  • telnet redhat linux tutorial  On May 18, 2014 at 9:21 am

    Heya i am for the first time here. I found this board and I find It truly
    useful & it helped me out a lot. I hope to give something back and help others like you helped me.

Trackbacks

  • By Today's Linux Server LinksNine OM on April 4, 2012 at 9:22 pm

    […] Running OSPF on your Ubuntu Server…… I was wondering if there was a possibility to this.  I really do not see much of a reason for other than the neatness factor.  I was looking […] […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: