The following shows the procedure to add configuration information.
Set up a virtual interface using the "hanetconfig create" command. For information, see "7.1 hanetconfig Command".
Edit the interface setting file of the virtual interface to set the IP address or netmask.
The interface setting file of the virtual interface is created when the virtual interface is set by the "hanetconfig create" command.
Setup the monitoring destination information by using the "hanetpathmon target" command. For details, see "7.12 hanetpathmon Command".
Edit the setting (/etc/sysconfig/network-scripts/ifcfg-shaX file) for a virtual interface as follows:
Item | Value (Example) | Description |
---|---|---|
DEVICE | shaX | Specify the device name. Set to "ethX". |
IPADDR | 192.168.1.1 | Specify the IP address. |
NETMASK | 255.255.255.0 | Specify the subnet mask. Set either NETMASK or PREFIX. |
PREFIX | 24 | |
NETWORK | 192.168.1.0 | Specify the network address. Omit this step if PREFIX is specified. |
BROADCAST | 192.168.1.255 | Specify the broadcast address. Omit this step if PREFIX is specified. |
BOOTPROTO | static | Specify the protocol when getting the IP address. Set to "static" or "none". |
ONBOOT | yes | Select whether to start the virtual interface on startup of the operating system. Set to "yes". |
DEVICETYPE | sha | Specify the type of the device. Set to "sha". |
HOTPLUG | no | Specify use of hotplug. Set to "no". |
GATEWAY | 192.168.2.1 | Specify the IP address when setting the default gateway. |
IPV6INIT | yes | Specify "yes" when assigning the IPv6 address. |
IPV6ADDR | fec0:1::1/64 | Specify the IPv6 address. |
IPV6_DEFAULTGW | fec0:1::2 | Specify the IPv6 address when setting the default gateway of IPv6. |
BRIDGE | br0 | Specify the name of the virtual bridge which is to be connected to the virtual interface. |
Example of /etc/sysconfig/network-scripts/ifcfg-sha0
[For IPv4]
DEVICE=sha0 IPADDR=192.168.1.1 NETMASK=255.255.255.0 BOOTPROTO=static ONBOOT=yes DEVICETYPE=sha HOTPLUG=no |
[For IPv6]
DEVICE=sha0 IPV6INIT=yes IPV6ADDR=fec0:1::1/64 BOOTPROTO=static ONBOOT=yes DEVICETYPE=sha HOTPLUG=no |
[For DualStack]
DEVICE=sha0 IPADDR=192.168.1.1 NETMASK=255.255.255.0 IPV6INIT=yes IPV6ADDR=fec0:1::1/64 BOOTPROTO=static ONBOOT=yes DEVICETYPE=sha HOTPLUG=no |
When creating a tagged VLAN interface (shaX.Y) of which VLAN-ID is Y on a virtual interface (shaX), edit the setting file (/etc/sysconfig/network-scripts/ifcfg-shaX.Y) for a tagged VLAN interface as follows. The effective range of VLAN-ID which can be specified is from 1 to 4094.
/etc/sysconfig/network-scripts/ifcfg-eth0.2
[For IPv4]
DEVICE=sha0.2 IPADDR=192.168.100.1 NETMASK=255.255.255.0 BOOTPROTO=static ONBOOT=yes DEVICETYPE=sha |
[For IPv6]
DEVICE=sha0.2 IPV6INIT=yes IPV6ADDR=fec0:100::1/64 BOOTPROTO=static ONBOOT=yes DEVICETYPE=sha |
[For DualStack]
DEVICE=sha0.2 IPADDR=192.168.100.1 NETMASK=255.255.255.0 IPV6INIT=yes IPV6ADDR=fec0:100::1/64 BOOTPROTO=static ONBOOT=yes DEVICETYPE=sha |
Note
In Virtual NIC mode, you cannot share physical interfaces with other virtual interfaces.
Just as for the standard interface of the operating system, define IP address and netmask settings in the interface setting file (/etc/sysconfig/network-scripts/ifcfg-shaX) in Virtual NIC mode. Subnet mask settings by the hanetmask command are only necessary when the cluster takeover IP address is set by the hanethvrsc command.
For implementing tagged VLAN communication in Virtual NIC mode, generate a tagged VLAN interface on the virtual interface. The procedure for generation is the same as for the standard tagged VLAN interface of the operating system.
Do not delete a file or change a file name for the interface setting file of the virtual interface (/etc/sysconfig/network-scripts/ifcfg-shaX). If you change or delete a file name, the interface setting file is omitted from the backup target when you back up configuration files by the "hanetbackup" command.
Directly edit the interface setting file (/etc/sysconfig/network-scripts/ifcfg-shaX) for a virtual interface and the setting file (/etc/sysconfig/network-scripts/ifcfg-shaX.Y) for a tagged VLAN interface by using an editor such as vi. You cannot make any settings by using the network configuration function provided by GUI or other interfaces of the operating system.