Zum Inhalt springen

IPv6/Router/Advertisement: Unterschied zwischen den Versionen

Aus Foxwiki
Zeile 128: Zeile 128:
Das neue Router Advertisement fangen wir ebenfalls mit Wireshark auf linux auf
Das neue Router Advertisement fangen wir ebenfalls mit Wireshark auf linux auf


=== Optionen ===
{| class="wikitable options"
{| class="wikitable options"
|-
|-
! Wert !! Beschreibung
! Wert !! Beschreibung
|-
|-
| AdvDefaultLifetime ||  
| AdvDefaultLifetime || AdvDefaultLifetime seconds
The lifetime associated with the default router in units of seconds. The maximum value corresponds to 18.2 hours. A lifetime of 0 indicates that the router is not a default router and should not appear on the default router list. The router lifetime applies only to the router's usefulness as a default router; it does not apply to information contained in other message fields or options. Options that need time limits for their information include their own lifetime fields.
 
    Must be either zero or between MaxRtrAdvInterval and 9000 seconds.
 
    Default: 3 * MaxRtrAdvInterval (Minimum 1 second).
|-
|-
| AdvValidLifetime ||  
| AdvValidLifetime || AdvValidLifetime seconds|infinity
 
    The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination. The symbolic value infinity represents infinity (i.e. a value of all one bits (0xffffffff)). The valid lifetime is also used by RFC 4862.
 
    Note that clients will ignore AdvValidLifetime of an existing prefix if the lifetime is below two hours, as required in RFC 4862 Section 5.5.3 point e).
 
    Note: RFC4861's suggested default value is significantly longer: 30 days.
 
    Default: 86400 seconds (1 day)
|-
|-
| AdvPreferredLifetime ||  
| AdvPreferredLifetime || AdvPreferredLifetime seconds|infinity
 
    The length of time in seconds (relative to the time the packet is sent) that addresses generated from the prefix via stateless address autoconfiguration remain preferred. The symbolic value infinity represents infinity (i.e. a value of all one bits (0xffffffff)). See RFC 4862.
 
    Note: RFC4861's suggested default value is significantly longer: 7 days.
 
    Default: 14400 seconds (4 hours)
|-
|-
| AdvRDNSSLifetime ||  
| AdvRDNSSLifetime || AdvRDNSSLifetime seconds|infinity;
    The maximum duration how long the RDNSS entries are used for name resolution. A value of 0 means the nameserver should no longer be used. The maximum duration how long the RDNSS entries are used for name resolution. A value of 0 means the nameserver should no longer be used. The value, if not 0, must be at least MaxRtrAdvInterval. To ensure stale RDNSS info gets removed in a timely fashion, this should not be greater than 2*MaxRtrAdvInterval.
 
    Default: 2*MaxRtrAdvInterval
|-
|-
| AdvDNSSLLifetime ||  
| AdvDNSSLLifetime ||  
|-
|-
| AdvRouteLifetime ||  
| AdvRouteLifetime || AdvRouteLifetime seconds|infinity
 
    The lifetime associated with the route in units of seconds. The symbolic value infinity represents infinity (i.e. a value of all one bits (0xffffffff)).
 
    Default: 3 * MaxRtrAdvInterval
|-
|-
| AdvLinkMTU ||  
| AdvLinkMTU || AdvLinkMTU integer
 
    The MTU option is used in router advertisement messages to insure that all nodes on a link use the same MTU value in those cases where the link MTU is not well known.
 
    If specified, i.e. not 0, must not be smaller than 1280 and not greater than the maximum MTU allowed for this link (e.g. ethernet has a maximum MTU of 1500. See RFC 4864).
 
    Default: 0
|-
|-
| AdvDeprecatePrefix ||  
| AdvDeprecatePrefix || AdvLinkMTU integer
 
    The MTU option is used in router advertisement messages to insure that all nodes on a link use the same MTU value in those cases where the link MTU is not well known.
 
    If specified, i.e. not 0, must not be smaller than 1280 and not greater than the maximum MTU allowed for this link (e.g. ethernet has a maximum MTU of 1500. See RFC 4864).
 
    Default: 0
|}
|}



