Top
PRIMECLUSTER Global Link Services Configuration and AdministrationGuide 4.7Redundant Line Control Function

7.1 hanetconfig Command

Note

This version does not support IPv6 addresses for the NIC Switching mode and Fast Switching mode.
When using the NIC Switching mode or Fast Switching mode, it is not possible to execute commands or specify parameters related to IPv6 addresses.

[Name]

hanetconfig - Setting, modifying, deleting, and displaying a configuration definition of Redundant Line Control Function

[Synopsis]

/opt/FJSVhanet/usr/sbin/hanetconfig command [args]

[Feature description]

The hanetconfig command defines configuration information required for the operation of Redundant Line Control Function. This command also modifies, deletes, and displays a setting.

Command

Process outline

Authority

create

Creates configuration information

Super user

copy

Copies configuration information

Super user

print

Displays configuration information

General user

modify

Modifies configuration information

Super user

delete

Deletes configuration information

Super user

version

Displays the version

General user

(1) create command

Configuration information must be defined for a virtual interface before Redundant Line Control Function can be operated. Use the create command to create a definition of configuration information. The create command can also create definitions of more than one logical virtual interface on the virtual interface. The following is the command format for building a virtual interface:

[inet | inet6]

Specify an IP address form to set to a virtual interface.

inet
inet6

: IPv4 address
: IPv6 address

When omitted, it is dealt with as specified inet. It is necessary to specify this option first (immediately after a string of "create") before other options.
This option can be specified only when using Fast switching mode or NIC switching mode (a logical IP address takeover function).


-n devicename:

Specify the name of a virtual interface or logical virtual interface for which the configuration information should be set. Up to 64 names can be set. Specify the virtual interface name with a string of "sha" and is followed by a value (0 to 255) (such as sha0 and sha10). Specify the logical virtual interface name as "virtual-interface-name: value (2 to 64)" (such as sha0:2 and sha10:5). If you specify a virtual interface or logical virtual interface in any other format, an error message is output and this command terminates abnormally. Logical virtual interface can only be configured on operation mode "t" and "c".


-m t|d|e|p|q|v|c:

Specify an operation mode. If devicename is a logical virtual interface, specify the operation mode of a corresponding virtual interface.

t: Fast switching mode

Specify this parameter to use the Redundant Line Control Function in Fast switching mode. This mode creates a virtual interface used in Fast switching mode.

d: NIC switching mode (logical IP address takeover function)

Specify this parameter to use the Redundant Line Control Function in NIC switching mode. Communication is performed by activating a physical interface to be used and its logical interface and taking over the IP address attached to the logical interface.

e: NIC switching mode (physical IP address takeover function)

Specify this parameter to use the Redundant Line Control Function in NIC switching mode. Communication is performed by taking over the IP address attached to the physical interface without activating a logical interface.

p: Standby patrol function (automatic fail-back if a failure occurs)

Specify this parameter to use the Redundant Line Control Function in NIC switching mode and monitor the status of the standby NIC. If the standby NIC is communicating due to a failure and the active NIC recovers, no fail-back occurs until the currently used NIC encounters a failure.

q: Standby patrol function (immediate automatic fail-back)

Specify this parameter to use the Redundant Line Control Function in NIC switching mode and monitor the status of the standby NIC. If the standby NIC is communicating due to a failure and the active NIC recovers, a fail-back immediately occurs.

v: Virtual NIC mode

Specify this parameter to use the Redundant Line Control function in Virtual NIC mode. This mode creates a virtual interface used in Virtual NIC mode.

c: GS linkage mode

Specify this parameter to use the Redundant Line Control function in GS linkage mode.

This mode creates a virtual interface used in GS linkage mode. This mode creates a virtual interface used in GS linkage mode.


The following table lists options that can be specified in each operation mode.

Operation mode

Specifiable parameter

inet | inet6

-n

-i

-e

-t

't' (Fast switching mode)

Supported

O

O (*6)

