viernes, 4 de abril de 2014

Tunnel IPv6/IP sobre red de transporte IPv4

Hola a todos después de algún tiempo de estar fuera del blog retomo con este post sobre Tunnel Ipv6 sobre red de transporte Ipv4,

Basicamente lo que haremos es construir una red de transporte Ipv4 a traves de OSPFv2 para intercambio de rutas y conformaremos un Tunnel Ipv6IP entre un router que sera nuestra isla de Ipv6 y el destino que será un router que cuenta con capacidades tanto para enrular trafico v4 como v6.

Adicionalmente correremos OSPFv3 en el tunnel para el intercambio de rutas IPv6.


A continuacion se presenta la red a implementar:



Utilizaremos las loopbacks 0 IPv4 10.0.0.X donde X es el numero de cada Router, estas loopbacks son importantes ya que desempeñan el rol de Router ID para OSPF tanto para v4 como para v6.

R1:
interface Loopback 0
ip add 10.0.0.1 255.255.255.255

Configuraremos las loopbacks 100 Ipv6 en los routers R1, R3 y R4, el no configurarla en R2 es intencional ya que R2 solamente funcionara como transporte IPv4 en el cual encapsularemos transporte IPv6, para esto utilizaremos la red 2001:ABCD::X/128 donde X es el numero de router

R1:
interface Loopback 100
ipv6 address 2001:ABCD::1/128

Configuraremos un tunnel entre R1 y R3 por lo cual nos valdremos del proceso de OSPF en IPv4 para intercambiar las loopbacks 10.0.0.X las cuales utilizaremos como source y destination para establecer el tunnel.


R1:
interface Tunnel0
tunnel source Loopback0
tunnel destination 10.0.0.3
tunnel mode ipv6ip

El tunnel necesita subnet Ipv6 para funcionar correctamente esta al igual que todas las direcciones punto a punto de tipo locales las configuraremos a traves del feature autoconfig el cual utiliza la mac address para generar una dirección Ipv6 única en un enlace local.

R1:
interface Tunnel 0
ipv6 address autoconfig

A continuacion se presentan las configuraciones aplicadas en cada equipo



R1:

ipv6 unicast-routing << Activamos el enrutamiento del protocolo IPv6
!
!
interface Loopback0
 ip address 10.0.0.1 255.255.255.255
!
interface Loopback100
 no ip address
 ipv6 address 2001:ABCD::1/128
 ipv6 ospf network point-to-point
 ipv6 ospf 1 area 0
!
interface Tunnel0
 no ip address
 ipv6 address autoconfig << Usamos el feature autoconfig para configurar las IP de dinamicas
 ipv6 ospf 1 area 0  << A traves de este comando iniciamos  OSPFv3 en el tunnel
 tunnel source Loopback0
 tunnel destination 10.0.0.3
 tunnel mode ipv6ip
!
interface FastEthernet0/0
 ip address 10.210.12.1 255.255.255.252
 ip ospf network point-to-point
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
router ospf 1
 router-id 10.0.0.1
 log-adjacency-changes
 network 10.0.0.1 0.0.0.0 area 0
 network 10.210.12.1 0.0.0.0 area 0
 network 192.168.1.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!      
ipv6 router ospf 1
 router-id 10.0.0.1 << Definimos un router ID consistente para el OSPFv3
 log-adjacency-changes
!


R2: << R2 No tiene nada de Ipv6 configurado

!
interface Loopback0
 ip address 10.0.0.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 10.210.12.2 255.255.255.252
 ip ospf network point-to-point
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 10.210.23.1 255.255.255.252
 ip ospf network point-to-point
 duplex auto
 speed auto
 mpls ip
!
router ospf 1
 router-id 10.0.0.2
 log-adjacency-changes
 network 10.0.0.2 0.0.0.0 area 0
 network 10.210.12.2 0.0.0.0 area 0
 network 10.210.23.1 0.0.0.0 area 0

R3:

ipv6 unicast-routing
!

interface Loopback0
 ip address 10.0.0.3 255.255.255.255
!
interface Loopback100
 no ip address
 ipv6 address 2001:ABCD::3/128
 ipv6 ospf network point-to-point
 ipv6 ospf 1 area 0
!
interface Tunnel0
 no ip address
 ipv6 address autoconfig
 ipv6 ospf 1 area 0
 tunnel source Loopback0
 tunnel destination 10.0.0.1 << Destinos y Origen del tunnel son Ipv4
 tunnel mode ipv6ip
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address autoconfig
 ipv6 ospf network point-to-point
 ipv6 ospf 1 area 0
!
interface FastEthernet0/1
 ip address 10.210.23.2 255.255.255.252
 ip ospf network point-to-point
 duplex auto
 speed auto
!
router ospf 1
 router-id 10.0.0.3
 log-adjacency-changes
 network 10.0.0.3 0.0.0.0 area 0
 network 10.210.23.2 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
ipv6 router ospf 1
 router-id 10.0.0.3
 log-adjacency-changes
!


R4:

ipv6 unicast-routing
!

interface Loopback0
 ip address 10.0.0.4 255.255.255.255
!
interface Loopback100
 no ip address
 ip ospf 1 area 0
 ipv6 address 2001:ABCD::4/128
 ipv6 ospf network point-to-point
 ipv6 ospf 1 area 0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address autoconfig
 ipv6 ospf network point-to-point
 ipv6 ospf 1 area 0
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
ipv6 router ospf 1
 router-id 10.0.0.4
 log-adjacency-changes
!


Comprobamos el funcionamiento de nuestra solución, las tablas de enrolamiento son independientes para ambos protocolos, como podrán observar en R2 no existe ningún prefijo IPv6


Tablas de Enrutamiento IPv4 e IPv6


R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O       10.0.0.2/32 [110/11] via 10.210.12.2, 00:23:33, FastEthernet0/0
O       10.0.0.3/32 [110/21] via 10.210.12.2, 00:23:33, FastEthernet0/0
C       10.0.0.1/32 is directly connected, Loopback0
O       10.210.23.0/30 [110/20] via 10.210.12.2, 00:23:33, FastEthernet0/0
C       10.210.12.0/30 is directly connected, FastEthernet0/0


R1#sho ipv6 route
IPv6 Routing Table - 5 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
LC  2001:ABCD::1/128 [0/0]
     via ::, Loopback100
O   2001:ABCD::3/128 [110/11111] << Prefijos aprendidos por OSPFv3
     via FE80::A00:3, Tunnel0
O   2001:ABCD::4/128 [110/11121]
     via FE80::A00:3, Tunnel0
L   FE80::/10 [0/0]
     via ::, Null0
L   FF00::/8 [0/0]
     via ::, Null0



R2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C       10.0.0.2/32 is directly connected, Loopback0
O       10.0.0.3/32 [110/11] via 10.210.23.2, 00:23:34, FastEthernet0/1
O       10.0.0.1/32 [110/11] via 10.210.12.1, 00:23:34, FastEthernet0/0
C       10.210.23.0/30 is directly connected, FastEthernet0/1
C       10.210.12.0/30 is directly connected, FastEthernet0/0

R2#show ipv6 route
IPv6 Routing Table - 0 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

<< No hay prefijos en la tabla de Ipv6



R3#show ip route 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O       10.0.0.2/32 [110/11] via 10.210.23.1, 00:24:47, FastEthernet0/1
C       10.0.0.3/32 is directly connected, Loopback0
O       10.0.0.1/32 [110/21] via 10.210.23.1, 00:24:47, FastEthernet0/1
C       10.210.23.0/30 is directly connected, FastEthernet0/1
O       10.210.12.0/30 [110/20] via 10.210.23.1, 00:24:47, FastEthernet0/1

<< La tabla de Ipv4 solamente la estamos utilizando para intercambiar las rutas del origen y destino del tunnel bien podriamos utilizar rutas estaticas, BGP o cualquier otro protocolo dinámico para esta labor.
          

R3#show ipv6 route
IPv6 Routing Table - 5 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
O   2001:ABCD::1/128 [110/11111]
     via FE80::A00:1, Tunnel0
LC  2001:ABCD::3/128 [0/0]
     via ::, Loopback100
O   2001:ABCD::4/128 [110/10]
     via FE80::C203:13FF:FE0A:0, FastEthernet0/0
L   FE80::/10 [0/0]
     via ::, Null0
L   FF00::/8 [0/0]
     via ::, Null0

<< OSPFv3 es la version de OSPF para IPv6 existen también versiones de RIP, EIGRP y BGP para IPv6




R4#show ipv6 route
IPv6 Routing Table - 5 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
O   2001:ABCD::1/128 [110/11121]
     via FE80::C202:13FF:FE0A:0, FastEthernet0/0
O   2001:ABCD::3/128 [110/10]
     via FE80::C202:13FF:FE0A:0, FastEthernet0/0
LC  2001:ABCD::4/128 [0/0]
     via ::, Loopback100
L   FE80::/10 [0/0]
     via ::, Null0
L   FF00::/8 [0/0]
     via ::, Null0

<< En R4 no tenemos tabla de IPv4 ya que únicamente esta hablando IPv6



Prueba de Conectividad de Ipv6 desde R1 hasta R4


R1#ping ipv6 2001:ABCD::4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:ABCD::4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/58/64 ms

Espero les haya gustado y sea de utilidad este post el cual me inspire en una pregunta de Antonio Perez para desarrollarlo, no duden en preguntar y se agradecen correcciones de antemano.



No hay comentarios:

Publicar un comentario