Table of Contents

Table of Chapters

14 IPv6 console commands

When compiled with the IN_MENUS #define set, the IPv6 code adds an IPv6 utility menu to the InterNiche console debug system. The commands available via this menu are described in this section.

14.1 ip6 - IPv6 MIB statistics

This command displays the current values of selected MIB counters defined for the IPV6 layer by RFC-2465 ("IPv6 MIB: General Group"). The names displayed for these counters are the MIB names in the RFC, except that the redundant "ipv6" prefix is dropped in the display. The display values from the MIB are:

ipv6Forwarding
ipv6DefaultHopLimit
ipv6Interfaces
ipv6IfTableLastChange
ipv6RouteNumber
ipv6DiscardedRoutes

The InterNiche code uses a single interface structure for both IPv6 and IPV4 interfaces. This means that many of the variables in the RFC-2465 MIB are duplicates of other variables defined in RFC-1213 (MIB-2) for IPv4 interfaces. These duplicate variables are omitted in the code. If an SNMP agent is implemented which requires these variables, the values in the MIB-2 structure should be returned.

In addition, there are several counters added for the InterNiche implementation. These have been added since many basic protocol counters, such as total datagram counts, are not specified for IPv6. Instead, the MIB-2 IP group receives counts of these event. It's often extremely useful to know how many IPv6-specific events occurred, without having the IPv4 counts added to the total. The counters added for this purpose are:

ip6InPktsIPv6 packets received (all interfaces)
ip6InErrsIPv6 protocol errors
ip6InDropsIPv6 packets dropped (no buffer)
ip6InUnknownIPv6 packets to unknown upper layer protocol
ip6OutPktsIPv6 packets sent (all interfaces)
ip6OutErrsSend errors on IPv6 packets

Screen example:

INET> ip6
IPv6 MIB stats:
Forwarding:1,   DefaultHopLimit:0,      Interfaces:0
IfTableLastChange:0,    RouteNumber:0,  DiscardedRoutes:0
ip6InPkts:11,   ip6InErrs:0,    ip6InDrops:0,   ip6InUnknown:0
ip6OutPkts:14,  ip6OutErrs:0
INET>

14.2 icmp6 - ICMPv6 MIB statistics

This command will display the MIB Counters for ICMPv6, as specified in RFC-2466 ("IPv6 MIB: ICMPv6 Group"). These statistics are displayed on a per-interface basis. The interface may be specified by including a number after icmp6 command. If no interface is specified, the default is number 1 (one), the first interface.

Screen example:

INET> icmp6
ICMPv6 stats for iface nd0
InMsgs:6        InErrors:0      InDestUnreachs:0
InAdminProhibs:0        InTimeExcds:0   InParmProblems:0
InPktTooBigs:0  InEchos:3       InEchoReplies:0
InRouterSolicits:0      InRouterAdvertisements:0        InNeighborSolicits:2
InNeighborAdvertisements:1      InRedirects:0   InGroupMembQueries:0
InGroupMembResponses:0  InGroupMembReductions:0
OutMsgs:8       OutErrors:0     OutDestUnreachs:0
OutAdminProhibs:0       OutTimeExcds:0  OutParmProblems:0
OutPktTooBigs:0 OutEchos:0      OutEchoReplies:3
OutRouterSolicits:1     OutRouterAdvertisements:0       OutNeighborSolicits:2
OutNeighborAdvertisements:2     OutRedirects:0  OutGroupMembQueries:0
OutGroupMembResponses:0 OutGroupMembReduction:0
INET>

14.3 ndcache - Show Neighbor discovery cache

This command displays the current contents of the IPv6 neighbor discovery (ND) table. Here is an example screen shot:

INET> nd
IPv6 NB cache:
net pend  IP address               MAC address
nd0  n   FE80::0200:F4FF:FE90:1052  00 00 F4 90 10 52 .....R
INET>

The fields in the above examples are described in the table below.

NameExample (above)description
Interface name"nd0"The name of the interface (nets[] entry) on which the IP host was detected.
Send Pendingn"y" if a packet has been queue for sending which the ND entry is resolved, "n" is no packet is queued.
IPv6 addressFE80::0200:F4FF:FE90:1052IPv6 address of neighbor
MAC address00 00 F4 90 10 52MAC address of neighbor, all zeros if not yet known.

Note that incomplete ND table entries are created when neighbor solicits are sent. Most often these neighbor solicits are sent as a result of an attempt to send an IPv6 packet to a link-local IPv6 address which does not already have an entry in the ND table. In these cases, the original IPv6 packet being sent is attached to the ND entry structure. The presence of this packet is indicated by a "y" in the "pend" field in the above display. When a Neighbor Advertisement for the IPv6 host is received, the pending packet is sent. If the ND entry times out without receiving a Neighbor Advertisement, then the pending packet is freed.

14.4 ping6 - Start ICMPv6 ping

Ping6 starts an ICMPv6 echo session. The command line may contain an IPv6 address to ping, and a count for the number of pings to send. Default count is 1. Default IPv6 address is the address set by "6host" (see below). If no default address has been set, then an error message is displayed and no ping session in started. Length for the ping may be set by the "length" command in the standard NicheStack code.

If the target host is not already in the ND cache, then your host must send out a Neighbor Solicitation and wait for a Neighbor advertisement from the target host, supplying its MAC address.

In the following example, the ipv6 host has already been set with the 6host command:

INET>
INET> ping6
ping6, sending 1 pings of 64 byte length to FE80::0200:F4FF:FE90:1052
Sent ping; sess: 0, Seq: 1 to FE80::0200:F4FF:FE90:1052
ping6 reply for session 0 (seq: 0)
End of session 0, sent 1, recv:1
INET>

The address and number of pings can also be set explicitly:

