Difference between revisions of "Manual:Creating IPv6 loopback address"

From CableFree RadioOS
Jump to navigation Jump to search
(Created page with "In some cases it 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 inte...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
In some cases it 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 physical interfaces between them.
In some cases it 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 physical interfaces between them.


In MT RadioOS the recommended way to add a loopback interface for IPv4 is to create a new empty bridge interface:
In RadioOS the recommended way to add a loopback interface for IPv4 is to create a new empty bridge interface:
  /interface bridge add name=lobridge
  /interface bridge add name=lobridge
  # loopback address
  # loopback address
Line 8: Line 8:
However, for IPv6 this won't work.
However, for IPv6 this won't work.


Empty bridge interface has zero MAC byte default. MT RadioOS does not generate IPv6 link-local addresses on interfaces with zero MAC address (because of high address collision probability).
Empty bridge interface has zero MAC byte default. RadioOS does not generate IPv6 link-local addresses on interfaces with zero MAC address (because of high address collision probability).


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

Latest revision as of 18:39, 29 January 2015

In some cases it 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 physical interfaces between them.

In RadioOS 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. RadioOS does not generate IPv6 link-local addresses on interfaces with zero MAC address (because of high address collision probability).

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

Recommended solution

Add an empty bridge, and specify bridge MAC address manually:

/interface bridge add name=lobridge auto-mac=no 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 a 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