X

O (*1)

'd' (NIC switching mode (logical IP address takeover function))

Supported

O

O

O (*4)

O (*2)

'e' (NIC switching mode (physical IP address takeover function))

Not supported

O

O

O (*5)

O (*2)

'p' (Standby patrol function (automatic fail-back if a failure occurs))

Not supported

O

X

X

O (*3)

'q' (Standby patrol function (immediate automatic fail-back))

Not supported

O

X

X

O (*3)

'v' (Virtual NIC mode)

Not supported

O

X

X

O (*2)

'c' (GS linkage mode)

Not supported

O

O

X

O (*1)

[Meaning of the symbols] 0: Required, X: Not required

*1 Specify a physical interface (The same physical interface can be specified if the operation mode is "t"). 1 to 8 physical interfaces can be assigned.
*2 Specify a physical interface that is not specified in any other operation mode. One or two physical interface can be assigned.
*3 Specify a virtual interface specified in the operation mode "d" or "e". Only one interface can be assigned.
*4 It is not possible to specify this parameter when set inet6 to an address form.
*5 This parameter may be omitted if the physical IP address takeover function II is used (not activating an interface on the standby node in the cluster system).
*6 It can specify, only when creating logical virtual interface.


-i ipaddress1[/prefix]:
ipaddress1

Specify a host name or an IP address to assign to a virtual interface or a logical virtual interface (devicename specified by -n option). The specified host must be defined in an /etc/hosts file. When assigning an IP address to a logical virtual interface, it is necessary to specify the same subnet as that of a virtual interface. If specified a different subnet, occasionally it is not possible to communicate. The host name that can be specified is 16 characters or less.

[/prefix]

Specify the length of a prefix of ipaddress1 following "/" (slash). The range possible to specify is between zero to 128. This parameter is required only when specifying an IPv6 address to ipaddress1 or a host name defined in an /etc/hosts file. It is not possible to specify for an IPv4 address.


-e ipaddress2:

Specify an IP address or a host name to assign to a physical interface. It is possible to set an IP address or a host name in an IPv4 form only and must be defined in an /etc/hosts file. It is possible to specify this option only when specified inet for an address form. (When specified inet6, a link local address is automatically assigned.) It is necessary to set this option in NIC switching mode (operation mode is "d" or "e"). In cluster operation, it is possible to omit this option if an interface of NIC switching mode (operation mode is "e") is not activated by a standby node.


-t interface1[,interface2,...]:

Specify interface names to be bundled by a virtual interface, by listing them delimited with a comma (,).
Specify virtual interface names (such as sha1 and sha2) for standby patrol function (operation mode "p" or "q").
Specify physical interface names (such as eth0) or tagged VLAN interface names (such as eth0.1 or eth1.2) for any other mode (operation mode "t", "d" "e" "v", or "c") than standby patrol function.


-s SHAMACADDR:

Specify the method for assigning a MAC address to a virtual interface. This option is available on RHEL9.
If you specify a MAC address for SHAMACADDR, the MAC address is assigned. The MAC address format you can specify is XX:XX:XX:XX:XX:XX. where XX is a 16 number separated by a colon (:).
If you specify "auto", a MAC address is automatically assigned.
If you specify "primary", the same MAC address as the primary NIC which it binds is assigned.
If you omit this option, the configuration information is created with "primary" specified.

(2) copy command

Use the copy command to create different configuration information while sharing a NIC used in other configuration information (virtual interface in NIC switching mode (operation mode "d")). This command thus allows configuration information to be automatically created by using the copy source information and without requiring you to specify an IP address to be attached to a physical interface, interface names to be bundled by a virtual interface, and an operation mode. This command realizes simpler operation than directly executing the hanetconfig create command.
In addition, this command can copy only virtual interface of NIC switching mode (operation mode "d").
The following is the command format for copying a virtual interface:

[inet | inet6]

Specify an IP address form to set to a copy-to virtual interface.

