IPv6-Stateless autoconfiguration
时间:2010-09-25 来源:lqmartin
0 Stateless autoconfiguration
Auto Configuration
Stateless
Uses Neighbor Discovery Router Advertisements
Stateful
Uses DHCPv6 Service
Router Advertisements àRAàAre sent periodically and on request, by routers on all their configured interface , an RA is sent to the all-nodes multicast addresses, following is the information that may be contained in the message .
Ø One or many prefixes that can be used on the link, this enables stateless autoconfiguration of the hosts, these prefixes must be /64 for stateless autoconfig
Ø Lifetime of the prefixes, by default, in Cisco IOS, the lifetime is infinite
Ø Flags indicating the kind of autoconfiuration can be done by hosts
Ø Default router information: existence and lifetime
Ø Other types of information for hosts including default MTU and hop count
By sending prefixed, an RA enables the autoconfiguration of hosts , by assigning lifetimes to prefixes, an RA enables the renumbering of hosts since an old-deprecated prefix will have a lifetime decreased to zero ,and the new prefix will have a normal lifetime
Neighbor Discovery parameters
Ø Default router
Ø IPv6 network prefix
Ø Lifetime of advertisement
The router plays a key role in host configuration of an IPv6 network, an IPv6 router uses the neighbor discovery protocol to periodically advertise information to the all-nodes multicast address (FF01::1).
The router advertisements contain parameters thant can be adjusted on the router, these parameters are specific to the interface where they are configured , and consist of :
Ø the time interval between neighbor solocitations used by IPv6 nodes and the routers
Ø the interval between periodic router advertisements
Ø the lifetime of the router advertisement
Ø the lifetime of the neighbor reachability cache
Ø the network prefix advertisement used by host auto-configuration
by default , router advertisement is automatically activated on IPv6 enables Ethernet and FDDI interfaces when the ipv6 unicast-routing global command is configured , router advertisement can be deactivated or activated for each individual interface
the router advertisements parameters can be changed from their default values, but the advertised prefix length must be 64 for auto-configuration to work
hosts can solicit router to send advertisements by sending a neighbor discovery router solicitation
Neighbor Discovery-----Router Solicitations
An RA can be sent immediately following a router solicitation, routers solicitations are sent by hosts at boot time to ask routers to send an immediate RA on the local link so the host can receive the autoconfiguration information without waiting for the next scheduled RA,
The RS message is defined as the following
ICMP type =133
Source address is unspecified address
Destination address is the all-routers multicast address with the link-local scope
In the case of an answer to an RS, the destination address of the RA is the unicast address of the requestor
In order to avoid flooding , RS should only be sent at boot time and only three times, this avoids flooding of RS packets in the absence of a router on the network .
1 Renumbering
RA packet definitions:
ICMP type =134
Src=router link-local address
Dst=all-nodes multicast address
Data=2 Prefixes
Renumbering of nodes is achieved by sending router advertisements. These messages contain both the old prefix and the new prefix. By decreasing the lifetime of the old prefix, this tells the nodes to use the new prefix while still keeping their current connections opened on the old prefix. During that period of time, nodes have two unicast addresses to use. When the old prefix is no longer used, the RA will only include the new prefix.
If stateless autoconfiguration is not used, then other ways of renumbering should be used. Autoconfiguration greatly helps the renumbering process.
Renumbering of a whole site also means the routers need to be renumbered. A router renumbering protocol is defined for that purpose in RFC2894 "Router Renumbering for IPv6".
2 Cisco IOS Neighbor Discovery Command Syntax
Router(config-if)#
ipv6 nd prefix <prefix>|default .
By default, all /64 prefixes configured as addresses on the interface will be advertised in router advertisements, the ipv6 nd prefix interface command is used to.
ipv6 nd prefix prefix <prefix> | default
[ [<valid-lifetime> <preferred-lifetime>] |
[at <valid-date> <preferred-date>]
[off-link] [no-autoconfig] ]
For example:
• ipv6 nd prefix 2001:db8:c18:2::/64 43200 43200
The prefix specified is 2001:db8:c18:2::/64. If the default keyword is used instead of the prefix, the specified parameters will apply to all the prefixes.
This prefix will be advertised on the link with 43200 seconds as the valid and preferred lifetime. A host on the link using address autoconfiguration will autoconfigure its IPv6 address from the advertised prefix. The valid and preferred lifetime counters will be set to the value specified in the router advertisement (43200 seconds). Since the router sends periodic router advertisements, the valid and preferred lifetime counters on the host will be periodically reset to the advertised values. Instead of specifying an explicit lifetime, a date can be set for the prefix expiration. The valid and preferred lifetimes are then counted down in real time and when the expiration date is reached, the prefix will no longer be advertised.
Usually, an announced prefix will be a valid on-link prefix, a node sending traffic to such addresses will consider the destination to be on the same link. If the off-link parameter is used for a given prefix, then announcement makes no statement about the on-link or off-link property of the prefix.
The no-autoconfig parameter indicates that the prefix cannot be used for address autoconfiguration.
By default, both on-link and autoconfig parameters are set.
The ipv6 nd suppress-ra interface command will suppress router advertisements from being sent.
3 Discovery Defaults
R1:
interface ethernet0
ipv6 address 2001:db8:c18:1::1/64
ipv6 nd prefix 2001:db8:c18:1::/64 43200 43200
R2:
interface ethernet0
ipv6 address 2001:db8:c18:1::2/64
ipv6 nd prefix 2001:db8:c18:1::/64 43200 43200
interface ethernet1
ipv6 address 2001:db8:c18:2::1/64
ipv6 nd prefix 2001:db8:c18:2::/64 43200 43200
in this example, two IPv6 networks are configured and interconnected, IPv6 hosts on network LAN1 are autoconfigured using router advertisements from router1 while hosts from LAN2 use router advertisements from Router2, router1 is connected to the IPv6 Internet and is considered the default router for the site
By default, the router will advertise all prefix(site local and global) configured on each interface, many parameters such as the router advertisement lifetime, time interval between router advertisements and other neighbor discovery parameters use a default value when not explicitly defined
One can override the prefix advertisement default values, in which case only the specified prefix advertisements will be sent in router advertisements .
. In the example, the prefix advertisements parameters are overridden from their default values using the ipv6 nd prefix-advertisement interface command.