Version vom 19. Mai 2025, 19:09 Uhr

IPv6/Router/Advertisement

Beschreibung

Router Advertisement

IPv6-Router machen sich am Link bekannt

  • Dabei liefert er auch Informationen zu den verwendeten Präfixen mit, insbesondere zu den Präfixen für die er selbst zuständig ist
  • Eine solche Information wird Router Advertisement genannt
  • Router Advertisements sind Teil von NDP und werden, wie von NDP gewohnt, über ICMPv6 transportiert
  • Wir werden router dazu bewegen, solche Router Advertisements am Link internal auszusenden

Router Advertisement aufzeichnen

Router Advertisement nach Minimalkonfiguration
Router Advertisements auf dem Link entdecken
  • Wir starten Wireshark auf linux und lassen ihn auf eth0 lauschen
  • Spätestens nach 15 Sekunden sollte das erste Router Advertisement aufgefangen werden
  • Das werden wir uns nun genauer anschauen

IPv6-Header des Router Advertisements

IPv6-Header des Paketes
  • Das Feld Next Header verweist auf ICMPv6, dem Transportprotokoll von NDP
  • Folgerichtig ist das Hop Limit auf 255 gesetzt
  • Die Quelladresse ist die Link-local Address von eth1, was von RFC/2461 so vorgeschrieben wird
  • Die Zieladresse für periodisch versandte Router Advertisements ist die All Nodes Multicast Address ff02::1
  • Ihr Multicast Scope ist, das haben wir bereits gelernt, an der vierten hexadezimalen Stelle verzeichnet
  • Hier handelt es sich um den Scope Link, da wir an vierter Stelle eine 2 finden
  • Von den Flags, an dritter hexadezimaler Stelle zu finden, ist keines gesetzt
  • Denn nur wenn kein Flag gesetzt ist, kann an die dritte hexadezimale Stelle 0 lauten
  • Somit ist auch das TransientFlag nicht gesetzt
  • Daher können wir uns sicher sein, dass es sich bei dieser Multicast Address um eine Well-known Multicast Address handelt
Scope: Node
Adresse, Präfix
Nutzung
ff01::1 Alle Nodes
ff01::2 Alle Router
ff01::fb Multicast-DNS
Scope: Link
Adresse, Präfix m
Nutzung
ff02::1 Alle Nodes
ff02::2 Alle Router
ff02::b Mobile Agents (Mobile IPv6)
ff02::f Universal Plug and Play
ff02::16 Alle MLDv2-fähigen Router
ff02::6a Alle Multicast-Abonnenten
ff02::fb Multicast-DNS
ff02::1:2 Alle DHCP-Agents
ff02::1:ff00:0/104 Solicited Node Multicast Address
Scope: Site
Adresse, Präfix
Nutzung
ff05::2 Alle Router
ff05::1:3 Alle DHCP-Server
ff05::fb Multicast-DNS
Scope: Variabel (X)
Adresse, Präfix
Nutzung
ff0X::fb Multicast-DNS
ff0X::101 NTP
ff0X::db8:0:0/96 Dokumentation

Router Advertisement Daemon

IPv6/Router/Advertisement/Daemon

Angepasstes Router Advertisement

Minimalkonfiguration anpassen
  • Die Router Advertisements sollen weiterhin in Abständen von mindestens 15 Sekunden ausgesendet werden, es sollen aber nie mehr als 60 Sekunden zwischen ihnen liegen
  • Das Hop Limit und die Flags erhalten Standardwerte, diese sollen zur Übung dennoch in der Konfigurationsdatei vermerkt werden
  • Der Router soll mit mittlerer Priorität als DefaultRouter angepriesen werden
  • Da der Tunnel in der Standardkonfiguration eine MTU von 1280 aufweist, propagieren wir diese MTU auf dem Link
  • Das Präfix soll mit gesetzten Flags für On-Link und Autonomous Address Autoconfiguration verteilt werden
  • Generierte Adressen sollen eine Stunde lang gültig sein und für eine halbe Stunde bevorzugt werden
  • Natürlich darf auch die Source Link-layer Address nicht fehlen

Radvd konfigurieren

