Xion GNU Linux - Configuracion Router Quagga en CentOS 5.0

Imagen de foxnet

Configuracion de Router Quagga en GNU Linux CentOS 5.

La siguiente información fue probada en mi computador con GNU Linux CentOS 5.0 y en el Laboratorio de Ingeniería Electrónica de la Escuela Superior Politécnica de Chimborazo con GNU Linux CentOS 4.4 y CentOS 5.0.

Este How to es parte del Tutorial Xion GNU Linux.

Para configurar de forma adecuada el Router Quagga realice los pasos indicados a continuación.

Determinacion de soporte del kernel de IPv6:


[root@xion ~]# test -f /proc/net/if_inet6 && echo "existe soporte IPv6 en el kernel"
existe soporte IPv6 en el kernel
[root@xion ~]#

Si existe error en el paso anterior, cargue el modulo IPv6 correspondiente:

[root@xion ~]# modprobe ipv6

Si la carga fue exitosa tendremos:


[root@xion ~]# lsmod | grep -w 'ipv6' && echo "modulo IPv6 cargado exitosamente"
ipv6 251136 19 ip6t_REJECT
modulo IPv6 cargado exitosamente
[root@xion ~]#

Configuracion de interfaces (Desactivar):


[root@xion ~]# /sbin/ifconfig eth0 down

Configuracion de interfaces (Activar):


[root@xion ~]# /sbin/ifconfig eth0 up

Configuracion de direcciones IPv6 (Añadir):


[root@xion ~]# ifconfig eth0 inet6 add 2001:db8:fedc:bcde::4/64

Configuracion de direcciones IPv6 (Eliminar):


[root@xion ~]# ifconfig eth0 inet6 del 2001:db8:fedc:bcde::4/64

Mostrar los enlaces existentes - Se emuestra varias interfaces debido a que se encuentra instalado la Máquina Virtual Xen:


[root@xion ~]# ip link list
1: lo: mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: peth0: mtu 1500 qdisc pfifo_fast qlen 1000
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
3: sit0: mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
4: vif0.0: mtu 1500 qdisc noqueue
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
5: eth0: mtu 1500 qdisc noqueue
link/ether 00:d0:09:9c:52:e7 brd ff:ff:ff:ff:ff:ff
6: vif0.1: mtu 1500 qdisc noop
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
7: veth1: mtu 1500 qdisc noop
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
8: vif0.2: mtu 1500 qdisc noop
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
9: veth2: mtu 1500 qdisc noop
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
10: vif0.3: mtu 1500 qdisc noop
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
11: veth3: mtu 1500 qdisc noop
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
12: xenbr0: mtu 1500 qdisc noqueue
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
[root@xion ~]#

Mostrar nuestras direcciones IP:


[root@xion ~]# ip address show
1: lo: mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: peth0: mtu 1500 qdisc pfifo_fast qlen 1000
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
3: sit0: mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
4: vif0.0: mtu 1500 qdisc noqueue
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
inet6 fe80::fcff:ffff:feff:ffff/64 scope link
valid_lft forever preferred_lft forever
5: eth0: mtu 1500 qdisc noqueue
link/ether 00:d0:09:9c:52:e7 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0
inet6 2001:db8:fedc:cdef::4/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::2d0:9ff:fe9c:52e7/64 scope link
valid_lft forever preferred_lft forever
6: vif0.1: mtu 1500 qdisc noop
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
7: veth1: mtu 1500 qdisc noop
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
8: vif0.2: mtu 1500 qdisc noop
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
9: veth2: mtu 1500 qdisc noop
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
10: vif0.3: mtu 1500 qdisc noop
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
11: veth3: mtu 1500 qdisc noop
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
12: xenbr0: mtu 1500 qdisc noqueue
link/ether fe:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
[root@xion ~]#

Mostrar nuestras rutas:


[root@xion ~]# ip route show
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.1
[root@xion ~]#

Mostrar las tablas de ruta:


