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
apt-get install quagga telnetWe copy the configuration examples.
We access the directory
cd /usr/share/doc/quagga/example/We copy the directories to the configuration file /etc/quagga
cp zebra.conf.sample vtsh.conf.sample ripd.conf.sample /etc/quagga/We access the configuration file.
cd /etc/quagga/And we modify the names of the copied files.
mv zebra.conf.sample zebra.confmv vtysh.conf.sample vtysh.confmv ripd.conf.sample ripd.confWe activate the demons that we are going to use, in my case R.I.P..
We edit the file
vi daemonsand we activate the protocol to use and zebra
zebra=yesripd=yesWe edit the file /etc/network/interfaces so that no interface is raised.
vi /etc/network/interfacesWe can comment it with a #
#iface eth0 inet dhcpWe connect (The default password is zebra)
telnet localhost zebra
Trying ::1…
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.Hello, this is Quagga (version 0.99.15).
Copyright 1996-2005 Kunihiro Ishiguro, et al.User Access VerificationPassword:We go to the configuration terminal.
router# configure terminalIn the interface, you obviously have to put the one that corresponds to you.
router(config)# interface eth0We assign it an address and a mask.
router(config-if)# ip address 10.30.0.0/16We go out and save
router(config-if)# quitrouter(config)# writeConfiguration saved to /etc/quagga/ripd.confIn my case I am going to configure 3 more Interfaces, we follow the same procedure.
eth1 interface
router# configure terminalrouter(config)# interface eth1router(config-if)# ip address 10.20.0.0/16router(config-if)# quitrouter(config)# writeConfiguration saved to /etc/quagga/ripd.confeth2 interface
router# configure terminalrouter(config)# interface eth2router(config-if)# ip address 10.50.0.0/16router(config-if)# quitrouter(config)# writeConfiguration saved to /etc/quagga/ripd.confeth3 interface
router# configure terminalrouter(config)# interface eth2router(config-if)# ip address 10.40.0.0/16router(config-if)# quitrouter(config)# writeConfiguration saved to /etc/quagga/ripd.confWe activate forwarding so that it routes.
#echo “1″ > /proc/sys/net/ipv4/ip_forwardTo leave it permanent we redirect the output to the file /etc/sysctl.conf
#echo “net.ipv4.ip_forward = 1″ >> /etc/sysctl.confAnd finally we tell iptables to accept those forwards
iptables -A FORWARD -j ACCEPTiptables -t nat -A POSTROUTING -s 10.30.0.0/16-o eth0 -j MASQUERADEiptables -t nat -A POSTROUTING -s 10.20.0.0/16 -o eth1 -j MASQUERADEiptables -t nat -A POSTROUTING -s 10.40.0.0/16 -o eth3 -j MASQUERADEiptables -t nat -A POSTROUTING -s 10.50.0.0/16 -o eth2 -j MASQUERADEMore information related to it:
I will expand on this, I hope it helps you.
Greetings Rokitoh
:wq!
Comments