Wiedza Tworzenie tunelu IPv6 <> IPv4 - mikrotik

Discussion in 'Research Tuts/Notes' started by Silas Mariusz, May 30, 2015.

Loading...
  1. Silas Mariusz
    Online

    Silas Mariusz SysOp Administrator

    Joined:
    Apr 5, 2008
    Messages:
    8,752
    Local Time:
    5:28 PM
    Ratings:
    +1,826 / 39 / -9
    Followers:
    37
    QNAP:
    TS-x77
    Ethernet:
    1 GbE
    TS-x77 1 GbE
    Source: Setting up an IPv6 tunnel via a tunnel broker - MikroTik Wiki

    Setting up an IPv6 tunnel via a tunnel broker
    First sign up for your tunnel at http://www.tunnelbroker.net or an equivalent service.

    This will get you some information that looks like this:

    Code (Text):
    1. Server IPv4 address: 216.66.80.26
    2. Server IPv6 address: 2001:470:1111:11::1/64
    3. Client IPv4 address: 222.222.222.222
    4. Client IPv6 address: 2001:470:1111:11::2/64
    5. Assigned /64: 2001:470:3333:33::/64
    First enable ipv6 package if it has not been already!

    Setup the 6to4 interface
    Code (Text):
    1. /interface 6to4 add mtu=1280 name=sixbone local-address=222.222.222.222
    Add your client IPv6 address to the new interface
    Code (Text):
    1. /ipv6 address add address=2001:470:1111:11::2/64 interface=sixbone


    Add a default IPv6 route via your tunnel
    Code (Text):
    1. /ipv6 route add dst-address=2000::/3 gateway=::216.66.80.26
    As of ROS 3.8 the syntax is:
    Code (Text):
    1. /ipv6 route add dst-address=<destination> gateway=::<ipv4-tunnelend>,<interface>
    Sample:
    Code (Text):
    1. /ipv6 route add dst-address=2000::/3 gateway=::216.66.80.26,sixbone

    The reason is, that with multiple tunnels on multiple interfaces, RouterOS would before 3.8 have assigned the routes to random 6in4 tunnel interfaces.
    Also note, that if you upgrade from pre-3.8 to 3.8 and beyond, all static routes with ::IPv4 gateway will have be re-created from scratch.

    New syntax for ROS 3.13+ routing-test:
    Code (Text):
    1. /ipv6 route add dst-address=<destination> gateway=::<ipv4-tunnelend>%<interface>
    e.g.
    Code (Text):
    1. /ipv6 route add gateway=::216.66.80.26%sixbone
    ROS 3.9 & 3.10: Adding routes is broken in these releases. Winbox returns an error message. Terminal will add the destination 2000::/3 as ::/3 which will not work as a default route. To work around this problem use the destination ::/0 instead.

    You can now add your assigned IPv6 addresses as required.

    -
    ROS 3.22: I had to use mine "Server IPv6 address" (like 2001:470:1111:11::1 which i used as an example here!) for the gateway in order for routing to work.

    Also do not forget to add assigned /64 subnet (2001:470:3333:33::/64 in this example) tp ipv6->Addresses so your clients behind Mikrotik can connect to the IPv6 network as well! This will enable clients there to autoconfigure correctly and make things work almost out of the box!