Manual:Creating IPv6 loopback address

From MikroTik Wiki
Revision as of 18:23, 31 October 2008 by Route (talk | contribs) (New page: In some case there is necessary to have a kind of loopback interface. It can be used to hold addresses that belong to the "router itself" and not to any particular outgoing interface. Such...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In some case there is necessary to have a kind of loopback interface. It can be used to hold addresses that belong to the "router itself" and not to any particular outgoing interface. Such addresses are useful, for example, as source addresses for TCP connections between two routers that have more that one interface between them.

In MT RouterOS the recommended way to add a loopback interface for IPv4 is to create a new empty bridge interface:

/interface bridge add name=lobridge
# loopback address
/ip address add address=10.0.0.1/24 interface=lobridge

However, for IPv6 this won't work.

Empty bridge interface has zero MAC byte default. MT RouterOS does not generate IPv6 link-local addresses in the case of zero MAC address (because of high possibility of collisions).

Since IPv6 link-local address is needed for IPv6 to function properly on an interface, this means that empty bridge interface cannot be used as IPv6 loopback interface by default.

Recommended solution

Add empty bridge, and specify bridge MAC address manually:

/interface bridge add name=lobridge admin-mac=01:00:00:00:01:00
# loopback address
/ipv6 address add address=2003::1/64 advertise=no interface=lobridge

Alternative solution is to use fake EoIP tunnel interface instead of bridge. A random MAC address will be generated in this case.

Results

Test that you are able to ping the loopback address:

/ping 2003::1
2003::1 64 byte ping: ttl=64 time=5 ms
2003::1 64 byte ping: ttl=64 time=5 ms