Versuchen Sie mithilfe des Kommandos man radvd.conf das eben beschriebene Router Advertisement zu konfigurieren. Die Lösung:

Angepasste Konfiguration von Radvd

/etc/radvd.conf

Angepasstes Router Advertisement
interface eth1 {
 AdvSendAdvert on ;
 MinRtrAdvInterval 15;
 MaxRtrAdvInterval 6 ;
 AdvCurHopLimit 64;
 AdvManagedFlag off ;
 AdvOtherConfigFlag off ;
 AdvMobRtrSupportFlag off ;
 AdvDefaultPreference medium ;
 AdvDefaultLifetime 3 ;
 AdvReachableTime ;
 AdvRetransTimer ;
 AdvLinkMTU 128 ;

 prefix 2a01:198:200:8a23::/64 {
  AdvOnLink on ;
  AdvAutonomous on ;
  AdvRouterAddr off ;
  AdvValidLifetime 36 ;
  AdvPreferredLifetime 18
  };
 AdvSourceLLAddress on ;
};

Zum Anwenden der geänderten Konfiguration starten wir Radvd neu:

root@router :~# service radvd restart
Stopping radvd : radvd
Starting radvd : radvd

Das neue Router Advertisement fangen wir ebenfalls mit Wireshark auf linux auf

Optionen

Wert Beschreibung
AdvDefaultLifetime AdvDefaultLifetime seconds

The lifetime associated with the default router in units of seconds. The maximum value corresponds to 18.2 hours. A lifetime of 0 indicates that the router is not a default router and should not appear on the default router list. The router lifetime applies only to the router's usefulness as a default router; it does not apply to information contained in other message fields or options. Options that need time limits for their information include their own lifetime fields.

   Must be either zero or between MaxRtrAdvInterval and 9000 seconds.
   Default: 3 * MaxRtrAdvInterval (Minimum 1 second). 
AdvValidLifetime infinity
   The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination. The symbolic value infinity represents infinity (i.e. a value of all one bits (0xffffffff)). The valid lifetime is also used by RFC 4862.
   Note that clients will ignore AdvValidLifetime of an existing prefix if the lifetime is below two hours, as required in RFC 4862 Section 5.5.3 point e).
   Note: RFC4861's suggested default value is significantly longer: 30 days.
   Default: 86400 seconds (1 day) 
AdvPreferredLifetime infinity
   The length of time in seconds (relative to the time the packet is sent) that addresses generated from the prefix via stateless address autoconfiguration remain preferred. The symbolic value infinity represents infinity (i.e. a value of all one bits (0xffffffff)). See RFC 4862.
   Note: RFC4861's suggested default value is significantly longer: 7 days.
   Default: 14400 seconds (4 hours) 
AdvRDNSSLifetime infinity;
   The maximum duration how long the RDNSS entries are used for name resolution. A value of 0 means the nameserver should no longer be used. The maximum duration how long the RDNSS entries are used for name resolution. A value of 0 means the nameserver should no longer be used. The value, if not 0, must be at least MaxRtrAdvInterval. To ensure stale RDNSS info gets removed in a timely fashion, this should not be greater than 2*MaxRtrAdvInterval.
   Default: 2*MaxRtrAdvInterval
AdvDNSSLLifetime
AdvRouteLifetime infinity
   The lifetime associated with the route in units of seconds. The symbolic value infinity represents infinity (i.e. a value of all one bits (0xffffffff)).
   Default: 3 * MaxRtrAdvInterval 
AdvLinkMTU AdvLinkMTU integer
   The MTU option is used in router advertisement messages to insure that all nodes on a link use the same MTU value in those cases where the link MTU is not well known.
   If specified, i.e. not 0, must not be smaller than 1280 and not greater than the maximum MTU allowed for this link (e.g. ethernet has a maximum MTU of 1500. See RFC 4864).
   Default: 0 
AdvDeprecatePrefix AdvLinkMTU integer
   The MTU option is used in router advertisement messages to insure that all nodes on a link use the same MTU value in those cases where the link MTU is not well known.
   If specified, i.e. not 0, must not be smaller than 1280 and not greater than the maximum MTU allowed for this link (e.g. ethernet has a maximum MTU of 1500. See RFC 4864).
   Default: 0