inet
inet6

: IPv4 address
: IPv6 address

When omitted, it is dealt with as specified inet. It is necessary to specify this option first (immediately after a string of copy) before other options.


-n devicename1, devicename2:
devicename1:

Specify a copy-from virtual interface name. It is possible to specify only a virtual interface name of NIC switching mode (operation mode is "d").

devicename2:

Specify a copy-to virtual interface name. When configuring IPv4/IPv6 dual stack, specify the same virtual interface name (devicename1) as that of copy-from.


-i ipaddress1[/prefix]:

Specify a host name or an IP address to assign to a copy-to virtual interface specified by devicename2. See -i option of a create command for the detail of how to set.


-e ipaddress2:

Specify an IP address or a host name to assign to a physical interface. This option is required to duplicate a virtual interface of IPv4 from that of IPv6 (dual stack configuration). See -e option of a create command for the detail of how to set.

(3) print command

Use the print command to display the current configuration information. The following is the format of the print command.

/opt/FJSVhanet/usr/sbin/hanetconfig print [-n devicename1[,devicename2,...]] [-s]

-n devicename1[,devicename2,...]

Specify the name of a virtual interface or logical virtual interface whose configuration information should be displayed. If this option is not specified, the print command displays all the configuration information for the currently set virtual interfaces and logical virtual interfaces.
The following shows an example of displaying configuration information.

# /opt/FJSVhanet/usr/sbin/hanetconfig print
[IPv4,Patrol / Virtual NIC]
 Name        Hostname        Mode Physical ipaddr   Interface List
+-----------+---------------+----+-----------------+---------------------------+
 sha0        192.168.10.110   d   192.168.10.10     eth0,eth1
 sha1        -                p   -                 sha0
 sha2        hostC            d   hostC1            eth2,eth3
 sha3        -                p   -                 sha2
 sha4                         v                     eth4,eth5

[IPv6]
 Name        Hostname/prefix                   Mode Interface List
+-----------+---------------------------------+----+---------------------------+
 sha0        fec0:1::123/64                     d   eth0,eth1
-s

If you specify this option, the SHAMACADDR setting for the Virtual NIC mode is additionally displayed. This option is available on RHEL9.
The following shows an example of displaying configuration information with SHAMACADDR by using -s option.

# /opt/FJSVhanet/usr/sbin/hanetconfig print -s
[IPv4,Patrol / Virtual NIC]
 Name        Hostname        Mode Physical ipaddr   SHAMACADDR          Interface List
+-----------+---------------+----+-----------------+-------------------+---------------------------
 sha0        192.168.10.100   d   192.168.10.10                         eth0,eth1
 sha1        -                p   -                                     sha0
 sha2        hostC            d   hostC1                                eth2,eth3
 sha3                         p                                         sha2
 sha4                         v                     00:0B:5D:9F:A0:22   eth6,eth7
 sha5                         v                     primary             eth8
 sha6                         v                     auto                eth9

[IPv6]
 Name        Hostname/prefix                   Mode Interface List    
+-----------+---------------------------------+----+---------------------------+
 sha2        fec0:1::123/64                     d   eth0,eth1

Display

Contents

[IPv4,Patrol / Virtual NIC]

The information of a virtual interface for IPv4 and standby patrol and a virtual interface in Virtual NIC mode

[IPv6]

The information of an IPv6 virtual interface

Name

A virtual interface name

Hostname

The host name or IP address of a virtual interface

Hostname/prefix

The host name or IP address of a virtual interface, and the prefix value

Mode

The operation mode of a virtual interface
(For details, see the "-m" option of the "create" command.)

SHAMACADDR

The method for assigning a MAC address to a virtual interface (operation mode “v”)

Interface List

A virtual interface name in standby patrol function (operation mode "p" or "q"). Outputs a physical interface name (such as eth0) in other mode.

(4) modify command

Use the modify command to modify the configuration of Redundant Line Control Function.
The following is the format of the modify command that modifies configuration information for a virtual interface:

