ipV6Address

ipV6Address - decode or encode an IPv6 address

SYNOPSIS

ipV6Address sub-command options

DESCRIPTION

The ipV6Address command is used to create an IPv6 address from component parameters or decode an existing address into its parameters. The prefixType of the address dictates which other options are read/written. The following table indicates the options used for each prefixType value.

  prefixType Values  

Option

Reserved (0)

NSAP Allocaton (1)

IPX Allocation (2)

Global Unicast (3)

Link Local Unicast (4)

Site Local Unicast (5)

Multicast (6)

User Defined (7)

reservedAddressType

X

 

 

 

 

 

 

 

reservedIpV4Address

X

 

 

 

 

 

 

 

allocation

 

X

X

 

 

 

 

 

topLevelAggregationId

 

 

 

X

 

 

 

 

reserved

 

 

 

X

 

 

 

 

nextLevelAggregationId

 

 

 

X

 

 

 

 

siteLevelAggregationId

 

 

 

X

 

 

 

 

interfaceId

 

 

 

X

X

X

 

 

subnetId

 

 

 

 

 

X

 

 

nonPermanentlyAssigned

 

 

 

 

 

 

X

 

scope

 

 

 

 

 

 

X

 

groupId

 

 

 

 

 

 

X

 

userDefinedAddress

 

 

 

 

 

 

 

X

STANDARD OPTIONS

 

allocation

(default = 0)

groupId

(default = 0)

interfaceId

(default = 0)

nextLevelAggregation

Id

(default = 0)

nonPermanently

Assigned

(default = 0)

STANDARD OPTIONS for Ipv6 global Unicast 3587

 

subnetId

(default = 0)

interfaceId

(default = 0)

globalRoutingPrefix

(default = 0)

 

 

prefixType

One of

Option

Value

Usage

ipV6Reserved

0

(default) Reserved.

ipV6NSAPAllocation

1

NSAP Allocation.

ipV6IPXAllocation

2

IPX Allocation.

ipV6GlobalUnicast

3

Global Unicast.

ipV6LinkLocalUnicast

4

Link Local Unicast.

ipV6SiteLocalUnicast

5

Site Local Unicast.

ipV6Multicast

6

Multicast.

ipV6UserDefined

7

User Defined.

ipV6GlobalUnicast3587

8

New global unicast RFC

reserved

(default = 0)

reservedAddressType

One of

Option

Value

Usage

ipV6ReservedCompatible

0

(default) IPv4 compatible address.

ipV6ReservedCompatible

1

IPv4 mapped IPv6 address.

reservedIpV4Address

(default = 0)

scope

One of

Option

Value

Usage

ipV6MulticastScopeReserved1

0

(default)

ipV6MulticastScopeNodeLocalScope

1

Node local scope

ipV6MulticastScoeNodeLinkipV6LocalScope

2

Link local scope

ipV6MulticastScopeUnassigned

3

 

ipV6MulticastScopeSiteLocalScope

5

Site local scope

ipV6MulticastScopeOrganizationLocalScope

8

Organization local scope

ipV6MulticastScopeGlobalScope

14

Global scope

ipV6MulticastScopeReserved2

15

 

siteLevelAggregationId

(default = 0)

subnetId

(default = 0)

topLevelAggregationId

(default = 0)

userDefinedAddress

(default = 0)

COMMANDS

The ipV6Address command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.

ipV6Address cget option

Returns the current value of the configuration option given by option. Option may have any of the values accepted by the ipV6Address command.

ipV6Address config option value

Modify the ipV6Address configuration options. If no option is specified, returns a list describing all of the available ipV6Address options (see STANDARD OPTIONS).

ipV6Address decode ipV6Address

Decodes the colon encoded IPv6 address present in ipv6Address into the STANDARD OPTIONS.

ipV6Address encode

Encodes the IPv6 address present in the STANDARD OPTIONS and returns that value as a ":" encoded character string.

EXAMPLES

package require IxTclHal

 

ipV6Address setDefault

 

ipV6Address config -prefixType ipV6GlobalUnicast

ipV6Address config -topLevelAggregationId 10

ipV6Address config -nextLevelAggregationId 42

ipV6Address config -siteLevelAggregationId 14

ipV6Address config -interfaceId 1

set addr [ipV6Address encode]

ixPuts $addr

 

ipV6Address decode $addr

ixPuts -nonewline [ipV6Address cget -prefixType]

ixPuts -nonewline ", "

ixPuts -nonewline [ipV6Address cget -topLevelAggregationId]

ixPuts -nonewline ", "

ixPuts -nonewline [ipV6Address cget -nextLevelAggregationId]

ixPuts -nonewline ", "

