您的位置:首页 > 其它

Ubuntu8.04上的Quagga初始化配置手册

2008-11-13 20:43 253 查看
公司的服务器工作量不大,故而想把服务器配成路由器用,就不用买那么昂贵的高级路由器了,于是从网上搜到了这么一篇文章。这样一台服务器就成了:OA服务器+subversion服务器+远程安装服务器+防火墙+路由器,一机多用哈。不过只是白天上班的时间开机,所以各位小黑老黑、小红老红就放我一马吧,就算是搞下来也没什么用的

Notes on Initializing Quagga for Ubuntu 8.04

<伊落丹> Illidan.modeler@gmail.com

Northern Capital, Republic of Pandaria

Quagga is a routing software
package that provides TCP/IP based routing services with routing
protocols support such as RIPv1, RIPv2, RIPng, OSPFv2, OSPFv3, BGP-4,
and BGP-4+.

With quagga we can turn an ordinary PC into a multiple-interface
router. In addition, it is easy to monitor and study routing/signaling
traffic if the router software is run on a PC than on a commodity
hardware router, since we're able to run protocol analyzer software
such as wireshark.

This short manual will show you how to run a quagga routing software,
with a very basic configuration. All the configuration work flow is
against the topology given below.



Note:

In the text below, quagga commands, to be input in quagga CLIs, are
highlighted by deep shadowed background color. Don't confuse them with
Linux shell commands, which are highlighted by light background color.

0. Install the software

sudo apt-get install quagga

1. Prepare the configuration file

cd /etc/quagga

sudo cp /usr/share/doc/quagga/examples/ospf.conf.sample ospfd.conf
2. Start Quagga

edit /etc/quagga/daemons

There's an entry for each daemon, with a default option of 'no'. Change
it to 'yes' to invoke it. For this experiment, change the options for ospf and zebra to 'yes'.

Start quagga with the following command:

sudo /etc/init.d/quagga start

It invokes those daemons with 'yes' in configuration file.

3. Configure ospf paramters

telnet 127.0.0.1 2604

When it prompts for password, provide the default password 'zebra'.

The default ports for quagga daemons' vty can be found at /etc/services.

zebrasrv 2600/tcp # zebra service

zebra 2601/tcp # zebra vty

ripd 2602/tcp # ripd vty (zebra)

ripngd 2603/tcp # ripngd vty (zebra)

ospfd 2604/tcp # ospfd vty (zebra)

bgpd 2605/tcp # bgpd vty (zebra)

ospf6d 2606/tcp # ospf6d vty (zebra)

ospfapi 2607/tcp # OSPF-API

isisd 2608/tcp # ISISd vty (zebra)

You can also view the port in the fly by issuing a command 'sudo netstat -anp -A inet' to the Linux shell.

After login, we get a quagga command line interface via the telnet
session. Configuring quagga ospf routing is almost identical to
configure Cisco ospf routing.

Next, in quagga CLI, issue the following commands.

enable

configure terminal

At this point, we've entered the configuration mode. Configure an ospf process to advertise network 192.168.1.0/24.

router ospf

network 192.168.1.0/24 area 0

Since quagga currently doesn't support multiple ospf processes, there's
no process id at the end of line 'router ospf'. And please note that
this ospf process is not a process to the operating system Linux. It's
a 'logical' process within quagga's realm.

4. Configre the Cisco router

At this point, we might start our wireshark if we want to view the OSPF packets, such as Hello, LS Update, LS Ack, etc.

The cisco router is configured to advertise network 192.168.1.0/24 and 192.168.3.0/24 for OSPF.

!

interface Ethernet0/0

ip address 192.168.1.100 255.255.255.0

ip route-cache flow

half-duplex

!

interface Ethernet0/1

ip address 192.168.3.100 255.255.255.0

ip route-cache flow

half-duplex

!

router ospf 1

log-adjacency-changes

network 192.168.1.0 0.0.0.255 area 0

network 192.168.3.0 0.0.0.255 area 0

!

5. Verify

zebra
is an IP routing manager. It provides kernel routing
table updates, interface lookups, and redistribution of routes between
different routing protocols.

Log in zebra vty to view the IP forwarding table.

telnet 127.0.0.1 2601

Router> show ip route

Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,

I - ISIS, B - BGP, > - selected route, * - FIB route

...

O>* 192.168.3.0/24 [110/20] via 192.168.1.100, ath0, 00:01:54

We can see that quagga has learned the route of 192.168.3.0/24 via ospf.

In a common BASH, try

ping 192.168.3.100

PING 192.168.3.100 (192.168.3.100) 56(84) bytes of data.

64 bytes from 192.168.3.100: icmp_seq=1 ttl=255 time=12.2 ms

64 bytes from 192.168.3.100: icmp_seq=2 ttl=255 time=2.23 ms

64 bytes from 192.168.3.100: icmp_seq=3 ttl=255 time=2.30 ms
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: