Manual:My First IPv6 Network

From MikroTik Wiki
Jump to navigation Jump to search

Applies to RouterOS: v3, v4 +

Summary

This example demonstrates how to set up your first IPv6 network using tunnel broker's provided service.

Application Example

Consider following network setup:

Our main gateway (R1) has only IPv4 internet connectivity and ISP is not providing IPv6 services. Our network consists of two isolated network segments Lan1 and Lan2.

To enable IPv6 we will need to create a tunnel to IPv6 tunnel broker which will transit our IPv6 traffic over IPv4 network.

Tunnel broker

In this example we will use Hurricane Electric tunnel broker services.

After registration click on "Create regular tunnel", enter your IP address and choose closest server to your location. That's it tunnel is now allocated.

Now go to tunnel details, where you will see all the parameters for successful tunnel creation and allocated IPv6 address block. As we have two separate lan segments we will need /48 address block, allocate it by clicking on "allocate".

Configuration

Here is whole configurations for those who want to copy&paste.

R1:

# ipv4 connectivity to ISP

/ip address 
  add address=194.105.56.170/24 interface=ether1
/ip route
  add gateway=194.105.56.1

# ipv6 service

/interface 6to4
  add comment="HE IPv6" local-address=194.105.56.170 mtu=1280 name=sit1 remote-address=\
    216.66.80.90

/ipv6 address
  add address=2001:470:27:37e::2/64 advertise=no eui-64=no interface=sit1

/ipv6 route
  add dst-address=::/0 gateway=2001:470:27:37e::1

#Lan1
/ipv6 address
  add address=2001:470:dcd9:1::1/64 advertise=yes interface=ether3

# routing between segments
/routing ospf-v3 instance
  set default router-id=10.10.10.1 distribute-default=if-installed-as-type-1 \
  redistribute-connected=as-type-1

/routing ospf-v3 interface
  add area=backbone interface=ether2

R2:

#Lan2
/ipv6 address
  add address=2001:470:dcd9:2::1/64 advertise=yes interface=ether3

# routing between segments
/routing ospf-v3 instance
  set default router-id=10.10.10.2 redistribute-connected=as-type-1

/routing ospf-v3 interface
  add area=backbone interface=ether1

IPv4 connectivity

IPv4 connectivity is needed only between ISP and our main gateway (R1), as our home network is going to be purely IPv6.

Set up ip address and route on R1:

/ip address 
  add address=194.105.56.170/24 interface=ether1
/ip route
  add gateway=194.105.56.1

IPv6 tunnel service

Lets create 6to4 tunnel using parameters from HE provided tunnel details:

/interface 6to4
  add comment="HE IPv6" local-address=194.105.56.170 mtu=1280 name=sit1 remote-address=\
    216.66.80.90

Add provided IPv6 address and default route to tunnel broker.

/ipv6 address
  add address=2001:470:27:37e::2/64 advertise=no eui-64=no interface=sit1

/ipv6 route
  add dst-address=::/0 gateway=2001:470:27:37e::1

At this point router should be capable of reaching any IPv6 destination.


Lan segment address blocks

Next, we need to assign a subnet address from the /48 address block to two of our ethernet segments. Since the prefix length for IPv6 subnet is always /64, we have 65536 subnets available from /48 address block! Let's just assign 2001:470:dcd9:1::/64 to Lan1, and 2001:470:dcd9:2::/64 to Lan2.

R1:

#Lan1
/ipv6 address
  add address=2001:470:dcd9:1::1/64 advertise=yes interface=ether3

R2:

#Lan2
/ipv6 address
  add address=2001:470:dcd9:2::1/64 advertise=yes interface=ether3

Notice, that advertise flag is enabled. It means that Stateless auto configuration is enabled and absolutely no address configuration is required on client side.

Routing between segments

We will use OSPF as the routing protocol between both routers. Notice that in IPv6 network additional addresses between routers are not required. Link-local addresses are used for connectivity between routers.

R1:

/routing ospf-v3 instance
  set default router-id=10.10.10.1 distribute-default=if-installed-as-type-1 \
  redistribute-connected=as-type-1

/routing ospf-v3 interface
  add area=backbone interface=ether2

R2:

/routing ospf-v3 instance
  set default router-id=10.10.10.2 redistribute-connected=as-type-1

/routing ospf-v3 interface
  add area=backbone interface=ether1

When configuring OSPF on a network without configured IPv4, important configuration part is to set up router-id. Wen this parameter is not set, OSPF will try to get it from configured IPv4 addresses, if IPv4 address are missing process will fail and OSPF will not work.


At this point both LAN segments can reach Ipv6 Global network routed over 6to4 tunnel.


See Also


[ Top | Back to Content ]