Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

RIP Routing on Linux with Zebra

Leer en espanol
RIP Routing on Linux with Zebra

Table of contents

Zebra is a daemon that in Unix systems is responsible for managing routing tables. It is responsible for imitating a physical router. Handles routing protocols such as MPLS, BGP, ===

What is Zebra? (Wikipedia)

Zebra it's a devil that in the systems unix It is responsible for managing the routing tables. It is responsible for imitating a router physical. Manages routing protocols such as MPLS,BGP, OSPF, RIP (protocol), ISIS and two more versions of rip and ospf which are aimed at IPv6.

It is used directly in kernels. BSD, solaris, linux; but only versions from 2 or 3 years ago. That does not mean, however, that it is discontinued because in the new kernels of the mentioned Unix it uses quagga like its interface that intervenes through its libraries and turns it into a demon away from the user's hand.


We install Quagga and telnet

Bash
apt-get install quagga telnet

We copy the configuration examples.

We access the directory

text
cd /usr/share/doc/quagga/example/

We copy the directories to the configuration file /etc/quagga

Bash
cp zebra.conf.sample vtsh.conf.sample ripd.conf.sample /etc/quagga/

We access the configuration file.

text
cd /etc/quagga/

And we modify the names of the copied files.

Bash
mv zebra.conf.sample zebra.conf
Bash
mv vtysh.conf.sample vtysh.conf
Bash
mv ripd.conf.sample ripd.conf

We activate the demons that we are going to use, in my case R.I.P..

We edit the file

text
vi daemons

and we activate the protocol to use and zebra

text
zebra=yes
text
ripd=yes

We edit the file /etc/network/interfaces so that no interface is raised.

text
vi  /etc/network/interfaces

We can comment it with a #

text
#iface eth0 inet dhcp

We connect (The default password is zebra)

telnet localhost zebra

text
Trying ::1…

Trying 127.0.0.1…

Connected to localhost.

Escape character is ‘^]’.
text
Hello, this is Quagga (version 0.99.15).

Copyright 1996-2005 Kunihiro Ishiguro, et al.
text
User Access Verification
text
Password:

We go to the configuration terminal.

text
router# configure terminal

In the interface, you obviously have to put the one that corresponds to you.

text
router(config)# interface eth0

We assign it an address and a mask.

text
router(config-if)# ip address 10.30.0.0/16

We go out and save

text
router(config-if)# quit
text
router(config)# write
text
Configuration saved to /etc/quagga/ripd.conf

In my case I am going to configure 3 more Interfaces, we follow the same procedure.

eth1 interface

text
router# configure terminal
text
router(config)# interface eth1
text
router(config-if)# ip address 10.20.0.0/16
text
router(config-if)# quit
text
router(config)# write
text
Configuration saved to /etc/quagga/ripd.conf

eth2 interface

text
router# configure terminal
text
router(config)# interface eth2
text
router(config-if)# ip address 10.50.0.0/16
text
router(config-if)# quit
text
router(config)# write
text
Configuration saved to /etc/quagga/ripd.conf

eth3 interface

text
router# configure terminal
text
router(config)# interface eth2
text
router(config-if)# ip address 10.40.0.0/16
text
router(config-if)# quit
text
router(config)# write
text
Configuration saved to /etc/quagga/ripd.conf

We activate forwarding so that it routes.

text
#echo “1″ > /proc/sys/net/ipv4/ip_forward

To leave it permanent we redirect the output to the file /etc/sysctl.conf

text
#echo “net.ipv4.ip_forward = 1″ >> /etc/sysctl.conf

And finally we tell iptables to accept those forwards

Bash
iptables -A FORWARD -j ACCEPT
Bash
iptables -t nat -A POSTROUTING -s 10.30.0.0/16-o eth0 -j MASQUERADE
Bash
iptables -t nat -A POSTROUTING -s 10.20.0.0/16 -o eth1 -j MASQUERADE
Bash
iptables -t nat -A POSTROUTING -s 10.40.0.0/16 -o eth3 -j MASQUERADE
Bash
iptables -t nat -A POSTROUTING -s 10.50.0.0/16 -o eth2 -j MASQUERADE

More information related to it:

quagga

cisco

I will expand on this, I hope it helps you.

Greetings Rokitoh

:wq!

Comments