interfaceTable

interfaceTable - configure the interfaces associated with a port

SYNOPSIS

interfaceTable sub-command options

DESCRIPTION

The interfaceTable command is used to configure interfaces associated with a port. Interfaces hold interfaceEntry elements, each of which includes multiple IPv4 and IPv6 addresses. Note that the select command must be used before any other sub-commands to indicate the chassis, card and port in use.

For IPv4, DHCPv4 or DHCPv6 may be enabled on an interface by interface basis in interfaceEntry DHCP parameters are set dhcpV4Properties and dhcpV6Properties commands at the time that interfaceTable addInterface is called. They are retrieved when the get*Interface sub-commands are called. The address and other parameters assigned from the DHCP server may be retrieved from the port by using requestDiscoveredTable followed by getDhcpV4DiscoveredInfo.

Similarly, when using IPv6, addresses for the interfaces and neighbor addresses are automatically discovered and are available by calling sendRouterSoliciation, requestDiscoveredTable and getDiscoveredList.

Note: If more than a few DHCP interfaces are being defined, it is important that you wait until they are fully defined by monitoring the dhcpV4EnabledInterfaces and dhcpV6EnabledInterfaces statistic in the stat command. Likewise, the DHCP server may require some amount of time to answer all DHCP server requests. You can test for its completion by calling interfaceTable requestDiscoveredTable and then monitoring the dhcpV4AddressesLearned and dhcpV6AddressesLearned statistic in the stat command. This requires that enableDhcpStats be true in the stat command.

STANDARD OPTIONS
dhcpV4RequestRate

The user-specified maximum number of Request messages that can be sent per second from the client to the server, requesting an IPv4 address. A value of zero (0) indicates that there is no rate control, that is, requests are sent as fast as possible.

dhcpV6RequestRate

The user-specified maximum number of Request messages that can be sent per second from the client to the server, requesting an IPv6 address. A value of zero (0) indicates that there is no rate control, that is, requests are sent as fast as possible.

dhcpV4Maximum

Out-standingRequests

The maximum number of DHCP V4 requests that can be pending, waiting replies from the server. If this number is reached, no further requests can be sent until an acknowledgment is received for a pending request.

dhcpV6Maximum

Out-standingRequests

The maximum number of DHCP V6 requests that can be pending, waiting replies from the server. If this number is reached, no further requests can be sent until an acknowledgment is received for a pending request.

enableFcfMac

Enables FCF MAC address.

enablePMacInFpma

Enables PMAC.

enableNameIdInVLAN

Discovery

Enables Name ID parameter in Discovery VLAN.

enableTargetLinkLayerAddrOption

Enables Target Link Layer Address option.

enableAutoNeighbor

Discovery

Enables Auto Neighbor Discovery parameter. If true and then MAC interface is enabled, the Discovered Neighbors parameters are automatically available.

enableAutoArp

Enables Auto ARP option. If true and then MAC interface is enabled, the Learned IP Addresses and Learned MAC Addresses are automatically available.

fcfMacCollectionTime

The FCF MAC collection time.

fcoeNumRetries

FCoE number of retries before being marked as Failure. (default = 5)

fcoeRetryInterval

FCoE interval between retries. (default = 2000)

fcoeRequestRate

FCoE maximum rate (packets/second). (default = 500)

fipVersion

FIP version. (default = 1)

Option

Value

Usage

fipVersion0

0

The version in incoming packets should have the same value as the one configured in IxExplorer, otherwise packets is dropped.

fipVersion1

1

(default) See Usage for fipVersion0, above.

fipVersionAuto

8888

The protocol sends packets matching the fipversion of incoming packets. If incoming packets are version 0, then FIP sends version 0 packets; if incoming packets are version 1 then FIP sends version 1 packets.

COMMANDS

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

interfaceTable addInterface [type]

Adds the interface specified in the interfaceEntry command. The type options should be one of these:

Option

Value

Usage

interfaceTypeConnected

0

(default) A standard, connected interface

interfaceTypeGre