INET> ping6 fe80::211:11ff:febe:7f9a 3
ping6, sending 3 pings of 64 byte length to FE80::211:11FF:FEBE:7F9A
Sent discovery pkt for FE80::211:11FF:FEBE:7F9A>
ping6 reply for session 3 (seq: 0)
Sent ping; sess: 3, Seq: 2 to FE80::211:11FF:FEBE:7F9A
ping6 reply for session 3 (seq: 1)
Sent ping; sess: 3, Seq: 3 to FE80::211:11FF:FEBE:7F9A
End of session 3, sent 3, recv:2
INET>

14.5 rt6add - Create an IPv6 route table entry

This command allows users the manually add entries to the IPv6 routing table.

The command requires four parameters. If any of the parameters are missing or cannot be parsed, an error message in generated and no routing table entry is made.

Here's the example:

INET> rt6add
usage: rt6add IPv6_dest prefixlength Nexthop ifnum
INET> rt6add fe80::0200:f4ff:fe90:1052 10 fe80::0200:f4ff:fe90:1052 1

The four required parameters are outlined in the table below.

Parameter NameExampleDescription
IPv6_destfe80::0200:f4ff:fe90:1052IPv6 address of target host
prefixlength128Number of leading bits in the address to use for matching target IPv6 addresses to the routing table entry.
Nexthopfe80::0200:f4ff:fe90:1052IPv6 address of "next hop", which is either the target host, or a router to use for reaching the target host.
ifnum1Interface number on which to send packets, 1 - n

14.6 rt6del - Delete an IPv6 route table entry

This command will delete an entry in the IPv6 routing table. The only required parameter is the IPv6 address (the target address) of the entry to delete.

Here is the example:

rt6del FE80::0200:F4FF:FE90:1052

14.7 rt6list - List current IPv6 routes table

This command displays the current entries in the routing table, on entry per line. Fields names and order are the same as in rt6add, above; except for the addition of a "type" field at the end of each line. The type field indicates the source of the route entry information. Valid type fields values are:

IPRP_LOCALnon-protocol source, e.g., manually configured
IPRP_NETMGMTset via SNMP
IPRP_ICMPset via ICMP
IPRP_EGPset via EGP
IPRP_RIPset via RIP
IPRP_OTHERnone of the above

Here is the example:

INET> rt6list
..Dest IP.......PF len......Nexthop IP...iface..type
FE80::0200:F4FF:FE90:1052  10  FE80::0200:F4FF:FE90:1052  nd0  LOCAL
INET>

14.8 6host - Set default IPv6 host

This command is used to set the default IPv6 address for future operations. Currently the only "future operation" supported is ping6.

Here is the example:

INET> 6host FE80::0200:F4FF:FE90:1052

14.9 Setip6 - Set IPv6 address for an interface

This command is used to set the IPv6 address for an interface. Hence this command can be used to set the link-local address, site-local address and the global address for the interface. Usage is

setip6 <ip6addr> [iface]

"iface" field is optional. If "iface" field is absent, then the first interface is used. It can either be the name or number of the interface.

The following command sets the link-local address for interface nd0

INET> setip6 fe80::2aa:bbff:fecc:ddee nd0
INET> if
Interface nd0 - Windows 2000/95/98 NDIS ethernet Hook
IPv4 address: 10.0.0.52, subnet mask: 255.0.0.0, gateway: 0.0.0.0
IPv6   link addr: FE80::2AA:BBFF:FECC:DDEE - Tentative
IPv6   site addr: FEC0:501:FFFF:1000:2A0:CCFF:FED7:4A77 - Tentative
IPv6 global addr: 3FFE:501:FFFF:1000:2A0:CCFF:FED7:4A77 - Tentative
IPv6  mcast addr: FF02::1:FFD7:4A77 - Static
IPv6  defgw addr: FE80::200:E8FF:FE90:9602 - Tentative
Status; Admin:up Oper:up for: 1 minutes, 0 sec.
rcvd: errors:0   dropped:0   station:1   bcast:5   bytes:2777
sent: errors:0   dropped:0   station:0   bcast:0   bytes:156
MAC address: 00 A0 CC D7 4A 77 ....Jw

   Multicast addresses:
   224.0.0.1
   FF05::2
   FF02::2
   FF02::1
   FF02::1:FFD7:4A77
INET>

14.10 6iface - Set the default IPv6 interface

This command sets the default interface for the IPv6 stack. When network activity is initiated for IPv6 addresses and if the stack is unable to determine the interface to be used, then it would default to this setting. By default, when the stack comes up, it sets the first ethernet interface to be the default interface. Usage is

6iface <iface>

Here is an example:

INET> 6iface
Current iface is nd0.
To change it, please specify an interface name
INET> 6iface lp0
no interface named "lp0".
Ignoring unknown interface name lp0
INET> 6iface 3
INET> iface 3
Interface lo0 - loopback (pseudo ethernet)
IPv4 address: 127.0.0.1, subnet mask: 255.255.0.0, gateway: 0.0.0.0
IPv6   link addr: FE80::1 - Dup-checked
IPv6   site addr: FEC0::1 - Dup-checked
IPv6 global addr: ::1 - Dup-checked
IPv6  mcast addr: FF02::1:FF00:1 - Static
Status; Admin:up Oper:up for: 0 minutes, 39 sec.
rcvd: errors:0   dropped:0   station:5   bcast:0   bytes:414
sent: errors:0   dropped:0   station:0   bcast:5   bytes:414
MAC address: 4C 50 42 41 43 4B LPBACK

   Multicast addresses:
   224.0.0.1
   FF05::2
   FF02::2
   FF02::1
   FF02::1:FF00:1
INET> 6iface
Current iface is lo0.
To change it, please specify an interface name
INET>