<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type="text/xsl" href="" ?>
<!--  ______________________________________________________________
Template:
Author:   Elwyn Davies  
Description:  draft-ietf-v6ops-icmpv6-filtering-recs-02, Version 001, 8 July 2006
Changes:
rec-02 -> rec-03
Ref to gont-tcpm-attacks changed to ietf-tcpm-attacks.
Fixed various items relevant to IESG discusses:
- establishment -> establishment and maintenance of communications in various places
- dicussed different deployment locations of firewalls and how this affects rules
- various editorial fixes
rec-01 -> rec-02
rec-00 -> rec-01
Reversed change to RFC2461 - not yet published
hop count -> hop limit (global)
bcp-01 -> recs-00
A number of spelling and editorial fixes.
Changed refs from RFC2461 to RFC4311 and RFC2463 to RFC4443
00 -> 01
Added Appendix B
Fixed refs
00/001->00/002
Minor editorial fixes.. released as version 00
00/001: Initial version creatred from material removed from v6ops Security Overview draft, email
from Janos Mohacsi and public sources
___________________________________________________________________
-->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY ndash "&#8211;">
<!ENTITY mdash "&#8212;">

<!ENTITY rfc1981 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1981.xml">
<!ENTITY rfc2460 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2460.xml">
<!ENTITY rfc2461 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2461.xml">
<!ENTITY rfc2462 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2462.xml">
<!ENTITY rfc4443 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4443.xml">
<!ENTITY rfc2710 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2710.xml">
<!ENTITY rfc2894 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2894.xml">
<!ENTITY rfc3122 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3122.xml">
<!ENTITY rfc3590 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3590.xml">
<!ENTITY rfc3775 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3775.xml">
<!ENTITY rfc3810 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3810.xml">
<!ENTITY rfc3971 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3971.xml">
<!ENTITY rfc4065 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4065.xml">
<!ENTITY rfc4620 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4620.xml">
<!ENTITY rfc4286 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4286.xml">
<!ENTITY rfc3041 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3041.xml">
<!ENTITY rfc4380 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4380.xml">
]>
<?rfc toc="yes"?>
<?rfc strict="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<rfc category="info" number="4890">
  <front>
    <title abbrev="ICMPv6 Filtering Recommendations">Recommendations for
    Filtering ICMPv6 Messages in Firewalls</title>

    <author fullname="Elwyn B. Davies" initials="E.B." surname="Davies">
      <organization>Consultant</organization>

      <address>
        <postal>
          <street></street>

          <city>Soham</city>

          <region>Cambs</region>

          <code></code>

          <country>UK</country>
        </postal>

        <phone>+44 7889 488 335</phone>

        <email>elwynd@dial.pipex.com</email>
      </address>
    </author>

    <author fullname="Janos Mohacsi" initials="J." surname="Mohacsi">
      <organization>NIIF/HUNGARNET</organization>

      <address>
        <postal>
          <street>Victor Hugo u. 18-22</street>

          <city>Budapest</city>

          <region></region>

          <code>H-1132</code>

          <country>Hungary</country>
        </postal>

        <phone>+36 1 4503070</phone>

        <email>mohacsi@niif.hu</email>
      </address>
    </author>

    <date month="May" year="2007" />

    <area>Operations and Management</area>

    <workgroup>IPv6 Operations</workgroup>

    <keyword>IETF</keyword>

    <keyword>IPv6</keyword>

    <keyword>IPv6 Operations</keyword>

    <keyword>Security</keyword>

    <keyword>Filter</keyword>

    <keyword>Firewall</keyword>

    <keyword>ICMPv6</keyword>

    <abstract>
      <t>In networks supporting IPv6, the Internet Control Message Protocol
      version 6 (ICMPv6) plays a fundamental role with a large number of
      functions, and a correspondingly large number of message types and
      options. ICMPv6 is essential to the functioning of IPv6, but there are a
      number of security risks associated with uncontrolled forwarding of
      ICMPv6 messages. Filtering strategies designed for the corresponding
      protocol, ICMP, in IPv4 networks are not directly applicable, because
      these strategies are intended to accommodate a useful auxiliary protocol
      that may not be required for correct functioning.</t>

      <t>This document provides some recommendations for ICMPv6 firewall
      filter configuration that will allow propagation of ICMPv6 messages that
      are needed to maintain the functioning of the network but drop messages
      that are potential security risks.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>When a network supports IPv6 <xref target="RFC2460"></xref>, the
      Internet Control Message Protocol version 6 (ICMPv6) <xref
      target="RFC4443"></xref> plays a fundamental role including being an
      essential component in establishing and maintaining communications both
      at the interface level and for sessions to remote nodes. This means that
      overly aggressive filtering of ICMPv6 by firewalls may have a
      detrimental effect on the establishment and maintenance of IPv6
      communications. On the other hand, allowing indiscriminate passage of
      all ICMPv6 messages can be a major security risk. This document
      recommends a set of rules that seek to balance effective IPv6
      communication against the needs of site security.</t>

      <t>In a few cases, the appropriate rules will depend on whether the
      firewall is protecting<list style="symbols">
          <t>an individual host,</t>

          <t>an end site where all ICMPv6 messages originate or terminate
          within the site, or</t>

          <t>a transit site such as an Internet Service Provider's site where
          some ICMPv6 messages will be passing through.</t>
        </list>The document suggests alternative rules appropriate to each
      situation where it is relevant. It also notes some situations where
      alternative rules could be adopted according to the nature of the work
      being carried out on the site and consequent security policies. In
      general, Internet Service Providers should not filter ICMPv6 messages
      transiting their sites so that all the necessary communication elements
      are available to their customers to decide and filter according to their
      policy.</t>

      <t>Readers familiar with ICMPv6 can skip to the recommended filtering
      rules in <xref target="filter-recs"></xref> and an example configuration
      script for Linux Netfilter in <xref target="script"></xref>.</t>

      <t>ICMPv6 has a large number of functions defined in a number of
      sub-protocols, and there are a correspondingly large number of messages
      and options within these messages. The functions currently defined fall
      into a number of categories: <list hangIndent="6" style="hanging">
          <t hangText="Returning Error Messages"><list hangIndent="3"
              style="symbols">
              <t>Returning error messages to the source if a packet could not
              be delivered. Four different error messages, each with a number
              of sub-types, are specified in <xref
              target="RFC4443"></xref>.</t>
            </list></t>

          <t hangText="Connection Checking"><list hangIndent="3"
              style="symbols">
              <t>Simple monitoring of connectivity through echo requests and
              responses used by the ping and traceroute utilities. The Echo
              Request and Echo Response messages are specified in <xref
              target="RFC4443"></xref>.</t>
            </list></t>

          <t hangText="Discovery Functions"><list hangIndent="3"
              style="symbols">
              <t>Finding neighbors (both routers and hosts) connected to the
              same link and determining their IP and link layer addresses.
              These messages are also used to check the uniqueness of any
              addresses that an interface proposes to use (Duplicate Address
              Detection &ndash; DAD). Four messages &mdash; Neighbor
              Solicitation (NS), Neighbor Advertisement (NA), Router
              Solicitation (RS) and Router Advertisement (RA) &mdash; are
              specified in <xref target="RFC2461"></xref>.</t>

              <t>Ensuring that neighbors remain reachable using the same IP
              and link layer addresses after initial discovery (Neighbor
              Unreachability Discovery &ndash; NUD) and notifying neighbors of
              changes to link layer addresses. Uses NS and NA <xref
              target="RFC2461"></xref>.</t>

              <t>Finding routers and determining how to obtain IP addresses to
              join the subnets supported by the routers. Uses RS and RA <xref
              target="RFC2461"></xref>.</t>

              <t>If stateless autoconfiguration of hosts is enabled,
              communicating prefixes and other configuration information
              (including the link Maximum Transmission Unit (MTU) and
              suggested hop limit default) from routers to hosts. Uses RS and
              RA <xref target="RFC2462"></xref>.</t>

              <t>When using SEcure Neighbor Discovery (SEND) to authenticate a
              router attached to a link, the Certificate Path Solicitation and
              Advertisement messages specified in <xref
              target="RFC3971"></xref> are used by hosts to retrieve the
              certificates documenting the trust chain between a trust anchor
              and the router from the router.</t>

              <t>Determining the MTU along a path. The Packet Too Big error
              message is essential to this function <xref
              target="RFC1981"></xref>.</t>

              <t>Providing a means to discover the IPv6 addresses associated
              with the link layer address of an interface (the inverse of
              Neighbor Discovery, where the link layer address is 
<vspace blankLines="0"/>
<?rfc needLines="4"?>
discovered
              given an IPv6 address). Two messages, Inverse Neighbor Discovery
              Solicitation and Advertisement messages, are specified in <xref
              target="RFC3122"></xref>.</t>

              <t>Communicating which multicast groups have listeners on a link
              to the multicast capable routers connected to the link. Uses
              messages Multicast Listener Query, Multicast Listener Report
              (two versions), and Multicast Listener Done (protocol version 1
              only) as specified in Multicast Listener Discovery MLDv1 <xref
              target="RFC2710"></xref> and MLDv2 <xref
              target="RFC3810"></xref>.</t>

              <t>Discovering multicast routers attached to the local link.
              Uses messages Multicast Router Advertisement, Multicast Router
              Solicitation, and Multicast Router Termination as specified in
              Multicast Router Discovery <xref target="RFC4286"></xref>.</t>
            </list></t>

          <t hangText="Reconfiguration Functions"><list hangIndent="3"
              style="symbols">
              <t>Redirecting packets to a more appropriate router on the local
              link for the destination address or pointing out that a
              destination is actually on the local link even if it is not
              obvious from the IP address (where a link supports multiple
              subnets). The Redirect message is specified in <xref
              target="RFC2461"></xref>.</t>

              <t>Supporting renumbering of networks by allowing the prefixes
              advertised by routers to be altered. Uses NS, NA, RS and RA
              together with the Router Renumbering message specified in <xref
              target="RFC2894"></xref>.</t>
            </list></t>

          <t hangText="Mobile IPv6 Support"><list hangIndent="3"
              style="symbols">
              <t>Providing support for some aspects of Mobile IPv6 especially
              dealing with the IPv6 Mobile Home Agent functionality provided
              in routers and needed to support a Mobile node homed on the
              link. The Home Agent Address Discovery Request and Reply and the
              Mobile Prefix Solicitation and Advertisement messages are
              specified in <xref target="RFC3775"></xref>.</t>
            </list></t>

          <t hangText="Experimental Extensions"><list hangIndent="3"
              style="symbols">
              <t>An experimental extension to ICMPv6 specifies the ICMP Node
              Information Query and Response messages that can be used to
              retrieve some basic information about nodes <xref
              target="RFC4620"></xref>.</t>

              <t>The SEAmless IP MOBility (SEAMOBY) working group specified a
              pair of experimental protocols that use an ICMPv6 message
              specified in <xref target="RFC4065"></xref> to help in locating
              an access router and moving the attachment point of a mobile
              node from one access router to another.</t>
            </list></t>
        </list></t>

      <?rfc needLines="4"?>

      <t>Many of these messages should only be used in a link-local context
      rather than end-to-end, and filters need to be concerned with the type
      of addresses in ICMPv6 packets as well as the specific source and
      destination addresses.</t>

      <t>Compared with the corresponding IPv4 protocol, ICMP, ICMPv6 cannot be
      treated as an auxiliary function with packets that can be dropped in
      most cases without damaging the functionality of the network. This means
      that firewall filters for ICMPv6 have to be more carefully configured
      than was the case for ICMP, where typically a small set of blanket rules
      could be applied.</t>
    </section>

    <section anchor="classify" title="Classifying ICMPv6 Messages">
      <section anchor="msg-type"
               title="Error and Informational ICMPv6 Messages">
        <t>ICMPv6 messages contain an eight-bit Type field interpreted as an
        integer between 0 and 255. Messages with Type values less than or
        equal to 127 are Error messages. The remainder are Informational
        messages. In general terms, Error messages with well-known
        (standardized) Type values would normally be expected to be allowed to
        be sent to or pass through firewalls, and may be essential to the
        establishment and maintenance of communications (see <xref
        target="comms-role"></xref>) whereas Informational messages will
        generally be the subject of policy rules, and those passing through
        end site firewalls can, in many but by no means all cases, be dropped
        without damaging IPv6 communications.</t>
      </section>

      <section anchor="addressing" title="Addressing of ICMPv6">
        <t>ICMPv6 messages are sent using various kinds of source and
        destination address types and scopes. The source address is usually a
        unicast address, but during address autoconfiguration message
        exchanges, the unspecified address (::) is also used as a source
        address <xref target="RFC2462"></xref>.</t>

        <t>Multicast Listener Discovery (MLD) Report and Done messages are
        sent with a link-local address as the IPv6 source address, if a valid
        address is available on the interface. If a valid link-local address
        is not available (e.g., one has not been configured), the message is
        sent with the unspecified address (::) as the IPv6 source address.
        Subsequently, the node will generate new MLD Report messages with
        proper link-local source address once it has been configured <xref
        target="RFC3590"></xref>.</t>

        <t>The destination address can be either a well-known multicast
        address, a generated multicast address such as the solicited-node
        multicast address, an anycast address, or a unicast address. While
        many ICMPv6 messages use multicast addresses most of the time, some
        also use unicast addresses. For instance, the Router Advertisement
        messages are sent to the all-nodes multicast address when unsolicited,
        but can also be sent to a unicast address in response to a specific
        Router Solicitation, although this is rarely seen in current
        implementations.</t>
      </section>

      <section anchor="topology" title="Network Topology and Address Scopes">
        <t>ICMPv6 messages can be classified according to whether they are
        meant for end-to-end communications or local communications within a
        link. There are also messages that we can classify as 'any-to-end',
        which can be sent from any point within a path back to the source;
        typically, these are used to announce an error in processing the
        original packet. For instance, the address resolution messages are
        solely for local communications <xref target="RFC2461"></xref>,
        whereas the Destination Unreachable messages are any-to-end in nature.
        Generally, end-to-end and any-to-end messages might be expected to
        pass through firewalls depending on policies but local communications
        must not.</t>

        <t>Local communications will use link-local addresses in many cases
        but may also use global unicast addresses when configuring global
        addresses, for example. Also, some ICMPv6 messages used in local
        communications may contravene the usual rules requiring compatible
        scopes for source and destination addresses.</t>
      </section>

      <section anchor="comms-role"
               title="Role in Establishing and Maintaining Communication">
        <t>Many ICMPv6 messages have a role in establishing or maintaining
        communications to and from the firewall and such messages have to be
        accepted by firewalls for local delivery. Generally, a firewall will
        also be acting as a router so that all the messages that might be used
        in configuring a router interface need to be accepted and generated.
        These messages should not transit through a firewall that is also
        acting as a router as they are normally intended for use within a
        link.</t>

        <t>On the other hand, most ICMPv6 error messages traveling end-to-end
        or any-to-end are essential to the establishment and maintenance of
        communications. These messages must be passed through firewalls and
        might also be sent to and from firewalls to assist with establishment
        and maintenance of communications. For example, the Packet Too Big
        error message is needed to determine the MTU along a path both when a
        communication session is established initially and later if the path
        is rerouted during the session.</t>

        <t>The remaining ICMPv6 messages that are not associated with
        communication establishment or maintenance will normally be
        legitimately attempting to pass through a firewall from inside to out
        or vice versa, but in most cases decisions as to whether or not to
        allow them to pass can be made on the basis of local policy without
        interfering with IPv6 communications.</t>

        <t>The filtering rules for the various message roles will generally be
        different.</t>
      </section>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>This memo recommends filtering configurations for firewalls designed
      to minimize the security vulnerabilities that can arise in using the
      many different sub-protocols of ICMPv6 in support of IPv6
      communication.</t>

      <t>A major concern is that it is generally not possible to use IPsec or
      other means to authenticate the sender and validate the contents of many
      ICMPv6 messages. To a large extent, this is because a site can
      legitimately expect to receive certain error and other messages from
      almost any location in the wider Internet, and these messages may occur
      as a result of the first message sent to a destination. Establishing
      security associations with all possible sources of ICMPv6 messages is
      therefore impossible.</t>

      <t>The inability to establish security associations to protect some
      messages that are needed to establish and maintain communications means
      that alternative means have to be used to reduce the vulnerability of
      sites to ICMPv6-based attacks. The most common way of doing this is to
      establish strict filtering policies in site firewalls to limit the
      unauthenticated ICMPv6 messages that can pass between the site and the
      wider Internet. This makes control of ICMPv6 filtering a delicate
      balance between protecting the site by dropping some of the ICMPv6
      traffic passing through the firewall and allowing enough of the traffic
      through to make sure that efficient communication can be
      established.</t>

      <t>SEND <xref target="RFC3971"></xref> has been specified as a means to
      improve the security of local ICMPv6 communications. SEND sidesteps
      security association bootstrapping problems that would result if IPsec
      was used. SEND affects only link-local messages and does not limit the
      filtering that firewalls can apply, and its role in security is
      therefore not discussed further in this document.</t>

      <t>Firewalls will normally be used to monitor ICMPv6 to control the
      following security concerns:</t>

      <?rfc needLines="5"?>

      <section anchor="dos" title="Denial-of-Service Attacks">
        <t>ICMPv6 can be used to cause a denial of service (DoS) in a number
        of ways, including simply sending excessive numbers of ICMPv6 packets
        to destinations in the site and sending error messages that disrupt
        established communications by causing sessions to be dropped. Also, if
        spurious communication establishment or maintenance messages can be
        infiltrated onto a link, it might be possible to invalidate legitimate
        addresses or disable interfaces.</t>
      </section>

      <section anchor="probe" title="Probing">
        <t>A major security consideration is preventing attackers from probing
        the site to determine the topology and identify hosts that might be
        vulnerable to attack. Carefully crafted but, often, malformed messages
        can be used to provoke ICMPv6 responses from hosts thereby informing
        attackers of potential targets for future attacks. However, the very
        large address space of IPv6 makes probing a less effective weapon as
        compared with IPv4 provided that addresses are not allocated in an
        easily guessable fashion. This subject is explored in more depth in
        <xref target="SCAN-IMP"></xref>.</t>
      </section>

      <section anchor="redirect" title="Redirection Attacks">
        <t>A redirection attack could be used by a malicious sender to perform
        man-in-the-middle attacks or divert packets either to a malicious
        monitor or to cause DoS by blackholing the packets. These attacks
        would normally have to be carried out locally on a link using the
        Redirect message. Administrators need to decide if the improvement in
        efficiency from using Redirect messages is worth the risk of malicious
        use. Factors to consider include the physical security of the link and
        the complexity of addressing on the link. For example, on an open
        wireless link, redirection would be a serious hazard due to the lack
        of physical security. On the other hand, with a wired link in a secure
        building with complex addressing and redundant routers, the efficiency
        gains might well outweigh the small risk of a rogue node being
        connected.</t>
      </section>

      <section anchor="renumber" title="Renumbering Attacks">
        <t>Spurious Renumbering messages can lead to the disruption of a site.
        Although Renumbering messages are required to be authenticated with
        IPsec, so that it is difficult to carry out such attacks in practice,
        they should not be allowed through a site boundary firewall. On the
        other hand, a site may employ multiple "layers" of firewalls. In this
        case, Renumbering messages might be expected to be allowed to transit
        interior firewalls but not pass across the outer boundary.</t>
      </section>

      <?rfc needLines="5"?>

      <section title="Problems Resulting from ICMPv6 Transparency">
        <t>Because some ICMPv6 error packets need to be passed through a
        firewall in both directions, malicious users can potentially use these
        messages to communicate between inside and outside, bypassing
        administrative inspection. For example, it might be possible to carry
        out a covert conversation through the payload of ICMPv6 error messages
        or tunnel inappropriate encapsulated IP packets in ICMPv6 error
        messages. This problem can be alleviated by filtering ICMPv6 errors
        using a deep packet inspection mechanism to ensure that the packet
        carried as a payload is associated with legitimate traffic to or from
        the protected network.</t>
      </section>
    </section>

    <section anchor="filter-recs" title="Filtering Recommendations">
      <t>When designing firewall filtering rules for ICMPv6, the rules can be
      divided into two classes:<list style="symbols">
          <t>Rules for ICMPv6 traffic transiting the firewall, with some minor
          variations for<list style="symbols">
              <t>firewalls protecting end sites or individual hosts, and</t>

              <t>firewalls protecting transit sites</t>
            </list></t>

          <t>Rules for ICMPv6 directed to interfaces on the firewall</t>
        </list>Firewalls integrated with an individual host ("end host
      firewalls") can be treated as end site firewalls, but the special
      considerations discussed in <xref target="bridge"></xref> may be
      relevant because the firewall is not a router.</t>

      <t>This section suggests some common considerations that should be borne
      in mind when designing filtering rules and then categorizes the rules
      for each class. The categories are:<list style="symbols">
          <t>Messages that must not be dropped: usually because establishment
          or maintenance of communications will be prevented or severely
          impacted.</t>

          <t>Messages that should not be dropped: administrators need to have
          a very good reason for dropping this category.</t>

          <t>Messages that may be dropped in firewall/routers, but these
          messages may already be targeted to drop for other reasons (e.g.,
          because they are using link-local addresses) or because the protocol
          specification would cause the messages to be rejected if they had
          passed through a router. Special considerations apply to transit
          traffic if the firewall is not a router as discussed in <xref
          target="bridge"></xref>.</t>

          <t>Messages that administrators may or may not want to drop
          depending on local policy.</t>

          <t>Messages that administrators should consider dropping (e.g., ICMP
          node information name lookup queries).</t>
        </list></t>

      <t>More detailed analysis of each of the message types can be found in
      <xref target="indiv-msgs"></xref>.</t>

      <section anchor="common" title="Common Considerations">
        <t>Depending on the classification of the message to be filtered (see
        <xref target="classify"></xref>), ICMPv6 messages should be filtered
        based on the ICMPv6 type of the message and the type (unicast,
        multicast, etc.) and scope (link-local, global unicast, etc.) of
        source and destination addresses. In some cases, it may be desirable
        to filter on the Code field of ICMPv6 error messages.</t>

        <t>Messages that can be authenticated on delivery, probably because
        they contain an IPsec AH header or ESP header with authentication, may
        be subject to less strict policies than messages that cannot be
        authenticated. In the remainder of this section, we are generally
        considering what should be configured for unauthenticated messages. In
        many cases, it is not realistic to expect more than a tiny fraction of
        the messages to be authenticated.</t>

        <t>Where messages are not essential to the establishment or
        maintenance of communications, local policy can be used to determine
        whether a message should be allowed or dropped.</t>

        <t>Depending on the capabilities of the firewall being configured, it
        may be possible for the firewall to maintain state about packets that
        may result in error messages being returned or about ICMPv6 packets
        (e.g., Echo Requests) that are expected to receive a specific
        response. This state may allow the firewall to perform more precise
        checks based on this state, and to apply limits on the number of
        ICMPv6 packets accepted incoming or outgoing as a result of a packet
        traveling in the opposite direction. The capabilities of firewalls to
        perform such stateful packet inspection vary from model to model, and
        it is not assumed that firewalls are uniformly capable in this
        respect.</t>

        <t>Firewalls that are able to perform deep packet inspection may be
        able to check the header fields in the start of the errored packet
        that is carried by ICMPv6 error messages. If the embedded packet has a
        source address that does not match the destination of the error
        message, the packet can be dropped. This provides a partial defense
        against some possible attacks on TCP that use spoofed ICMPv6 error
        messages, but the checks can also be carried out at the destination.
        For further information on these attacks see <xref
        target="ICMP-ATTACKS"></xref>.</t>

        <t>In general, the scopes of source and destination addresses of
        ICMPv6 messages should be matched, and packets with mismatched
        addresses should be dropped if they attempt to transit a router.
        However, some of the address configuration messages carried locally on
        a link may legitimately have mismatched addresses. Node
        implementations must accept these messages delivered locally on a
        link, and administrators should be aware that they can exist.</t>

        <t>ICMPv6 messages transiting firewalls inbound to a site may be
        treated differently depending on whether they are addressed to a node
        on the site or to some other node. For end sites, packets addressed to
        nodes not on the site should be dropped, but would generally be
        forwarded by firewalls on transit sites.</t>
      </section>

      <section anchor="bridge"
               title="Interaction of Link-Local Messages with Firewall/Routers and Firewall/Bridges">
        <t>Firewalls can be implemented both as IP routers (firewall/routers)
        and as link layer bridges (e.g., Ethernet bridges) that are
        transparent to the IP layer although they will actually be inspecting
        the IP packets as they pass through (firewall/bridges).</t>

        <t>Many of the messages used for establishment and maintenance of
        communications on the local link will be sent with link-local
        addresses for at least one of their source and destination. Routers
        conforming to the IPv6 standards will not forward these packets; there
        is no need to configure additional rules to prevent these packets
        traversing a firewall/router, although administrators may wish to
        configure rules that would drop these packets for insurance and as a
        means of monitoring for attacks. Also, the specifications of ICMPv6
        messages intended for use only on the local link specify various
        measures that would allow receivers to detect if the message had
        passed through a router, including:<list style="symbols">
            <t>Requiring that the hop limit in the IPv6 header is set to 255
            on transmission. Receivers verify that the hop limit is still 255,
            to ensure that the packet has not passed through a router.</t>

            <t>Checking that the source address is a link-local unicast
            address.</t>
          </list>Accordingly, it is not essential to configure firewall/router
        rules to drop out-of-specification packets of these types. If they
        have non-link-local source and destination addresses, allowing them to
        traverse the firewall/router, they would be rejected because of the
        checks performed at the destination. Again, firewall administrators
        may still wish to configure rules to log or drop such
        out-of-specification packets.</t>

        <t>For firewall/bridges, slightly different considerations apply. The
        physical links on either side of the firewall/bridge are treated as a
        single logical link for the purposes of IP. Hence, the link local
        messages used for discovery functions on the link must be allowed to
        transit the transparent bridge. Administrators should ensures that
        routers and hosts attached to the link containing the firewall/bridge
        are built to the correct specifications so that out-of-specification
        packets are actually dropped as described in the earlier part of this
        section.</t>

        <t>An end host firewall can generally be thought of as a special case
        of a firewall/bridge, but the only link-local messages that need to be
        allowed through are those directed to the host's interface.</t>
      </section>

      <section title="Recommendations for ICMPv6 Transit Traffic">
        <t>This section recommends rules that should be applied to ICMPv6
        traffic attempting to transit a firewall.</t>

        <section anchor="transit-must-pass"
                 title="Traffic That Must Not Be Dropped">
          <t>Error messages that are essential to the establishment and
          maintenance of communications: <?rfc subcompact="yes"?> <list
              style="symbols">
              <t>Destination Unreachable (Type 1) - All codes</t>

              <t>Packet Too Big (Type 2)</t>

              <t>Time Exceeded (Type 3) - Code 0 only</t>

              <t>Parameter Problem (Type 4) - Codes 1 and 2 only</t>
            </list></t>

          <t><xref target="parameter-problem"></xref> suggests some more
          specific checks that could be performed on Parameter Problem
          messages if a firewall has the necessary packet inspection
          capabilities.</t>

          <t>Connectivity checking messages:<list style="symbols">
              <t>Echo Request (Type 128)</t>

              <t>Echo Response (Type 129)</t>
            </list></t>

          <t>For Teredo tunneling <xref target="RFC4380"></xref> to IPv6 nodes
          on the site to be possible, it is essential that the connectivity
          checking messages are allowed through the firewall. It has been
          common practice in IPv4 networks to drop Echo Request messages in
          firewalls to minimize the risk of scanning attacks on the protected
          network. As discussed in <xref target="probe"></xref>, the risks
          from port scanning in an IPv6 network are much less severe, and it
          is not necessary to filter IPv6 Echo Request messages.</t>
        </section>

        <section anchor="transit-normally-pass"
                 title="Traffic That Normally Should Not Be Dropped">
          <t>Error messages other than those listed in <xref
          target="transit-must-pass"></xref>: <list style="symbols">
              <t>Time Exceeded (Type 3) - Code 1</t>

              <t>Parameter Problem (Type 4) - Code 0</t>
            </list></t>

          <t>Mobile IPv6 messages that are needed to assist mobility: <list
              style="symbols">
              <t>Home Agent Address Discovery Request (Type 144)</t>

              <t>Home Agent Address Discovery Reply (Type 145)</t>

              <t>Mobile Prefix Solicitation (Type 146)</t>

              <t>Mobile Prefix Advertisement (Type 147)</t>
            </list></t>

          <t>Administrators may wish to apply more selective rules as
          described in <xref target="mipv6"></xref> depending on whether the
          site is catering for mobile nodes that would normally be at home on
          the site and/or foreign mobile nodes roaming onto the site.</t>
        </section>

        <section title="Traffic That Will Be Dropped Anyway -- No Special Attention Needed">
          <t>The messages listed in this section are all involved with local
          management of nodes connected to the logical link on which they were
          initially transmitted. All these messages should never be propagated
          beyond the link on which they were initially transmitted. If the
          firewall is a firewall/bridge rather than a firewall/router, these
          messages should be allowed to transit the firewall as they would be
          intended for establishing communications between the two physical
          parts of the link that are bridged into a single logical link.</t>

          <t>During normal operations, these messages will have destination
          addresses, mostly link local but in some cases global unicast
          addresses, of interfaces on the local link. No special action is
          needed to filter messages with link-local addresses in a
          firewall/router. As discussed in <xref target="common"></xref>,
          these messages are specified so that either the receiver is able to
          check that the message has not passed through a router or it will be
          dropped at the first router it encounters.</t>

          <t>Administrators may also wish to consider providing rules in
          firewall/routers to catch illegal packets sent with hop limit = 1 to
          avoid ICMPv6 Time Exceeded messages being generated for these
          packets.</t>

          <?rfc needLines="5"?>

          <t>Address Configuration and Router Selection messages (must be
          received with hop limit = 255):<list style="symbols">
              <t>Router Solicitation (Type 133)</t>

              <t>Router Advertisement (Type 134)</t>

              <t>Neighbor Solicitation (Type 135)</t>

              <t>Neighbor Advertisement (Type 136)</t>

              <t>Redirect (Type 137)</t>

              <t>Inverse Neighbor Discovery Solicitation (Type 141)</t>

              <t>Inverse Neighbor Discovery Advertisement (Type 142)</t>
            </list></t>

          <t>Link-local multicast receiver notification messages (must have
          link-local source address):<list style="symbols">
              <t>Listener Query (Type 130)</t>

              <t>Listener Report (Type 131)</t>

              <t>Listener Done (Type 132)</t>

              <t>Listener Report v2 (Type 143)</t>
            </list></t>

          <t>SEND Certificate Path notification messages (must be received
          with hop limit = 255):<list style="symbols">
              <t>Certificate Path Solicitation (Type 148)</t>

              <t>Certificate Path Advertisement (Type 149)</t>
            </list></t>

          <t>Multicast Router Discovery messages (must have link-local source
          address and hop limit = 1):<list style="symbols">
              <t>Multicast Router Advertisement (Type 151)</t>

              <t>Multicast Router Solicitation (Type 152)</t>

              <t>Multicast Router Termination (Type 153)</t>
            </list></t>
        </section>

        <section title="Traffic for Which a Policy Should Be Defined">
          <t>The message type that the experimental Seamoby protocols are
          using will be expected to have to cross site boundaries in normal
          operation. Transit sites must allow these messages to transit the
          site. End site administrators should determine if they need to
          support these experiments and otherwise messages of this type should
          be dropped: <list style="symbols">
              <t>Seamoby Experimental (Type 150)</t>
            </list></t>

          <t>Error messages not currently defined by IANA:<list
              style="symbols">
              <t>Unallocated Error messages (Types 5-99 inclusive and 102-126
              inclusive)</t>

              <!-- [rfced] Should this be as below for 154-199 and 202-254?
"(Types 5-99 inclusive and 102-126 inclusive)"?
[ebd] Yes.. good idea.
-->
            </list></t>

          <t>The base ICMPv6 specification suggests that error messages that
          are not explicitly known to a node should be forwarded and passed to
          any higher-level protocol that might be able to interpret them.
          There is a small risk that such messages could be used to provide a
          covert channel or form part of a DoS attack. Administrators of end
          sites should be aware of this and determine whether they wish to
          allow these messages through the firewall. Firewalls protecting
          transit sites must allow all types of error messages to transit the
          site but may adopt different policies for error messages addressed
          to nodes within the site.</t>

          <t>All informational messages with types not explicitly assigned by
          IANA, currently:<list style="symbols">
              <t>Unallocated Informational messages (Types 154-199 inclusive
              and 202-254 inclusive).</t>
            </list></t>

          <t>Note that the base ICMPv6 specification requires that received
          informational messages with unknown types must be silently
          discarded. Transit sites must allow these messages to transit the
          site. End site administrators can either adopt a policy of allowing
          all these messages through the firewall, relying on end hosts to
          drop unrecognized messages, or drop all such messages at the
          firewall. Different policies could be adopted for inbound and
          outbound messages.</t>

          <t>If administrators choose to implement policies that drop
          currently unallocated error or informational messages, it is
          important to review the set of messages affected in case new message
          types are assigned by IANA.</t>
        </section>

        <section anchor="transit-must-drop"
                 title="Traffic That Should Be Dropped Unless a Good Case Can Be Made">
          <t>Node Information enquiry messages should generally not be
          forwarded across site boundaries. Some of these messages will be
          using non-link-local unicast addresses so that they will not
          necessarily be dropped by address scope limiting rules:<list
              style="symbols">
              <t>Node Information Query (Type 139)</t>

              <t>Node Information Response (Type 140)</t>
            </list></t>

          <t>Router Renumbering messages should not be forwarded across site
          boundaries. As originally specified, these messages may use a site
          scope multicast address or a site local unicast address. They should
          be caught by standard rules that are intended to stop any packet
          with a multicast site scope or site local destination being
          forwarded across a site boundary provided these are correctly
          configured. Since site local addresses have now been deprecated, it
          seems likely that changes may be made to allow the use of unique
          local addresses or global unicast addresses. Should this happen, it
          will be essential to explicitly filter these messages at site
          boundaries. If a site has internal as well as boundary firewalls,
          individual policies should be established for the internal firewalls
          depending on whether or not the site wishes to use Router
          Renumbering: <list style="symbols">
              <t>Router Renumbering (Type 138)</t>
            </list></t>

          <?rfc needLines="3"?>

          <t>Messages with types in the experimental allocations:<list
              style="symbols">
              <t>Types 100, 101, 200, and 201.</t>
            </list></t>

          <t>Messages using the extension type numbers until such time as
          ICMPv6 needs to use such extensions:<list style="symbols">
              <t>Types 127 and 255.</t>
            </list></t>
        </section>
      </section>

      <section title="Recommendations for ICMPv6 Local Configuration Traffic">
        <t>This section recommends filtering rules for ICMPv6 traffic
        addressed to an interface on a firewall. For a small number of
        messages, the desired behavior may differ between interfaces on the
        site or private side of the firewall and the those on the public
        Internet side of the firewall.</t>

        <section anchor="local-must-pass"
                 title="Traffic That Must Not Be Dropped">
          <t>Error messages that are essential to the establishment and
          maintenance of communications: <list style="symbols">
              <t>Destination Unreachable (Type 1) - All codes</t>

              <t>Packet Too Big (Type 2)</t>

              <t>Time Exceeded (Type 3) - Code 0 only</t>

              <t>Parameter Problem (Type 4) - Codes 1 and 2 only</t>
            </list></t>

          <t>Connectivity checking messages:<list style="symbols">
              <t>Echo Request (Type 128)</t>

              <t>Echo Response (Type 129)</t>
            </list></t>

          <t>As discussed in <xref target="transit-must-pass"></xref>,
          dropping connectivity checking messages will prevent the firewall
          being the destination of a Teredo tunnel and it is not considered
          necessary to disable connectivity checking in IPv6 networks because
          port scanning is less of a security risk.</t>

          <t>There are a number of other sets of messages that play a role in
          configuring the node and maintaining unicast and multicast
          communications through the interfaces of a node. These messages must
          not be dropped if the node is to successfully participate in an IPv6
          network. The exception to this is the Redirect message for which an
          explicit policy decision should be taken (see <xref
          target="local-policy-needed"></xref>).</t>

          <t>Address Configuration and Router Selection messages:<list
              style="symbols">
              <t>Router Solicitation (Type 133)</t>

              <t>Router Advertisement (Type 134)</t>

              <t>Neighbor Solicitation (Type 135)</t>

              <t>Neighbor Advertisement (Type 136)</t>

              <t>Inverse Neighbor Discovery Solicitation (Type 141)</t>

              <t>Inverse Neighbor Discovery Advertisement (Type 142)</t>
            </list></t>

          <t>Link-Local Multicast Receiver Notification messages:<list
              style="symbols">
              <t>Listener Query (Type 130)</t>

              <t>Listener Report (Type 131)</t>

              <t>Listener Done (Type 132)</t>

              <t>Listener Report v2 (Type 143)</t>
            </list></t>

          <t>SEND Certificate Path Notification messages:<list style="symbols">
              <t>Certificate Path Solicitation (Type 148)</t>

              <t>Certificate Path Advertisement (Type 149)</t>
            </list></t>

          <t>Multicast Router Discovery messages:<list style="symbols">
              <t>Multicast Router Advertisement (Type 151)</t>

              <t>Multicast Router Solicitation (Type 152)</t>

              <t>Multicast Router Termination (Type 153)</t>
            </list></t>
        </section>

        <section title="Traffic That Normally Should Not Be Dropped">
          <t>Error messages other than those listed in <xref
          target="local-must-pass"></xref>:<list style="symbols">
              <t>Time Exceeded (Type 3) - Code 1</t>

              <t>Parameter Problem (Type 4) - Code 0</t>
            </list></t>
        </section>

        <section title="Traffic That Will Be Dropped Anyway -- No Special Attention Needed">
          <t>Router Renumbering messages must be authenticated using IPsec, so
          it is not essential to filter these messages even if they are not
          allowed at the firewall/router: <list style="symbols">
              <t>Router Renumbering (Type 138)</t>
            </list></t>

          <t>Mobile IPv6 messages that are needed to assist mobility: <list
              style="symbols">
              <t>Home Agent Address Discovery Request (Type 144)</t>

              <t>Home Agent Address Discovery Reply (Type 145)</t>

              <t>Mobile Prefix Solicitation (Type 146)</t>

              <t>Mobile Prefix Advertisement (Type 147)</t>
            </list></t>

          <t>It may be desirable to drop these messages, especially on public
          interfaces, if the firewall is not also providing mobile home agent
          services, but they will be ignored otherwise.</t>

          <?rfc needLines="5"?>
          <t>The message used by the experimental Seamoby protocols may be
          dropped but will be ignored if the service is not implemented:<list
              style="symbols">
              <t>Seamoby Experimental (Type 150)</t>
            </list></t>
        </section>

        <section anchor="local-policy-needed"
                 title="Traffic for Which a Policy Should Be Defined">
          <t>Redirect messages provide a significant security risk, and
          administrators should take a case-by-case approach to whether
          firewalls, routers in general, and other nodes should accept these
          messages:<list style="symbols">
              <t>Redirect (Type 137)</t>
            </list>Conformant nodes must provide configuration controls that
          allow nodes to control their behavior with respect to Redirect
          messages so that it should only be necessary to install specific
          filtering rules under special circumstances, such as if Redirect
          messages are accepted on private interfaces but not public ones.</t>

          <t>If a node implements the experimental Node Information service,
          the administrator needs to make an explicit decision as to whether
          the node should respond to or accept Node Information messages on
          each interface: <list style="symbols">
              <t>Node Information Query (Type 139)</t>

              <t>Node Information Response (Type 140)</t>
            </list> It may be possible to disable the service on the node if
          it is not wanted, in which case these messages will be ignored and
          no filtering is necessary.</t>

          <t>Error messages not currently defined by IANA: <list
              style="symbols">
              <t>Unallocated Error messages (Types 5-99 inclusive and 102-126
              inclusive)</t>

              <!-- [rfced] Same as a above. Should this be:
(Types 5-99 inclusive and 102-126 inclusive) [ebd] yes.
-->
            </list></t>

          <t>The base ICMPv6 specification suggests that error messages that
          are not explicitly known to a node should be forwarded and passed to
          any higher-level protocol that might be able to interpret them.
          There is a small risk that such messages could be used to provide a
          covert channel or form part of a DoS attack. Administrators should
          be aware of this and determine whether they wish to allow these
          messages to be sent to the firewall.</t>
        </section>

        <section title="Traffic That Should Be Dropped Unless a Good Case Can Be Made">
          <t>Messages with types in the experimental allocations: <list
              style="symbols">
              <t>Types 100, 101, 200, and 201.</t>
            </list></t>

          <t>Messages using the extension type numbers until such time as
          ICMPv6 needs to use such extensions:<list style="symbols">
              <t>Types 127 and 255.</t>
            </list></t>

          <?rfc needLines="4"?>
          <t>All informational messages with types not explicitly assigned by
          IANA, currently:<list style="symbols">
              <t>Types 154-199 inclusive and 202-254 inclusive.</t>
            </list></t>

          <?rfc subcompact="no"?>

          <?rfc needLines="3"?>

          <t>Note that the base ICMPv6 specification requires that received
          informational messages with unknown types must be silently
          discarded.</t>
        </section>
      </section>
    </section>

    <section title="Acknowledgements">
      <t>Pekka Savola created the original IPv6 Security Overview document,
      which contained suggestions for ICMPv6 filter setups. This information
      has been incorporated into this document. He has also provided important
      comments. Some analysis of the classification of ICMPv6 messages and the
      term 'any-to-end' were used by Jari Arkko in a document relating to
      ICMPv6 and IKE.</t>

      <t>The Netfilter configuration script in <xref target="script"></xref>
      was contributed by Suresh Krishnan.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &rfc1981;

      &rfc2460;

      &rfc2461;

      &rfc2462;

      &rfc4443;

      &rfc2710;

      &rfc2894;

      &rfc3122;

      &rfc3590;

      &rfc3775;

      &rfc3810;

      &rfc3971;

      &rfc4065;

      &rfc4620;

      &rfc4286;
    </references>

    <references title="Informative References">
      &rfc3041;

      <!--      &ietf-v6ops-scanning-implications; -->

      <reference anchor="SCAN-IMP">
        <front>
          <title>IPv6 Implications for Network Scanning</title>

          <author fullname="Tim Chown" initials="T" surname="Chown">
            <organization></organization>
          </author>

          <date day="28" month="March" year="2007" />

          <abstract>
            <t>The 128 bits of IPv6 address space is considerably bigger than
            the 32 bits of address space of IPv4. In particular, the IPv6
            subnets to which hosts attach will by default have 64 bits of host
            address space. As a result, traditional methods of remote TCP or
            UDP network scanning to discover open or running services on a
            host will potentially become less feasible, due to the larger
            search space in the subnet. In addition automated attacks, such as
            those performed by network worms, that pick random host addresses
            to propagate to, may be hampered. This document discusses this
            property of IPv6 and describes related issues for IPv6 site
            network administrators to consider, which may be of importance
            when planning site address allocation and management strategies.
            While traditional network scanning probes (whether by individuals
            or automated via network worms) may become less common,
            administrators should be aware of other methods attackers may use
            to discover IPv6 addresses on a target network, and also be aware
            of appropriate measures to mitigate them.</t>
          </abstract>
        </front>

        <seriesInfo name="Work in" value="Progress" />

        <format target="http://www.ietf.org/internet-drafts/draft-ietf-v6ops-scanning-implications-03.txt"
                type="TXT" />
      </reference>

      <!--     draft-ietf-tcpm-icmp-attacks -->

      <reference anchor="ICMP-ATTACKS">
        <front>
          <title>ICMP attacks against TCP</title>

          <author fullname="Fernando Gont" initials="F" surname="Gont">
            <organization></organization>
          </author>

          <date day="25" month="October" year="2006" />

          <abstract>
            <t>This document discusses the use of the Internet Control Message
            Protocol (ICMP) to perform a variety of attacks against the
            Transmission Control Protocol (TCP) and other similar protocols.
            It proposes several counter-measures to eliminate or minimize the
            impact of these attacks.</t>
          </abstract>
        </front>

        <seriesInfo name="Work in" value="Progress" />

        <format target="http://www.ietf.org/internet-drafts/draft-ietf-tcpm-icmp-attacks-01.txt"
                type="TXT" />
      </reference>

      &rfc4380;

      <reference anchor="netfilter" target="http://www.netfilter.org/">
        <front>
          <title>The netfilter.org project</title>

          <author fullname="netfilter.org" initials="" surname="netfilter.org">
            <organization>aaa</organization>
          </author>

          <date year="2006" />
        </front>

        <seriesInfo name="Firewalling, NAT and Packet Mangling for Linux"
                    value="" />
      </reference>
    </references>

    <!-- start appendix on new page -->

    <?rfc needLines="100"?>

    <section anchor="indiv-msgs" title="Notes on Individual ICMPv6 Messages">
      <section anchor="dest-unreach"
               title="Destination Unreachable Error Message">
        <t>Destination Unreachable (Type 1) error messages <xref
        target="RFC4443"></xref> are sent any-to-end between unicast
        addresses. The message can be generated from any node that a packet
        traverses when the node is unable to forward the packet for any reason
        except congestion.</t>

        <t>Destination Unreachable messages are useful for debugging, but are
        also important to speed up cycling through possible addresses, as they
        can avoid the need to wait through timeouts and hence can be part of
        the process of establishing or maintaining communications. It is a
        common practice in IPv4 to refrain from generating ICMP Destination
        Unreachable messages in an attempt to hide the networking topology
        and/or service structure. The same idea could be applied to IPv6, but
        this can slow down connection if a host has multiple addresses, some
        of which are deprecated, as they may be when using privacy addresses
        <xref target="RFC3041"></xref>. If policy allows the generation of
        ICMPv6 Destination Unreachable messages, it is important that nodes
        provide the correct reason code, one of: no route to destination,
        administratively prohibited, beyond scope of source address, address
        unreachable, port unreachable, source address failed ingress/egress
        policy, or reject route to destination.</t>
      </section>

      <section anchor="too-big" title="Packet Too Big Error Message">
        <t>Packet Too Big (Type 2) error messages <xref
        target="RFC4443"></xref> are sent any-to-end between unicast
        addresses. The message can be generated from any node that a packet
        traverses on the path when the node is unable to forward the packet
        because the packet is too large for the MTU of the next link. This
        message is vital to the correct functioning of Path MTU Discovery and
        hence is part of the establishment and maintenance of communications.
        Since routers are not allowed to fragment packets, informing sources
        of the need to fragment large packets is more important than for IPv4.
        If these messages are not generated when appropriate, hosts will
        continue to send packets that are too large or may assume that the
        route is congested. Effectively, parts of the Internet will become
        inaccessible.</t>

        <t>If a network chooses to generate packets that are no larger than
        the Guaranteed Minimum MTU (1280 octets) and the site's links to the
        wider Internet have corresponding MTUs, Packet Too Big messages should
        not be expected at the firewall and could be dropped if they
        arrive.</t>
      </section>

      <section anchor="exceeded" title="Time Exceeded Error Message">
        <t>Time Exceeded (Type 3) error messages <xref
        target="RFC4443"></xref> can occur in two contexts: <list
            style="symbols">
            <t>Code 0 are generated at any node on the path being taken by the
            packet and sent, any-to-end between unicast addresses, if the Hop
            Limit value is decremented to zero at that node.</t>

            <t>Code 1 messages are generated at the destination node and sent
            end-to-end between unicast addresses if all the segments of a
            fragmented message are not received within the reassembly time
            limit.</t>
          </list></t>

        <t>Code 0 messages can be needed as part of the establishment of
        communications if the path to a particular destination requires an
        unusually large number of hops.</t>

        <t>Code 1 messages will generally only result from congestion in the
        network, and it is less essential to propagate these messages.</t>
      </section>

      <section anchor="parameter-problem"
               title="Parameter Problem Error Message">
        <t>The great majority of Parameter Problem (Type 4) error messages
        will be generated by the destination node when processing destination
        options and other extension headers, and hence are sent end-to-end
        between unicast addresses. Exceptionally, these messages might be
        generated by any node on the path if a faulty or unrecognized
        hop-by-hop option is included or from any routing waypoint if there
        are faulty or unrecognized destination options associated with a Type
        0 routing header. In these cases, the message will be sent any-to-end
        using unicast source and destination addresses.</t>

        <t>Parameter Problem Code 1 (Unrecognized Next Header) and Code 2
        (Unrecognized IPv6 Option) messages may result if a node on the path
        (usually the destination) is unable to process a correctly formed
        extension header or option. If these messages are not returned to the
        source, communication cannot be established, as the source would need
        to adapt its choice of options probably because the destination does
        not implement these capabilities. Hence, these messages need to be
        generated and allowed for effective IPv6 communications.</t>

        <t>Code 0 (Erroneous Header) messages indicate a malformed extension
        header generally as a result of incorrectly generated packets. Hence,
        these messages are useful for debugging purposes, but it is unlikely
        that a node generating such packets could establish communications
        without human intervention to correct the problem.</t>

        <t>Code 2 messages, only, can be generated for packets with multicast
        destination addresses.</t>

        <t>It is possible that attackers may seek to probe or scan a network
        by deliberately generating packets with unknown extension headers or
        options or with faulty headers. If nodes generate Parameter Problem
        error messages in all cases and these outgoing messages are allowed
        through firewalls, the attacker may be able to identify active
        addresses that can be probed further or learn about the network
        topology. The vulnerability could be mitigated whilst helping to
        establish communications if the firewall was able to examine such
        error messages in depth and was configured to only allow Parameter
        Problem messages for headers that had been standardized but were not
        supported in the protected network. If the network administrator
        believes that all nodes in the network support all legitimate
        extension headers, then it would be reasonable to drop all outgoing
        Parameter Problem messages. Note that this is not a major
        vulnerability in a well-designed IPv6 network because of the
        difficulties of performing scanning attacks (see <xref
        target="probe"></xref>).</t>
      </section>

      <section anchor="echo" title="ICMPv6 Echo Request and Echo Response">
        <t>Echo Request (Type 128) uses unicast addresses as source addresses,
        but may be sent to any legal IPv6 address, including multicast and
        anycast addresses <xref target="RFC4443"></xref>. Echo Requests travel
        end-to-end. Similarly, Echo Responses (Type 129) travel end-to-end and
        would have a unicast address as destination and either a unicast or
        anycast address as source. They are mainly used in combination for
        monitoring and debugging connectivity. Their only role in establishing
        communication is that they are required when verifying connectivity
        through Teredo tunnels <xref target="RFC4380"></xref>: Teredo
        tunneling to IPv6 nodes on the site will not be possible if these
        messages are blocked. It is not thought that there is a significant
        risk from scanning attacks on a well-designed IPv6 network (see <xref
        target="probe"></xref>), and so connectivity checks should be allowed
        by default.</t>
      </section>

      <section anchor="neighbour"
               title="Neighbor Solicitation and Neighbor Advertisement Messages">
        <t>ICMPv6 Neighbor Solicitation and Neighbor Advertisement (Type 135
        and 136) messages are essential to the establishment and maintenance
        of communications on the local link. Firewalls need to generate and
        accept these messages to allow them to establish and maintain
        interfaces onto their connected links.</t>

          <?rfc needLines="6"?>

        <t>Note that the address scopes of the source and destination
        addresses on Neighbor Solicitations and Neighbor Advertisements may
        not match. The exact functions that these messages will be carrying
        out depends on the mechanism being used to configure IPv6 addresses on
        the link (Stateless, Stateful, or Static configuration).</t>
      </section>

      <section anchor="router"
               title="Router Solicitation and Router Advertisement Messages">
        <t>ICMPv6 Router Solicitation and Router Advertisement (Type 133 and
        134) messages are essential to the establishment and maintenance of
        communications on the local link. Firewalls need to generate (since
        the firewall will generally be behaving as a router) and accept these
        messages to allow them to establish and maintain interfaces onto their
        connected links.</t>
      </section>

      <section anchor="redirect-msg" title="Redirect Messages">
        <t>ICMPv6 Redirect Messages (Type 137) are used on the local link to
        indicate that nodes are actually link-local and communications need
        not go via a router, or to indicate a more appropriate first-hop
        router. Although they can be used to make communications more
        efficient, they are not essential to the establishment of
        communications and may be a security vulnerability, particularly if a
        link is not physically secured. Conformant nodes are required to
        provide configuration controls that suppress the generation of
        Redirect messages and allow them to be ignored on reception. Using
        Redirect messages on, for example, a wireless link without link level
        encryption/authentication is particularly hazardous because the link
        is open to eavesdropping and packet injection.</t>
      </section>

      <section title="SEND Certificate Path Messages">
        <t>SEND <xref target="RFC3971"></xref> uses two messages (Certificate
        Path Solicitation and Advertisement - Types 148 and 149) sent from
        nodes to supposed routers on the same local link to obtain a
        certificate path that will allow the node to authenticate the router's
        claim to provide routing services for certain prefixes. If a link
        connected to a firewall/router is using SEND, the firewall must be
        able to exchange these messages with nodes on the link that will use
        its routing services.</t>
      </section>

      <section anchor="mld" title="Multicast Listener Discovery Messages">
        <t>Multicast Listener Discovery (MLD) version 1 <xref
        target="RFC2710"></xref> (Listener Query, Listener Report, and
        Listener Done &ndash; Types 130, 131, and 132) and version 2 <xref
        target="RFC3810"></xref> (Listener Query and Listener Report version 2
        &ndash; Types 130 and 143) messages are sent on the local link to
        communicate between multicast-capable routers and nodes that wish to
        join or leave specific multicast groups. Firewalls need to be able to
        generate Listener messages in order to establish communications and
        may generate all the messages if they also provide multicast routing
        services.</t>
      </section>

      <section anchor="mrdisc" title="Multicast Router Discovery Messages">
        <t>Multicast Router Discovery <xref target="RFC4286"></xref> (Router
        Advertisement, Router Solicitation, and Router Termination &ndash;
        Types 151, 152, and 153) messages are sent by nodes on the local link
        to discover multicast-capable routers on the link, and by
        multicast-capable routers to notify other nodes of their existence or
        change of state. Firewalls that also act as multicast routers need to
        process these messages on their interfaces.</t>
      </section>

      <section anchor="renumber-msg" title="Router Renumbering Messages">
        <t>ICMPv6 Router Renumbering (Type 138) command messages can be
        received and results messages sent by routers to change the prefixes
        that they advertise as part of Stateless Address Configuration <xref
        target="RFC2461"></xref>, <xref target="RFC2462"></xref>. These
        messages are sent end-to-end to either the all-routers multicast
        address (site or local scope) or specific unicast addresses from a
        unicast address.</t>

        <t>Router Renumbering messages are required to be protected by IPsec
        authentication since they could be readily misused by attackers to
        disrupt or divert site communications. Renumbering messages should
        generally be confined to sites for this reason.</t>
      </section>

      <section anchor="info-query" title="Node Information Query and Reply">
        <t>ICMPv6 Node Information Query and Reply (Type 139 and 140) messages
        defined in <xref target="RFC4620"></xref> are sent end-to-end between
        unicast addresses, and they can also be sent to link-local multicast
        addresses. They can, in theory, be sent from any node to any other,
        but it would generally not be desirable for nodes outside the local
        site to be able to send queries to nodes within the site. Also, these
        messages are not required to be authenticated.</t>
      </section>

      <section anchor="mipv6" title="Mobile IPv6 Messages">
        <t>Mobile IPv6 <xref target="RFC3775"></xref> defines four ICMPv6
        messages that are used to support mobile operations: Home Agent
        Address Discovery Request, Home Agent Address Discovery Reply, Mobile
        Prefix Solicitation, and ICMP Mobile Prefix Advertisement (Type 144,
        145, 146, and 147) messages. These messages are sent end-to-end
        between unicast addresses of a mobile node and its home agent. They
        must be expected to be sent from outside a site and must traverse
        site-boundary firewalls to reach the home agent in order for Mobile
        IPv6 to function. The two Mobile prefix messages should be protected
        by the use of IPsec authentication.<list style="symbols">
            <t>If the site provides home agents for mobile nodes, the firewall
            must allow incoming Home Agent Address Discovery Request and
            Mobile Prefix Solicitation messages, and outgoing Home Agent
            Address Discovery Reply and ICMP Mobile Prefix Advertisement
            messages. It may be desirable to limit the destination addresses
            for the incoming messages to links that are known to support home
            agents.</t>

            <t>If the site is prepared to host roaming mobile nodes, the
            firewall must allow outgoing Home Agent Address Discovery Request
            and Mobile Prefix Solicitation messages, and incoming Home Agent
            Address Discovery Reply and ICMP Mobile Prefix Advertisement
            messages.</t>

            <t>Administrators may find it desirable to prevent static nodes
            that are normally resident on the site from behaving as mobile
            nodes by dropping Mobile IPv6 messages from these nodes.</t>
          </list></t>
      </section>

      <section anchor="unknown" title="Unused and Experimental Messages">
        <t>A large number of ICMPv6 Type values are currently unused. These
        values have not had a specific function registered with IANA. This
        section describes how to treat messages that attempt to use these Type
        values in a way of which the network administrator (and hence the
        firewall) is not aware.</t>

        <t><xref target="RFC4443"></xref> defines a number of experimental
        Type values for ICMPv6 Error and Informational messages, which could
        be used in site-specific ways. These messages should be dropped by
        transit networks and at site edges. They should also not be propagated
        within sites unless the network administrator is explicitly made aware
        of usage.</t>

        <t>The codes reserved for future extension of the ICMPv6 Type space
        should currently be dropped as this functionality is as yet
        undefined.</t>

        <t>Any ICMPv6 Informational messages of which the firewall is not
        aware should be allowed to transit through the firewall but should not
        be accepted for local delivery on any of its interfaces.</t>

        <t>Unknown ICMPv6 Error messages should be allowed to pass through
        transit networks. At end site boundaries any incoming ICMPv6 Error
        messages of which the firewall is not aware may be allowed through the
        firewall in line with the specification in <xref
        target="RFC4443"></xref>, which requests delivery of unknown error
        messages to higher-layer protocol processes. However, administrators
        may wish to disallow forwarding 

<vspace blankLines="0"/>
<?rfc needLines="4"?>

of these incoming messages as a
        potential security risk. Unknown outgoing Error messages should be
        dropped as the administrator should be aware of all messages that
        could be generated on the site.</t>

        <t>Also, the SEAMOBY working group has had an ICMPv6 message (Type
        150) allocated for experimental use in two protocols. This message is
        sent end-to-end and may need to pass through firewalls on sites that
        are supporting the experimental protocols.</t>
      </section>
    </section>

    <section anchor="script"
             title="Example Script to Configure ICMPv6 Firewall Rules">
      <t>This appendix contains an example script to implement most of the
      rules suggested in this document when using the Netfilter packet
      filtering system for Linux <xref target="netfilter"></xref>. When used
      with IPv6, the 'ip6tables' command is used to configure packet filtering
      rules for the Netfilter system. The script is targeted at a simple
      enterprise site that may or may not support Mobile IPv6.</t>

      <figure title="Example Netfilter Configuration Script for ICMPv6 Filtering">
        <preamble></preamble>

        <artwork><![CDATA[#!/bin/bash
# Set of prefixes on the trusted ("inner") side of the firewall
export INNER_PREFIXES="2001:DB8:85::/60"
# Set of hosts providing services so that they can be made pingable
export PINGABLE_HOSTS="2001:DB8:85::/64"
# Configuration option: Change this to 1 if errors allowed only for 
# existing sessions 
export STATE_ENABLED=0
# Configuration option: Change this to 1 if messages to/from link
# local addresses should be filtered.
# Do not use this if the firewall is a bridge.
# Optional for firewalls that are routers.
export FILTER_LINK_LOCAL_ADDRS=0
# Configuration option: Change this to 0 if the site does not support 
# Mobile IPv6 Home Agents - see Appendix A.14
export HOME_AGENTS_PRESENT=1
# Configuration option: Change this to 0 if the site does not support 
# Mobile IPv6 mobile nodes being present on the site - 
# see Appendix A.14
export MOBILE_NODES_PRESENT=1

ip6tables -N icmpv6-filter
ip6tables -A FORWARD -p icmpv6 -j icmpv6-filter

# Match scope of src and dest else deny
# This capability is not provided for in base ip6tables functionality
# An extension (agr) exists which may support it.
#@TODO@

# ECHO REQUESTS AND RESPONSES 
# ===========================

# Allow outbound echo requests from prefixes which belong to the site
for inner_prefix in $INNER_PREFIXES
do
  ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
        --icmpv6-type echo-request -j ACCEPT 
done

# Allow inbound echo requests towards only predetermined hosts
for pingable_host in $PINGABLE_HOSTS
do
  ip6tables -A icmpv6-filter -p icmpv6 -d $pingable_host \
        --icmpv6-type echo-request -j ACCEPT 
done

if [ "$STATE_ENABLED" -eq "1" ]
then
  # Allow incoming and outgoing echo reply messages
  # only for existing sessions
  ip6tables -A icmpv6-filter -m state -p icmpv6 \
        --state ESTABLISHED,RELATED --icmpv6-type \
      echo-reply -j ACCEPT 
else
  # Allow both incoming and outgoing echo replies
  for pingable_host in $PINGABLE_HOSTS
  do
    # Outgoing echo replies from pingable hosts
    ip6tables -A icmpv6-filter -p icmpv6 -s $pingable_host \
        --icmpv6-type echo-reply -j ACCEPT 
  done
  # Incoming echo replies to prefixes which belong to the site
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
        --icmpv6-type echo-reply -j ACCEPT 
  done
fi

# Deny icmps to/from link local addresses
# If the firewall is a router:
#    These rules should be redundant as routers should not forward 
#    link local addresses but to be sure...
# DO NOT ENABLE these rules if the firewall is a bridge
if [ "$FILTER_LINK_LOCAL_ADDRS" -eq "1" ]
then
  ip6tables -A icmpv6-filter -p icmpv6 -d fe80::/10 -j DROP
  ip6tables -A icmpv6-filter -p icmpv6 -s fe80::/10 -j DROP
fi

# Drop echo replies which have a multicast address as a 
# destination
ip6tables -A icmpv6-filter -p icmpv6 -d ff00::/8 \
        --icmpv6-type echo-reply -j DROP 

# DESTINATION UNREACHABLE ERROR MESSAGES
# ======================================

if [ "$STATE_ENABLED" -eq "1" ]
then
  # Allow incoming destination unreachable messages
  # only for existing sessions
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -m state -p icmpv6 \
         -d $inner_prefix \
         --state ESTABLISHED,RELATED --icmpv6-type \
         destination-unreachable -j ACCEPT 
  done
else
  # Allow incoming destination unreachable messages
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type destination-unreachable -j ACCEPT 
  done
fi

# Allow outgoing destination unreachable messages
for inner_prefix in $INNER_PREFIXES
do
  ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type destination-unreachable -j ACCEPT 
done

# PACKET TOO BIG ERROR MESSAGES
# =============================

if [ "$STATE_ENABLED" -eq "1" ]
then
  # Allow incoming Packet Too Big messages
  # only for existing sessions
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -m state -p icmpv6 \
         -d $inner_prefix \
         --state ESTABLISHED,RELATED \
         --icmpv6-type packet-too-big \
         -j ACCEPT 
  done
else
  # Allow incoming Packet Too Big messages
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type packet-too-big -j ACCEPT 
  done
fi

# Allow outgoing Packet Too Big messages
for inner_prefix in $INNER_PREFIXES
do
  ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type packet-too-big -j ACCEPT 
done

# TIME EXCEEDED ERROR MESSAGES
# ============================

if [ "$STATE_ENABLED" -eq "1" ]
then
  # Allow incoming time exceeded code 0 messages
  # only for existing sessions
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -m state -p icmpv6 \
         -d $inner_prefix \
         --state ESTABLISHED,RELATED --icmpv6-type packet-too-big \
         -j ACCEPT 
  done
else 
  # Allow incoming time exceeded code 0 messages
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type ttl-zero-during-transit -j ACCEPT 
  done
fi

#@POLICY@
# Allow incoming time exceeded code 1 messages
for inner_prefix in $INNER_PREFIXES
do
ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type ttl-zero-during-reassembly -j ACCEPT 
done

# Allow outgoing time exceeded code 0 messages
for inner_prefix in $INNER_PREFIXES
do
ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type ttl-zero-during-transit -j ACCEPT 
done

#@POLICY@
# Allow outgoing time exceeded code 1 messages
for inner_prefix in $INNER_PREFIXES
do
ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type ttl-zero-during-reassembly -j ACCEPT 
done


# PARAMETER PROBLEM ERROR MESSAGES
# ================================

if [ "$STATE_ENABLED" -eq "1" ]
then
  # Allow incoming parameter problem code 1 and 2 messages
  # for an existing session
  for inner_prefix in $INNER_PREFIXES
  do
    ip6tables -A icmpv6-filter -m state -p icmpv6 \
         -d $inner_prefix \
         --state ESTABLISHED,RELATED --icmpv6-type \
         unknown-header-type \
         -j ACCEPT 
    ip6tables -A icmpv6-filter -m state -p icmpv6 \
         -d $inner_prefix \
         --state ESTABLISHED,RELATED \
         --icmpv6-type unknown-option \
         -j ACCEPT 
  done
fi

# Allow outgoing parameter problem code 1 and code 2 messages
for inner_prefix in $INNER_PREFIXES
do
  ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type unknown-header-type -j ACCEPT 
  ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type unknown-option -j ACCEPT 
done

#@POLICY@
# Allow incoming and outgoing parameter 
# problem code 0 messages
for inner_prefix in $INNER_PREFIXES
do
  ip6tables -A icmpv6-filter -p icmpv6 \
         --icmpv6-type bad-header \
         -j ACCEPT 
done

# NEIGHBOR DISCOVERY MESSAGES
# ===========================

# Drop NS/NA messages both incoming and outgoing
ip6tables -A icmpv6-filter -p icmpv6 \
         --icmpv6-type neighbor-solicitation -j DROP 
ip6tables -A icmpv6-filter -p icmpv6 \
         --icmpv6-type neighbor-advertisement -j DROP 

# Drop RS/RA messages both incoming and outgoing
ip6tables -A icmpv6-filter -p icmpv6 \
         --icmpv6-type router-solicitation -j DROP 
ip6tables -A icmpv6-filter -p icmpv6 \
         --icmpv6-type router-advertisement -j DROP 

# Drop Redirect messages both incoming and outgoing
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type redirect -j DROP 

# MLD MESSAGES
# ============

# Drop incoming and outgoing
# Multicast Listener queries (MLDv1 and MLDv2)
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 130 -j DROP 

# Drop incoming and outgoing Multicast Listener reports (MLDv1)
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 131 -j DROP 

# Drop incoming and outgoing Multicast Listener Done messages (MLDv1)
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 132 -j DROP 

# Drop incoming and outgoing Multicast Listener reports (MLDv2)
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 143 -j DROP 

# ROUTER RENUMBERING MESSAGES
# ===========================

# Drop router renumbering messages
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 138 -j DROP 

# NODE INFORMATION QUERIES
# ========================

# Drop node information queries (139) and replies (140)
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 139 -j DROP 
ip6tables -A icmpv6-filter -p icmpv6 --icmpv6-type 140 -j DROP 


# MOBILE IPv6 MESSAGES
# ====================

# If there are mobile ipv6 home agents present on the
# trusted side allow 
if [ "$HOME_AGENTS_PRESENT" -eq "1" ]
then
  for inner_prefix in $INNER_PREFIXES
  do
    #incoming Home Agent address discovery request
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type 144 -j ACCEPT 
    #outgoing Home Agent address discovery reply
    ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type 145 -j ACCEPT 
    #incoming Mobile prefix solicitation
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type 146 -j ACCEPT 
    #outgoing Mobile prefix advertisement
    ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type 147 -j ACCEPT 
  done
fi

# If there are roaming mobile nodes present on the
# trusted side allow
if [ "$MOBILE_NODES_PRESENT" -eq "1" ]
then
  for inner_prefix in $INNER_PREFIXES
  do
    #outgoing Home Agent address discovery request
    ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type 144 -j ACCEPT 
    #incoming Home Agent address discovery reply
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type 145 -j ACCEPT 
    #outgoing Mobile prefix solicitation
    ip6tables -A icmpv6-filter -p icmpv6 -s $inner_prefix \
         --icmpv6-type 146 -j ACCEPT 
    #incoming Mobile prefix advertisement
    ip6tables -A icmpv6-filter -p icmpv6 -d $inner_prefix \
         --icmpv6-type 147 -j ACCEPT 
  done
fi

# DROP EVERYTHING ELSE
# ====================

ip6tables -A icmpv6-filter -p icmpv6 -j DROP
]]></artwork>

        <postamble></postamble>
      </figure>
    </section>
  </back>
</rfc>