ixPuts -nonewline [ipV6Address cget -siteLevelAggregationId]

ixPuts -nonewline ", "

ixPuts [ipV6Address cget -interfaceId]

 

 

#Use the exposed members for the new RFC 3587 for configuring ipV6Addr

 

package require IxTclHal

ipV6Address setDefault

ipV6Address config -prefixType ipV6GlobalUnicast3587

ipV6Address config -globalRoutingPrefix 42

ipV6Address config -subnetId 14

ipV6Address config -interfaceId 1

set addr [ipV6Address encode]

ixPuts $addr

 

ipV6Address decode $addr 1

ixPuts -nonewline [ipV6Address cget -prefixType]

ixPuts -nonewline ", "

ixPuts -nonewline [ipV6Address cget -globalRoutingPrefix]

ixPuts -nonewline ", "

ixPuts -nonewline [ipV6Address cget -subnetId]

ixPuts -nonewline ", "

ixPuts [ipV6Address cget -interfaceId]

 

#Set sourceAddrMode to ipV6IncrementGlobalUnicastGlobalRoutingPrefixId(17)

 

sourceAddrModeipV6 setDefault

ipV6 config -trafficClass 3

ipV6 config -flowLabel 0

ipV6 config -hopLimit 255

ipV6 config -sourceAddr "2444:4444:4444:5555:6666:6666:6666:6666"

ipV6 config -sourceMask 32

ipV6 config -sourceAddrMode 17

ipV6 config -sourceStepSize 1

ipV6 config -enableSourceSyncFromPpp false

ipV6 config -sourceAddrRepeatCount 10

ipV6 config -destAddr "3555:5555:6666:6666:7777:7777:8888:8888"

ipV6 config -destMask 64

ipV6 config -destAddrMode ipV6Idle

ipV6 config -destStepSize 1

ipV6 config -nextHeader ipV6NoNextHeader

ipV6 config -enableDestSyncFromPpp false

ipV6 config -destAddrRepeatCount 10

ipV6 config -destGlobalUnicastMode 0

ipV6 config -sourceGlobalUnicastMode 1

 

 

//increment/decrement subnetid

-dest mask is fixed to 48 in this case; anything else will fail

package req IxTclHal

ixInitialize loopback

set chassis 1

set card 3

set port 1

set stream 1

stream get $chassis $card $port $stream

protocol setDefault

protocol config -ethernetType ethernetII

protocol config -name ipV6

ipV6Address config -prefixType ipV6GlobalUnicast3587

ipV6Address config -globalRoutingPrefix 42

ipV6Address config -subnetId 14

ipV6Address config -interfaceId 55

set addr [ipV6Address encode]

ipV6 config -destGlobalUnicastMode 1

ipV6 config -destMask 48

ipV6 config -destAddrMode 19

ipV6 config -destStepSize 1

ipV6 config -destAddr $addr

ipV6 set $chassis $card $port

stream set $chassis $card $port $stream

port write $chassis $card $port

--------------------------------------

Second script for incr/decr subnet id:

 

package req IxTclHal

ixInitialize loopback

set chassis 1

set card 3

set port 1

set stream 1

stream get $chassis $card $port $stream

protocol setDefault

protocol config -ethernetType ethernetII

protocol config -name ipV6

ipV6Address config -prefixType ipV6GlobalUnicast3587

ipV6Address config -globalRoutingPrefix 42

ipV6Address config -subnetId 14

ipV6Address config -interfaceId 55

set addr [ipV6Address encode]

ipV6 config -destGlobalUnicastMode 1

ipV6 config -destMask 48

ipV6 config -destAddrMode ipV6IncrementSubnetId

ipV6 config -destStepSize 1

ipV6 config -destAddr $addr

 

ipV6 set $chassis $card $port

stream set $chassis $card $port $stream

port write $chassis $card $port

--------------------------------------

package req IxTclHal

ixInitialize loopback

set chassis 1

set card 3

set port 1

set stream 1

stream get $chassis $card $port $stream

protocol setDefault

protocol config -ethernetType ethernetII

protocol config -name ipV6

ipV6Address config -prefixType ipV6GlobalUnicast3587

ipV6Address config -globalRoutingPrefix 42

ipV6Address config -subnetId 14

ipV6Address config -interfaceId 55

set addr [ipV6Address encode]

ipV6 config -destGlobalUnicastMode 1

ipV6 config -destMask 48

ipV6 config -destAddrMode ipV6DecrementSubnetId

ipV6 config -destStepSize 1

ipV6 config -destAddr $addr

ipV6 set $chassis $card $port

stream set $chassis $card $port $stream

port write $chassis $card $port

 

SEE ALSO