[inet | inet6]

Specify an IP address form to set to a changing virtual interface.

inet
inet6

: IPv4 address
: IPv6 address

When omitted, it is dealt with as specified inet. It is necessary to specify this option first (immediately after a string of modify) before other options.
This option can be specified only when using Fast switching mode or NIC switching mode (a logical IP address takeover function).


-n devicename:

Specify the name of a virtual interface whose configuration information should be modified. This parameter is required.


-i ipaddress1[/prefix]:

Specify a host name or IP address to be attached to a virtual or logical virtual interface (devicename specified by -n option) to be used for Redundant Line Control Function.
This host name must correspond to an IP address in a network database such as the /etc/hosts file. You can directly specify an IP address instead of a host name. In this case, you must specify the IP address in dotted decimal notation. When you specify address information for a logical virtual interface, be sure to specify an address in the same subnet as the address of a corresponding virtual interface. Communication may be disabled if any other subnet is specified.


-e ipaddress2:

Specify an IP address to be attached to a physical interface. This host name must correspond to an IP address in a network database such as the /etc/hosts file. You can directly specify an IP address instead of a host name. In this case, you must specify the IP address in dotted decimal notation.
This parameter can be modified only if the operation mode of a virtual interface to be modified is NIC switching mode (operation mode "d" or "e").


-t interface1[,interface2,...]:

Specify interface names to be bundled by a virtual interface, by listing them delimited with a comma (,).
Specify virtual interface names (such as sha1 and sha2) if the operation mode of a virtual interface to be modified is standby patrol function (operation mode "p" or "q").
Specify physical interface names (such as eth0) if the operation mode of a virtual interface to be modified is not standby patrol function (operation mode "p" or "q").


-s SHAMACADDR:

Specify the method for assigning a MAC address to a virtual interface. This option is available on RHEL9.
If you specify a MAC address for SHAMACADDR, the MAC address is assigned. The MAC address format you can specify is XX:XX:XX:XX:XX:XX. where XX is a 16 number separated by a colon (:).
If you specify "auto", a MAC address is automatically assigned.
If you specify "primary", the same MAC address as the primary NIC which it binds is assigned.

(5) delete command

Use the delete command to delete the configuration of Redundant Line Control Function. The following is the format of the delete command:

/opt/FJSVhanet/usr/sbin/hanetconfig delete [inet | inet6] -n {devicename1[,devicename2,...] | all}

[inet | inet6]

Specify an IP address form of a deleting virtual interface.

inet
inet6

: IPv4 address
: IPv6 address

When omitted, it is dealt with as specified inet. It is necessary to specify this option first (immediately after a string of delete) before other options.
This option can be specified only when using Fast switching mode or NIC switching mode (a logical IP address takeover function).


-n devicename1[,devicename2,...]:

Specify the names of virtual interfaces (such as sha0 and sha1) or logical virtual interfaces (such as sha0:2 and sha1:10) whose configuration information should be deleted.


all:

Specify this parameter to delete all the defined virtual and logical interfaces.

(6) version command

The version of this product is displayed. The following is the format of the version command.

/opt/FJSVhanet/usr/sbin/hanetconfig version

The following shows an example of displaying version information.

HA-Net version 2.20

[Notes]

[Examples]

(1) create command

The following shows an example of the setting command used in Fast switching mode to bundle two physical interfaces (eth0 and eth1) as the virtual interface host HAhost to duplicate the virtual interface sha0.

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m t -i HAhost -t eth0,eth1

The following shows an example of the setting command used to define two logical virtual interfaces (sha0:2 and sha0:3) on the virtual interface (sha0).

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m t -i hostf -t eth0,eth1
# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0:2 -i hostg
# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0:3 -i hosth

The following shows an example of the setting command used to have the virtual interface (sha0) bundle only one physical interface (eth0).

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m t -i hosti -t eth0