4

A GRE internal interface. The connected-Via option must be set to the name of an interface of type interfaceTypeConnected.

interfaceTypeRouted

5

An internal, unconnected interface. The connectedVia option must have the name of a connected interface that this interface is routed through.

interfaceTypeNpiv

6

An NPIV type interface.

interfaceTypePtp

7

A PTP type interface. (Note: When enablePTP is set 'true' in the interfaceEntry command, the PTP configuration is stored in the ptpProperties command.)

Specific errors are:

interfaceTable clearAllInterfaces [type]

Clears all of the interfaces associated with the port selected in interfaceTable select. If specified, only the interfaces defined with the interfaceEntry's interfaceType equal to type are cleared. Specific errors are:

interfaceTable clearDiscoveredNeighborTable

Clears all of the discovered neighbors associated with the port selected in interfaceTable select:

interfaceTable clearPtpHistogramData description

Clears all of the accumulated PTP histogram data associated with the selected interface. This command also stops the collection process. Specific errors are:

interfaceTable config option value

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

interfaceTable cget option

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

interfaceTable delInterface [description]

Removes an interface. The interface may either be specified with the description given when the interface was added with addInterface or the current interface as accessed with getFirstInterface, getNextInterface and getInterface. Specific errors are:

interfaceTable getDcbxDiscoveredInfo description

Gets the DCBX interface description and other information from the interface table which matches the specified description. Specific errors are:

interfaceTable getDhcpV4DiscoveredInfo description

Gets the DHCP assigned address and other information from the interface table which matches the specified description. The data may be accessed with the dhcpV4DiscoveredInfo command. Specific errors are:

interfaceTable getDhcpV6DiscoveredInfo description

Gets the DHCPv6 assigned address and other information from the interface table which matches the specified description. The data may be accessed with the dhcpV6DiscoveredInfo command. Specific errors are:

interfaceTable getDiscoveredList [description]

Obtains the discovered neighbor and address list corresponding to an interface. The interface may either be specified with the description given when the interface was added with addInterface or the current interface as accessed with getFirstInterface, getNextInterface and getInterface. This command should be called until it returns TCL_OK (0), at which time the list has been retrieved. An additional delay may be necessary if there are more than a few entries expected. The data may be accessed with the discoveredList command.

interfaceTable getFcoeDiscoveredInfo [description]

Gets the FCoE assigned address and other information from the interface table which matches the specified description. The data may be accessed with the fcoeDiscoveredInfo command. Specific errors are:

interfaceTable getFirstInterface [type]

Gets the first interface entry from the interface table. The data may be accessed with the interfaceEntry command. If specified, only the interfaces defined with the interfaceEntry's interfaceType equal to type are accessed. Specific errors are:

interfaceTable getInterface description

Gets the interface entry from the interface table which matches the specified description. The data may be accessed with the interfaceEntry command. Specific errors are:

interfaceTable getNextInterface [type]

Gets the next interface entry from the interface table. The data may be accessed with the interfaceEntry command. If specified, only the interfaces defined with the interfaceEntry's interfaceType equal to type are accessed. Specific errors are:

interfaceTable getPtpDiscoveredInfo [description]

Gets the PTP assigned address and other information from the interface table which matches the specified description. The data may be accessed with the ptpDiscoveredInfo command. Specific errors are:

interfaceTable ping [description][ipType][ipAddress]

Sends a ping to the specified IPv4 and/or IPv6 destination.Must be enabled in protocolServer to work. The available ipType are addressTypeIpV4 and addressTypeIpV6.

Specific errors are:

interfaceTable requestDiscoveredTable

Requests that the IPv6 discovered neighbors and both IPv6 and IPv4-DHCP interfaces addresses be sent back from the hardware. This should be followed by use of the getDiscoveredList command when used with IPv6 discovered neighbors. Specific errors are:

interfaceTable savePtpHistogramData description filePath

