You can use the hanetnic command to add or delete a physical adapter bundled in a virtual adapter and to change the operational status of a physical adapter bundled in a virtual adapter. Subcommands of the hanetnic command are listed in the table below.
Subcommand | Description | Required Rights |
---|---|---|
add | Adds a physical adapter. | Administrators |
delete | Deletes a physical Adapter. | Administrators |
change | Changes the operational status. | Administrators |
To add a physical adapter to a virtual adapter, use the add subcommand.
This command can be used regardless of whether the virtual adapter is activated or deactivated.
Format
hanetnic add -n vadapter -t adapter
Description
Adds a physical adapter bundled in a virtual adapter dynamically.
Options
-n vadapter
Specifies the name of the virtual adapter to which the physical adapter is added.
-t adapter
Specifies the name of the physical adapter to be added. If the physical adapter name contains a space, the network adapter name must be enclosed in double quotation marks ( " ). It is also possible to abbreviate the text string "Ethernet" or "Local Area Connection" in specifying the name of a physical adapter.
Notes
Make sure that the network properties screen is closed before running this command. Otherwise, an error may occur in executing the command.
When you specify a virtual adapter that shares a physical adapter with any other virtual adapters by the -n option, the physical adapter specified by the -t option will be added to all virtual adapters sharing the physical adapter.
Do not force termination while the command is running. When termination is forced, re-execute the command. If an error repeats, restart the system and then re-execute the command.
Do not execute the following commands at the same time, because the configuration information of virtual adapter may not be changed.
Make sure the configuration information of virtual adapter is changed if the following commands have been executed at the same time. If not, execute the following commands again one by one.
hanetnic command
strhanet command
stphanet command
Example
To add the physical adapter Ethernet 2 to the virtual adapter sha0:
> hanetnic add -n sha0 -t "Ethernet 2" |
To delete a physical adapter bundled in a virtual adapter, use the delete subcommand.
This command can be used regardless of whether the virtual adapter is activated or deactivated.
Format
hanetnic delete -n vadapter -t adapter
Description
Deletes a physical adapter bundled in a virtual adapter dynamically.
Options
-n vadapter
Specifies the name of the virtual adapter bundling the physical adapter to be deleted.
-t adapter
Specifies the name of the physical adapter to be deleted. If the physical adapter name contains a space, the network adapter name must be enclosed in double quotation marks ( " ). It is also possible to abbreviate the text string "Ethernet" or "Local Area Connection" in specifying the name of a physical adapter.
Specify the name of the physical adapter described in the config information of the virtual adapter specified with the -n option.
Notes
Make sure that the network properties screen is closed before running this command. Otherwise, an error may occur in executing the command.
When you specify a virtual adapter that shares the physical adapter specified by the -t option with any other virtual adapters by the -n option, the physical adapter will be deleted from all virtual adapters bundling the physical adapter.
When the physical adapter to be deleted is operational, change the status of the adapter to standby with the change subcommand of the hanetnic command, and then delete it.
Do not force termination while the command is running. When termination is forced, re-execute the command. If an error repeats, restart the system and then re-execute the command.
Do not execute the following commands at the same time, because the configuration information of virtual adapter may not be changed.
Make sure the configuration information of virtual adapter is changed if the following commands have been executed at the same time. If not, execute the following commands again one by one.
hanetnic command
strhanet command
stphanet command
Example
To delete the physical adapter Ethernet 2 bundled in the virtual adapter sha0:
> hanetnic delete -n sha0 -t "Ethernet 2" |
To switch the status of a physical adapter from standby to operational, use the change subcommand.
Format
hanetnic change -n vadapter
Description
Changes the status of physical adapters bundled in a virtual adapter from standby to operational.
Options
-n vadapter
Specifies the name of the virtual adapter containing the physical adapters that are to be switched to operational.
Notes
If there are no physical adapters in standby, no change of operational status will be effected.
Before running the command, run the dsphanet command to make sure that there is a standby physical adapter. For more details, refer to "6.3.1 dsphanet."
This command is not available in safe mode.
Example
To change the status of physical adapters bundled in virtual adapter sha0 from standby to operational:
> hanetnic change -n sha0 |