Scenario |
IP Details
All the Routers in the diagram are actually Debian Machines.- eth0: 192.168.10.254/24
- eth1: 10.0.0.2/30
- eth0: 192.168.20.254/24
- eth1: 10.0.0.1/30
- eth2: 10.0.0.5/30
- eth0: 192.168.30.254/24
- eth1: 10.0.0.6/30
Objective
We would be configuring the Linux boxes with dynamic routing protocol OSPF for total connectivity. This would be done with the help of Quagga.Router Alpha Configuration
root@alpha:~# apt-get install quaggaFirst, we have to enable the routing protocols needed.
root@alpha:~# cd /etc/quagga/
root@alpha:~# vim daemons
zebra=yes
bgpd=no
ospfd=yes
ospf6d=no
ripd=no
ripngd=no
isisd=no
Next, we would be configuring the interface parameters. Keep in mind, there are example configuration files stored in /usr/share/doc/quagga/examples.
root@alpha:/etc/quagga# vim zebra.conf
hostname AplhaRouter
password zebra
enable password zebra
!
! Interface's description.
!
interface lo
description loopback
ip address 127.0.0.1/8
ip forwarding
interface eth0
description LAN
ip address 192.168.10.254/24
ip forwarding
interface eth1
description to_beta
ip address 10.0.0.2/30
ip forwarding
log file /var/log/quagga/zebra.log
Now to the OSPF Configuration.
root@alpha:/etc/quagga# vim ospfd.conf
### we define the interfaces that take part in OSPF
interface eth0
interface eth1
router ospf
network 10.0.0.0/30 area 0
network 192.168.10.0/24 area 0
log stdout
log file /var/log/quagga/ospfd.log
root@alpha:/etc/quagga# /etc/init.d/quagga restart
vtyshprovides a shell that resembles the CISCO IOS shell. It even supports commands from the CISCO IOS. If vtysh.conf is not already present, we copy the file from /usr.
root@alpha:~# cp /usr/share/doc/quagga/examples/vtysh.conf.sample /etc/quagga/vtysh.conf
root@alpha:~#vtysh
Hello, this is Quagga (version 0.99.17).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
AlphaRouter# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route
C>* 127.0.0.0/8 is directly connected, lo
C>* 10.0.0.2/30 is directly connected, eth0
C>* 192.168.10.0/24 is directly connected, eth1
AlphaRouter# exit
We can issue commands like show ip route or show ip ospf in vtysh to check the available routes and OSPF status. However, since there are no OSPF neighbors yet, theshow ip route should show only directly connected devices.
Router Beta Configuration
Time to configure the next Linux box. The configuration is identical except for the network parameters. Here it goes -
root@beta:/etc/quagga# cat zebra.conf
hostname BetaRouter
password zebra
enable password zebra
!
! Interface's description.
!
interface lo
description loopback
ip address 127.0.0.1/8
ip forwarding
interface eth0
description LAN
ip address 192.168.20.254/24
ip forwarding
interface eth1
description to_alpha
ip address 10.0.0.1/30
ip forwarding
interface eth2
description to_gamma
ip address 10.0.0.5/30
ip forwarding
log file /var/log/quagga/zebra.log
root@beta:/etc/quagga# cat ospfd.conf
### we define the interfaces that take part in OSPF
interface eth0
interface eth1
interface eth2
router ospf
network 10.0.0.0/30 area 0
network 10.0.0.4/30 area 0
network 192.168.20.0/24 area 0
log stdout
log file /var/log/quagga/ospfd.log
root@beta:/etc/quagga# /etc/init.d/quagga restart
root@beta:~#vtysh
Hello, this is Quagga (version 0.99.17).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
BetaRouter# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - ISIS, B - BGP, > - selected route, * - FIB route
C>* 127.0.0.0/8 is directly connected, lo
O 10.0.0.1/30 [110/20] is directly connected, eth1
C>* 10.0.0.1/30 is directly connected, eth1
O 10.0.0.5/30 [110/20] is directly connected, eth2
C>* 10.0.0.5/30 is directly connected, eth2
O>* 192.168.10.0/24 [110/40] via 10.0.0.2, eth1,
O 192.168.20.0/24 [110/20] is directly connected, eth0
C>* 192.168.20.0/24 is directly connected, eth0
BetaRouter# exit
As we can see now, the neighbor relationship has been formed and Alpha and beta have already exchanged routing information.
Now try pinging between the Alpha and Beta networks. Should work. Alternatively, also using the good old routecommand as well to see whether the routes are already being learnt.
Router Gamma Configuration
The configuration of Gamma is same as the previous Linux boxes.root@gamma:/etc/quagga# cat zebra.conf
hostname GammaRouter
password zebra
enable password zebra
!
! Interface's description.
!
interface lo
description loopback
ip address 127.0.0.1/8
ip forwarding
interface eth0
description LAN
ip address 192.168.30.254/24
ip forwarding
interface eth1
description to_beta
ip address 10.0.0.6/30
ip forwarding
log file /var/log/quagga/zebra.log
root@gamma:/etc/quagga# cat ospfd.conf
### we define the interfaces that take part in OSPF
interface eth0
interface eth1
router ospf
network 10.0.0.4/30 area 0
network 192.168.30.0/24 area 0
log stdout
log file /var/log/quagga/ospfd.log
root@alpha:/etc/quagga# /etc/init.d/quagga restart
The system is now ready to rumble. Try viewing the routes by route or ip route or show ip route (vtysh). All the routers should be able to ping each other, and each host from any of the LANs should be able to communicate with host of other LAN. Again, traceroutecan also be used to check the path that is being taken by a packet.
Hope it helps.
0 comments:
Post a Comment