Saves to disk all the accumulated PTP histogram data associated with the selected interface. The save file is of the type comma-separated-values (.csv). Note that for the savePtpHistogramData method there is no enforcement of the file name. You may specify it as desired. IxExplorer suggests the following filename format as a convenience:

PTPHistogram-<PTPClockId>_<PTPPortId>.csv

Specific errors are:

interfaceTable select chasID cardID portID

Accesses the interface table for the indicated port. Specific errors are:

interfaceTable sendArp [description]

Sends an ARP request corresponding to an interface or all enabled interfaces. The interface may either be specified with the description given when the interface was added with addInterface or, if omitted, all enabled interfaces are ARP'd. You must use the requestDiscoveredTable command before using this command. This should be followed by a call to the requestDiscoveredList command after which point the data may be accessed with the getDiscoveredList command. Specific errors are:

interfaceTable sendArpClear

Clears the ARP table for all enabled interfaces. Specific errors are:

interfaceTable sendArpRefresh [description]

Rereads the ARP table corresponding to an interface or all enabled interfaces from the port's CPU. The interface may either be specified with the description given when the interface was added with addInterface or, if omitted, all enabled interfaces are queried. This should be followed by a call to the requestDiscoveredList command after which point the data may be accessed with the getDiscoveredList command. Specific errors are:

interfaceTable sendNeighborClear

Sends a neighbor clear message that clears the neighbor cache for all the enabled interfaces for the port. Specific errors are:

interfaceTable sendNeighborRefresh

Sends a refresh message that allows a device to refresh a neighbor that exists and is reachable. Specific errors are:

interfaceTable sendNeighborSolicitation

Allows a device to check that a neighbor exists and is reachable, and to initiate address resolution. The Neighbor Advertisement message confirms the existence of a host or router, and also provides Layer 2 address information when needed. This request corresponds to all multicast enabled interfaces. The interface may either be specified with the description that was given when the interface was added with addInterface, or, if omitted, all enabled interfaces are sent Neighbor Solicitation /message. Specific errors are:

interfaceTable sendRouterSolicitation [description]

Sends a router solicitation packet (IPv6) corresponding to an interface. The interface may either be specified with the description given when the interface was added with addInterface or the current interface as accessed with getFirstInterface, getNextInterface and getInterface. This should be followed by a call to the requestDiscoveredList command after which point the data may be accessed with the getDiscoveredList command. Specific errors are:

interfaceTable setInterface [description]

Sets an interface entry in the interface to the specified description. The data may be accessed with the interfaceEntry command. Specific errors are:

interfaceTable startPtpHistogramData description

Starts (or resumes) collecting the PTP histogram data associated with the selected interface. Specific errors are:

interfaceTable stopPtpHistogramData description

Stops collecting the PTP histogram data associated with the selected interface. Stopping the collection of data does not cause any accumulated data to be lost. Specific errors are:

interfaceTable write

Sends any changes made to the interface table to the protocol server. If more than a few interfaces are being defined, it is important that you wait until they are fully defined by monitoring the dhcpV4EnabledInterfaces and dhcpV6EnabledInterfaces statistic in the stat command. This requires that enableDhcpStats be true in the stat command. Possible errors include:

EXAMPLES

Example 1

 

package req IxTclHal

ixConnectToChassis loopback

 

set chassID [chassis cget -id]

set cardID 1

set portID 3

set pingAddress 1.1.1.2

 

set portList [list [list $chassID $cardID $portID]]

 

protocolServer get $chassID $cardID $portID

protocolServer config -enablePingResponse $::true

protocolServer set $chassID $cardID $portID

protocolServer write $chassID $cardID $portID

 

 

interfaceTable select $chassID $cardID $portID

 

# Get the interface description from the first interface that happens to be our port

interfaceTable getFirstInterface

set desc [interfaceEntry cget -description]

 

# Available ipType are addressTypeIpV4 and addressTypeIpV6

# interfaceTable $description ipType $ipAddress

 

# Clear the stats in order to see if you received pig correctly

ixClearStats portList

 

# Send ping request

interfaceTable ping $desc addressTypeIpV4 $pingAddress

 

# Wait for ping reply to come back

after 2000

 

 

ixRequestStats portList

statList get $chassID $cardID $portID

 

puts "\n *** Ping request sent on $chassID $cardID $portID: [statList cget -txPingRequest]"

puts "***Ping reply received on $chassID $cardID $portID: [statList cget -rxPingReply]"

 

Example 2

package req IxTclHal

 

# Define parameters used by OSPF router

set host localhost

set username user

 

# Check if we're running on UNIX - connect to the TCL Server

# which must be running on the chassis

if [isUNIX] {

if [ixConnectToTclServer $host] {

ixPuts "Could not connect to $host"

return 1

}

}

 

# Now connect to the chassis

if [ixConnectToChassis $host] {

ixPuts $::ixErrorInfo

return 1

}

 

# Get the chassis ID to use in port lists

set ch [ixGetChassisID $host]

 

# Port is: card 4, port 1

set ca 4

set po 1

set portList [list [list $ch $ca $po]]

 

# Login before taking ownership

if [ixLogin $username] {

ixPuts $::ixErrorInfo

return 1

}

# Take ownership of the ports we'll use

if [ixTakeOwnership $portList] {

ixPuts $::ixErrorInfo

return 1

}

 

set myMac {00 0a de 01 01 01}

set myMac2 {00 0a de 01 01 02}

set router 101.101.9.2

set router2 101.101.10.2

set neighbor 101.101.9.1

set interfaceIpMask 255.255.255.0

 

# Set up the interface table for IPv4 and IPv6 interfaces

# on the port

interfaceTable select $ch $ca $po

interfaceTable clearAllInterfaces

 

interfaceIpV6 setDefault

interfaceIpV6 config -ipAddress {0:0:0:0:0:0:0:1}

interfaceIpV6 config -maskWidth 64

interfaceEntry addItem addressTypeIpV6

 

interfaceIpV4 setDefault

interfaceIpV4 config -ipAddress $router

interfaceIpV4 config -gatewayIpAddress $neighbor

interfaceIpV4 config -maskWidth 24

interfaceEntry addItem addressTypeIpV4

 

interfaceEntry setDefault

interfaceEntry config -enable true

interfaceEntry config -description {Port 04:01 Interface-1}

interfaceEntry config -macAddress $myMac

interfaceEntry config -ipV6Gateway (1:1:1:1:1:0:0:55)

 

interfaceTable addInterface

 

interfaceEntry clearAllItems addressTypeIpV4

interfaceEntry clearAllItems addressTypeIpV6

 

interfaceIpV6 setDefault

interfaceIpV6 config -ipAddress {0:0:0:0:0:0:0:2}

interfaceIpV6 config -maskWidth 64

interfaceEntry addItem addressTypeIpV6

 

interfaceIpV4 setDefault

interfaceIpV4 config -ipAddress $router2

interfaceIpV4 config -gatewayIpAddress $neighbor

interfaceIpV4 config -maskWidth 24

interfaceEntry addItem addressTypeIpV4

 

interfaceEntry setDefault

interfaceEntry config -enable true

interfaceEntry config -description {Port 04:01 Interface-2}

interfaceEntry config -macAddress $myMac2

interfaceTable addInterface

interfaceTable write

 

# Now go through the table and print all interfaces and addresses

interfaceTable select $ch $ca $po

 

# Loop through all interfaces

for {set bRes [interfaceTable getFirstInterface]} \

{$bRes == 0} {set bRes [interfaceTable getNextInterface]} {

 

ixPuts "Interface: " [interfaceEntry cget -description] \

", MAC: " \

[interfaceEntry cget -macAddress]

 

# Get the one optional IpV4 entry

if {[interfaceEntry getFirstItem addressTypeIpV4] == 0} {

ixPuts "\tIPv4 Address:"

ixPuts "\t\t" [interfaceIpV4 cget -ipAddress] "/" \

[interfaceIpV4 cget -maskWidth] ", GW: " \

[interfaceIpV4 cget -gatewayIpAddress]

}

 

# Loop through all IPv6 addresses

for {set bRes [interfaceEntry getFirstItem addressTypeIpV6]}\

{$bRes == 0} \

{set bRes [interfaceEntry getNextItem addressTypeIpV6]} {

ixPuts "\tIPv6 Addresses:"

ixPuts "\t\t" [interfaceIpV6 cget -ipAddress] "/" \

[interfaceIpV6 cget -maskWidth]

}

}

 