The following shows an example of the setting command used in NIC switching mode to set two physical interfaces (eth0 and eth1) and use the logical IP address takeover function and the standby patrol function (operation mode "p"). Before NIC switching mode can be used, the HUB monitoring function must be set.

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m d -i hostg -e hosth -t eth0,eth1
# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha1 -m p -t sha0

The following shows an example of the setting command used in NIC switching mode to set two physical interfaces (eth0 and eth1) and use the physical IP address takeover function and the standby patrol function (operation mode "p"). Before NIC switching mode can be used, the HUB monitoring function must be set.

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m e -i hosti -e hostj -t eth0,eth1
# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha1 -m p -a 02:00:00:00:00:01 -t sha0

The following shows an example of the setting command used in GS linkage mode to bundle two physical interfaces (eth1 and eth2) as the virtual interface host "hostf" to duplicate the virtual interface sha0.

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m c -i hostf -t eth1,eth2

The following shows an example of the setting command used in NIC switching mode to set two tagged VLAN interfaces (eth0.1 and eth1.1) and use the logical IP address takeover function and the standby patrol function (operation mode "p"). Before NIC switching mode can be used, the HUB monitoring function must be set.

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m d -i hostg -e hosth -t eth0.1,eth1.1
# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha1 -m p -t sha0

The following shows an example of setting the virtual interface (sha0) by bundling two physical interfaces (eth0 and eth1) in Virtual NIC mode.

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m v -t eth0,eth1

The following shows an example of the setting when the virtual interface (sha0) bundles two physical interfaces (eth0 and eth1) in Virtual NIC mode, and how to set the MAC address for sha0 to 00:0B:5D:9F:A0:22.

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m v -t eth0,eth1 -s 00:0B:5D:9F:A0:22

The following shows an example of setting when the virtual interface (sha0) bundles one physical interface (eth0).

# /opt/FJSVhanet/usr/sbin/hanetconfig create -n sha0 -m v -t eth0

(2) modify command

The following is an example of modifying bundled physical interfaces (eth0 and eth1) in the virtual interface (sha0) to different physical interfaces (eth2 and eth3).

# /opt/FJSVhanet/usr/sbin/hanetconfig modify -n sha0 -t eth2,eth3

The following is an example of modifying the virtual IP address defined in the virtual interface (sha0).

# /opt/FJSVhanet/usr/sbin/hanetconfig modify -n sha0 -i hostc

The following is an example of modifiying the method for assigning a MAC address to the virtual interface (sha0) to automatic assignment.

# /opt/FJSVhanet/usr/sbin/hanetconfig modify -n sha0 -s auto

The following is an example of modifiying the MAC address of the virtual interface (sha0) to be the same as the primary physical interface.

# /opt/FJSVhanet/usr/sbin/hanetconfig modify -n sha0 -s primary

(3) copy command

The following is an example of sharing the NIC, used in the virtual interface (sha0 for IPv4) for NIC switching mode (operation mode "d"), with another virtual interface (sha2 for IPv4).

# /opt/FJSVhanet/usr/sbin/hanetconfig copy -n sha0,sha2 -i host4

(4) delete command

The following is an example of deleting the virtual interface (sha2 for IPv4).

# /opt/FJSVhanet/usr/sbin/hanetconfig delete -n sha2

The following is an example of deleting the virtual interface (sha2 for IPv6).

# /opt/FJSVhanet/usr/sbin/hanetconfig delete inet6 -n sha2

The following is an example of deleting the logical virtual interface (sha0:2).

# /opt/FJSVhanet/usr/sbin/hanetconfig delete -n sha0:2

The following is an example of deleting the logical virtual interface (sha0:2 for IPv6).

# /opt/FJSVhanet/usr/sbin/hanetconfig delete inet6 -n sha0:2

The following is an example of deleting the virtual interface (sha0) in Virtual NIC mode.

# /opt/FJSVhanet/usr/sbin/hanetconfig delete -n sha0