Понимание черной магии адресов IPv6

550
Reini

мой роутер (AVM Fritz Box) поддерживает 6to4. Пока это работает, но я хочу понять, что происходит. Последние несколько часов я потратил на книгу по IPv6. Есть много вещей, которые я сейчас понимаю, но есть одна вещь, которую я не могу понять:

Адреса маршрутизатора:
общедоступный IPv4-адрес: 93.209.83.121 (hex: 5dd1: 5379)

Global Prefix: 2002:5dd1:5379:00|00 :0000:0000:0000:0000/56 Global IPv6 address on WAN side: 2002:5dd1:5379:80 00|:0224:feff:fe19:0fde/64 Global IPv6 address on LAN side: 2002:5dd1:5379:00 00|:0224:feff:fe19:0fdc/64 

Я положил вертикальную черту (|) в позицию, где заканчивается префикс.

Таким образом, глобальный префикс заканчивается на: 0000: но на стороне WAN он заканчивается: 8000:
Насколько я понимаю, это: 8000: адрес не помещается в префикс / 56, потому что первый байт отличается от: 0000:

Я ожидал, что подсети / 64 начинаются со второго байта этого блока.
Например: 0001 :,: 0002 :, ...: 00FF:

Но я могу пропинговать глобальный адрес IPv6. Может ли кто-нибудь объяснить мне, что я ошибся?

3
Ваш префикс на самом деле / ​​48, а не / 56. Michael Hampton 11 лет назад 0
Спасибо, Сандер Штеффан тоже упомянул об этом. Я скопировал адреса прямо из WebInterface. Мой FritzBox полностью автоматически настроил этот туннель. Reini 11 лет назад 0

1 ответ на вопрос

3
Sander Steffann

Since you're using 6to4 you will have a whole /48 available to you. The structure of the address is as follows (probably including more detail than necessary for you, but just to be on the safe side):

  • IPv6 addresses are in hexadecimal
  • 2002 is the fixed prefix for 6to4 (16 bits)
  • 5dd1:5379 is your IPv4 address written in hexadecimal (2 * 16 bits)
  • Everything after that is yours (or your router's) to do with as you please :-)

You write this down as 2002:5dd1:5379::/48, which is technically the same as 2002:5dd1:5379:0000:0000:0000:0000:0000/48 if you write all the blocks and leading zeroes.

The /48 means that the first 48 bits are fixed (the 2002:5dd1:5379: part) and that everything else (0000:0000:0000:0000:0000 to ffff:ffff:ffff:ffff:ffff) is flexible (yours to work with).

With IPv6 every network (LAN) gets a /64. The first one is 2002:5dd1:5379:0000::/64 (which is usually shortened to (2002:5dd1:5379::/64) because :: means 'as many blocks of 0000 as necessary here). The second one is 2002:5dd1:5379:0001::/64, etc. Up to 2002:5dd1:5379:ffff::/64.

Yes, this means you get enough addresses for 65536 LANs!

The /56 mentioned as Global Prefix is just wrong. As I mentioned earlier it's actually a /48. The Fritz!box does seem to use the right addresses though despite showing the wrong prefix size. It uses ...:0000:... for its LAN interface and ...:8000:... for its WAN interface. Nothing wrong with those choices, just a display error it seems :-)

One important thing though: 6to4 is not always very reliable. Your router will send outbound IPv6 traffic over an IPv6-in-IPv4 tunnel to 192.88.99.1. There are many routers on the internet with that address (a technique called anycast) and your outbound IPv6 traffic will end up using the one that the network thinks is closest. The same goes for the return traffic to your network. There are also many relays for that and which one is used depends on which one is closest to the other side. If either of those relays performs badly, is broken, not well maintained, doesn't have enough bandwidth etc etc etc then your IPv6 connection will be broken. And because the incoming traffic will use different relays depending on which other systems you communicate with debugging it is practically impossible.

I.e. Hurricane Electric (he.net / tunnelbroker.net) offers free IPv6-in-IPv4 tunnels that are statically configured. You will always use the same relay for inbound and outbound traffic and you'll know who is responsible for it if it fails. That will probably save you many headaches :-)


All of this is independent of your ISP. They don't have to provide any service related to 6to4 for this to work, although if you're lucky they provide an outbound relay for 6to4.

Благодарю вас! И особенно спасибо за это предложение: «/ 56, упомянутый как глобальный префикс, просто неверен. Как я упоминал ранее, это на самом деле / ​​48». С этим все имеет смысл ... Reini 11 лет назад 1

Похожие вопросы