# Now request and get the discovered neighbor and address list

# for all interfaces

 

interfaceTable clearDiscoveredNeighborTable

 

# Loop through all interfaces

for {set bRes [interfaceTable getFirstInterface]} \

{$bRes == 0} {set bRes [interfaceTable getNextInterface]} {

 

ixPuts "Interface: " [interfaceEntry cget -description]

 

# Send a request command on the network

if [interfaceTable sendRouterSolicitation] {

ixPuts "Can't send router solicitation"

} else {

 

# Wait for responses

after 5000

# Ask for the discovered table

if [interfaceTable requestDiscoveredTable] {

ixPuts "Can't request discovered table"

} else {

 

# Now wait until it finishes reading back

ixPuts -nonewline "Waiting."

for {set count 0} \

{[interfaceTable getDiscoveredList] != 0 && \

$count < 10} {incr count} {

ixPuts -nonewline "."

after 1000

}

ixPuts ""

if {$count == 10} {

ixPuts "Can't get discovered list"

} else {

 

# Wait for a bit to ensure that all of the entries

# have been retreived.

after 5000

# Get the discovered addresses

for {set bRes [discoveredList getFirstAddress]} \

{$bRes == 0} \

{set bRes [discoveredList getNextAddress]} {

ixPuts "\tDiscovered address: " \

[discoveredAddress cget -ipAddress]

}

# Get the discovered neighbors

for {set bRes [discoveredList getFirstNeighbor]} \

{$bRes == 0} \

{set bRes \

[discoveredList getNextNeighbor]} {

for {set bRes \

[discoveredNeighbor getFirstAddress]} \

{$bRes == 0} \

{set bRes \

[discoveredNeighbor getNextAddress]} {

ixPuts -nonewline \

"\tDiscovered neighbor: address: " \

[discoveredNeighbor cget -ipRouter]

ixPuts ", mac address: " \

[discoveredNeighbor cget -macAddress]

}

}

}

}

}

}

 

# Send ARP to each interface one at a time

if {[interfaceTable select $ch $ca $po]} {

logMsg "Error selecting port"

set retCode "FAIL"

}

 

 

for {set i 1} {$i < 2} {incr i} {

if {[interfaceTable sendArp "Port 04:01 Interface-$i"]} {

logMsg "Error sending Arp for interface $i"

set retCode "FAIL"

}

}

 

if {[interfaceTable requestDiscoveredTable]} {

logMsg "Error in requesting discoveredTable"

set retCode "FAIL"

}

after 10000

 

for {set i 1} {$i < 2} {incr i} {

if {![interfaceTable getDiscoveredList \

"Port 04:01 Interface-$i"]} {

# Use discoveredList as above

} else {

set retCode "FAIL"

}

}

 

######################################################################

#

# DHCP example

#

######################################################################

 

# Init the interface table

if [interfaceTable select $ch $ca $po] {

logMsg "Error selecting $ch $ca $po"

set retCode "FAIL"

}

interfaceTable clearAllInterfaces

 

# Initialize and set DHCP properties for interface

dhcpV4Properties setDefault

dhcpV4Properties removeAllTlvs

dhcpV4Properties config -clientId Client1

dhcpV4Properties config -serverId 1.1.1.2

dhcpV4Properties config -vendorId Ixia1

V4Properties config -renewTimer 600

 

# Define a type 2 TLV

dhcpV4Tlv setDefault

dhcpV4Tlv config -type 2

dhcpV4Tlv config -value {AA AB 22}

