4.13.11 Set IP address
Function
This plugin sets an IP address for the specified NIC on a Windows or UNIX execution target server.
Use the NIC name (os.nicName property) to specify the NIC for which the IP address is to be set, or use MAC address (os.nicMacAddress property), when the execution target server is Windows.
If both of these properties are specified, the IP address is set for the NIC specified by the NIC name.
This plugin requires the following server:
- Execution target server
A server that executes the plugin to set an IP address
The following describes the NIC name (os.nicName property).
- Specify the interface name of the NIC for which the IP address is to be set.
The following describes the MAC address (os.nicMacAddress property).
- Specify the MAC address of the NIC for which the IP address is to be set.
- Use the XX:XX:XX:XX:XX:XX format.
The following describes the configuration files and setting items when the execution target server is Linux.
- Configuration file and setting items for the IP address and subnet mask
File: /etc/sysconfig/network-scripts/ifcfg-XXX (XXX: NIC interface name)
Setting items:
(1) BOOTPROTO=none (If "static" is already set, "static" is not changed.)
(2) IPADDR=<IP-address>
(3) NETMASK=<subnet-mask>
- Configuration file and setting item for the default gateway
File: /etc/sysconfig/network
Setting item: (1) GATEWAY=<default-gateway>
- Configuration file and setting item for the IP address of the DNS server
File: /etc/sysconfig/network-scripts/ifcfg-XXX (XXX: NIC interface name)
Setting item: (1) DNS1=<DNS-server-IP-address>
The following provides examples of setting the NIC name.
- If the execution target server is Windows Server 2022
For the NIC name, specify an interface name such as "Ethernet0" or "Ethernet1". This name is displayed for the Ethernet adapter by the ipconfig command.
- If the execution target server is Linux
For the NIC name, specify an interface name such as "eth0" or "eth1". This name is displayed for the interface by the ifconfig command.
Use situation
You can use this plugin to set an IP address of an NIC recognized by the OS.
Prerequisites
See the Release Notes for the latest support statuses of prerequisite products for the execution-target system, prerequisite products on the execution-target server, and the supported OSs for the prerequisite products for the execution-target server.
In addition, the following OS and products use abbreviations. For the abbreviations of OS and products, see the "Preface".
Supported OSs for the prerequisite products for the execution-target server:
- Windows Server
- Red Hat Enterprise Linux Server
The net-tools package must be installed.
- Oracle Linux
The net-tools package must be installed.
Cautions
(1) Do not specify a string containing a double-quotation mark (") or single quotation mark (') for a property of this plugin.
(2) Do not change the IP address of the NIC used for communication with the JP1/AO server. If this IP address is changed, communication with the JP1/AO server is disconnected and this plugin ends abnormally.
(3) Do not enter values that cannot be set as IP addresses for the IP address that is set to the OS. For example, you cannot specify network addresses, broadcast addresses, and special addresses such as "0.0.0.0" and "255.255.255.255".
(4) Make sure that the specified IP address is different from the IP addresses of other servers. If another server has the same IP address, the NIC is invalid, and the plugin might end abnormally.
(5) If the execution target server is Linux, the setting items in the configuration files shown in "Description" are replaced with the specified values. Therefore, do not define multiple setting items with the same name, and do not comment out setting items. If you do so, this plugin ends normally but the settings are not applied.
Version
02.00.00
Plug-in tags
Configure OS,Windows,Linux
Plug-in name displayed in the task log
osSetIpAddress
Return code
12: Error (Mistake by user) Invalid property
27: Error (Check with the task log about the error detail) Unidentified error
41: Error (An error was detected in the component) Property not entered (An error was detected in the component script)
Property list
The following table lists the properties:
Property key |
Property name |
Description |
Default value |
I/O type |
Required |
---|---|---|---|---|---|
plugin.destinationHost |
Host name of the execution target server |
Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported. |
-- |
Input |
R |
os.nicName |
NIC name |
Specifies the name of the NIC for which the IP address is to be set. |
-- |
Input |
O |
os.nicMacAddress |
MAC address |
Specifies the MAC address of the NIC for which the IP address is to be set. |
-- |
Input |
O |
os.nicIpAddress |
IP address |
Specifies the IP address to be set for the NIC. IPv6 addresses are not supported. |
-- |
Input |
R |
os.nicSubnetMask |
Subnet mask |
Specifies the subnet mask to be set for the NIC. IPv6 addresses are not supported. |
-- |
Input |
R |
os.nicDefaultGW |
Default gateway |
Specifies the default gateway to be set for the NIC. IPv6 addresses are not supported. |
-- |
Input |
O |
os.nicDns |
DNS server's IP address |
Specifies the DNS server's IP address to be set for the NIC. IPv6 addresses are not supported. |
-- |
Input |
O |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
O |