[root@xion ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
[root@xion ~]#

Reglas por defecto (Base de datos de normas de rutado):


[root@xion ~]# ip rule list
0: from all lookup 255
32766: from all lookup main
32767: from all lookup default
[root@xion ~]#

Tabla local (Normas de encaminamiento):


[root@xion ~]# ip route list table local
local 192.168.1.1 dev eth0 proto kernel scope host src 192.168.1.1
broadcast 192.168.1.0 dev eth0 proto kernel scope link src 192.168.1.1
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
broadcast 192.168.1.255 dev eth0 proto kernel scope link src 192.168.1.1
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1
[root@xion ~]#

Tabla main (Normas de encaminamiento):


[root@xion ~]# ip route list table main
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.1
[root@xion ~]#

Generacion de una nueva regla:


[root@xion ~]# echo 200 Xion >> /etc/iproute2/rt_tables
[root@xion ~]# ip rule add from 192.168.1.10 table Xion
[root@xion ~]# ip rule ls
0: from all lookup 255
32765: from 192.168.1.10 lookup Xion
32766: from all lookup main
32767: from all lookup default
[root@xion ~]#

Generacion de la tabla Xion y refresco de la cache de rutas:


[root@xion ~]# ip route add default via 192.168.1.1 dev eth0 table Xion
[root@xion ~]# ip route flush cache
[root@xion ~]#

Configuracion en Vtysh de Quagga:


xion# configure terminal
xion(config)# interface eth0
xion(config-if)# ip address 10.0.1.0/24
xion(config-if)# no shutdown
xion(config-if)# exit
xion(config)# interface eth1
xion(config-if)# ip address 10.0.2.0/24
xion(config-if)# no shutdown
xion(config-if)# exit
xion(config)# exit
xion# copy running-config startup-config
xion#

Creacion de Tuneles IPv6, considero una Red 3ffe:406:5:1:5:a:2:1/96, con IPv4 Local 172.16.17.18 y la IPv4 del Router es 172.22.23.24:


[root@xion ~]# ip tunnel add sixbone mode sit remote 172.22.23.24 local 172.16.17.18 ttl 255
[root@xion ~]# ip link set sixbone up
[root@xion ~]# ip addr add 3ffe:406:5:1:5:a:2:1/96 dev sixbone
[root@xion ~]# ip route add 3ffe::/15 dev sixbone
[root@xion ~]#

Utilizamos ifconfig para ver todas las interfaces:


[root@xion ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:D0:09:9C:52:E7
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: 2001:db8:fedc:cdef::4/64 Scope:Global
inet6 addr: fe80::2d0:9ff:fe9c:52e7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:18461 (18.0 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:866 errors:0 dropped:0 overruns:0 frame:0
TX packets:866 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1278006 (1.2 MiB) TX bytes:1278006 (1.2 MiB)

peth0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
UP BROADCAST NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:11 Base address:0xde00

sixbone Link encap:IPv6-in-IPv4
inet6 addr: fe80::ac10:1112/128 Scope:Link
inet6 addr: 3ffe:406:5:1:5:a:2:1/96 Scope:Global
UP POINTOPOINT RUNNING NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

vif0.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:135 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:28260 (27.5 KiB) TX bytes:0 (0.0 b)

xenbr0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:135 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:26370 (25.7 KiB) TX bytes:0 (0.0 b)

[root@xion ~]#

Hacemos ping6 para comprobar el tunel:


[root@xion ~]# ping6 3ffe:406:5:1:5:a:2:1
PING 3ffe:406:5:1:5:a:2:1(3ffe:406:5:1:5:a:2:1) 56 data bytes
64 bytes from 3ffe:406:5:1:5:a:2:1: icmp_seq=0 ttl=64 time=0.386 ms
64 bytes from 3ffe:406:5:1:5:a:2:1: icmp_seq=1 ttl=64 time=0.271 ms
64 bytes from 3ffe:406:5:1:5:a:2:1: icmp_seq=2 ttl=64 time=0.243 ms
64 bytes from 3ffe:406:5:1:5:a:2:1: icmp_seq=3 ttl=64 time=0.246 ms

[3]+ Stopped ping6 3ffe:406:5:1:5:a:2:1
[root@xion ~]#

Autoconfiguracion de IPv6, si esta activo el demonio radvd:


[root@xion ~]# /sbin/ip -f inet6 addr
1: lo: mtu 16436
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
4: vif0.0: mtu 1500
inet6 fe80::fcff:ffff:feff:ffff/64 scope link
valid_lft forever preferred_lft forever
5: eth0: mtu 1500
inet6 2001:db8:fedc:cdef::4/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::2d0:9ff:fe9c:52e7/64 scope link
valid_lft forever preferred_lft forever
13: sixbone@NONE: mtu 1480
inet6 3ffe:406:5:1:5:a:2:1/96 scope global
valid_lft forever preferred_lft forever
inet6 fe80::ac10:1112/128 scope link
valid_lft forever preferred_lft forever
[root@xion ~]#

Comentarios

Ya sabes, un pequeño aporte para los amigos...

Imagen de foxnet

Ya sabes, un pequeño aporte para los amigos de la Comunidad de Software Libre.

Hay que seguir planificando nueva informacion para compartir y asi ayudar a los nuevos usuarios de GNU Linux...

Gracias por el respaldo Juank.

Promover el desarrollo de software libre...

El conocimiento debe ser compartido para toda la humanidad y no ser solo de pocos....

http://xionecuador.bravehost.com

Website Personal sobre GNU/Linux: http://xionecuador.bravehost.com
Miembro SafeCreative.org: http://www.safecreative.org
Blog de Informacion Tecnologica: http://xentron.blogspot.com

Muy interesante

Imagen de EliaNosft

Hola, Saludos, a pesar que tu manual ya tenga un año nunca deja de ser uno de los mas buscados en el internet, pero yo quiero saber en donde puedo encontrar las principales simbologías de los terminos que implementas en tu tutorial por ejemplo proto, inet, scope y bueno esas palabritas, porque no hay manuales que explique a profundidad los comandos que escribimos, por lo menos unas cuantas palabras quieisera entender, porque practicamente lo estoy haciendo mecanicamente.

Muchas Gracias de Antemano