if [dhcpV4Properties addTlv] {

logMsg "Error in dhcpV4Properties addTlv"

set retCode "FAIL"

}

 

# Define a type 12 TLV

dhcpV4Tlv config -type 12

dhcpV4Tlv config -value {A1 A2 B1 B2}

if [dhcpV4Properties addTlv] {

logMsg "Error in dhcpV4Properties addTlv"

set retCode "FAIL"

}

 

# Define an interface entry that uses DHCP

interfaceEntry setDefault

interfaceEntry config -enable true

interfaceEntry config -enableDhcp true

interfaceEntry config -description "Port 04:01 Interface-1"

 

# Now add the interface entry to the table

if [interfaceTable addInterface interfaceTypeConnected] {

logMsg "Error in interfaceEntry addInterface"

set retCode "FAIL"

}

 

# Tell the stream to use an interface and the particular interface

stream config -enableSourceInterface true

stream config -sourceInterfaceDescription "Port 04:01 Interface-1"

if [stream set $ch $ca $po 1] {

logMsg "Error in interfaceEntry addInterface"

set retCode "FAIL"

}

 

# Enable DHCP statistics

stat config -enableDhcpStats true

stat set $ch $ca $po

stat write $ch $ca $po

 

# Send the interface table to the chassis

if [interfaceTable write] {

logMsg "Error in interfaceTable write"

set retCode "FAIL"

}

 

# Need to wait until the interface has been defined and

while {1} {

sleep 200

stat get allStats $ch $ca $po

if {1 == [stat cget -dhcpV4EnabledInterfaces]} {

break

}

}

 

# Need to wait until the DHCP server has assigned an address

interfaceTable requestDiscoveredTable

while {1} {

sleep 200

stat get allStats $ch $ca $po

if {1 == [stat cget -dhcpV4AddressesLearned]} {

break

}

}

 

if [interfaceTable select $ch $ca $po] {

logMsg "Error selecting $ch $ca $po"

set retCode "FAIL"

}

 

# Get the first interface

if [interfaceTable getFirstInterface interfaceTypeConnected] {

logMsg "Error getFirstInterface $ch $ca $po"

set retCode "FAIL"

}

 

# Ask for the discovered DHCP information

if [interfaceTable requestDiscoveredTable] {

logMsg "Error requestDiscoveredTable $ch $ca $po"

set retCode "FAIL"

}

 

# And fetch it - attempts will timeout after 10s

set time_elapsed_ms 0

while {[interfaceTable getDhcpV4DiscoveredInfo "Port 04:01 Interface-

1"]} {

if {$time_elapsed_ms > 10000} {

logMsg "Error getDhcpV4DiscoveredInfo $ch $ca $po"

set retCode "FAIL"

}

incr time_elapsed_ms 100

after 100

}

# Pull out the assigned IP address, mask, gateway and timer

set ipAddress [dhcpV4DiscoveredInfo cget -ipAddress]

set prefixLength [dhcpV4DiscoveredInfo cget -prefixLength]

set gatewayIpAddress [dhcpV4DiscoveredInfo cget -gatewayIpAddress]

set renewTimer [dhcpV4DiscoveredInfo cget -renewTimer]

 

# Look at the first TLV

if [dhcpV4DiscoveredInfo getFirstTlv] {

logMsg "Error getFirstTlv $ch $ca $po"

set retCode "FAIL"

}

set type [dhcpV4Tlv cget -type]

set value [dhcpV4Tlv cget -value]

 

 

# Let go of the ports that we reserved

ixClearOwnership $portList

# Disconnect from the chassis we're using

ixDisconnectFromChassis $host

# If we're running on UNIX, disconnect from the TCL Server

if [isUNIX] {

ixDisconnectTclServer $host

}

 

SEE ALSO

discoveredAddress, discoveredList, discoveredNeighbor, interfaceEntry, interfaceIpV4, interfaceIpV6, dhcpV4DiscoveredInfo, dhcpV4Properties, dhcpV4Tlv.