You can use the hanetconfig command to set, delete, and display config definitions of virtual adapters. Subcommands of the hanetconfig command are listed in the table below.
Subcommand | Description | Required Rights |
---|---|---|
create | Creates configuration information. | Administrators |
delete | Deletes configuration information. | Administrators |
Displays configuration information. | Administrators or Users | |
version | Displays version information. | Administrators or Users |
In order to use GLS, you must create config information for the virtual adapters. To create this information, use the create subcommand.
Format
hanetconfig create -n vadapter -t adapter1[,adapter2] [-v {vlanid|hv}] [-a macaddr]
Description
Creates config information for virtual adapters.
Options
-n vadapter
Specifies the names of the virtual adapters for which to create new config information. You can specify up to 16 virtual adapters.
The format of the virtual adapter names is fixed. Each name must begin with the text string "sha" followed by a number from 0 - 15. Apart from the name "sha0", the first digit of the number cannot be zero. If the name does not follow this format, the command exits with an error message.
Examples of Valid Names:
sha0, sha10, sha15
Examples of Invalid Names:
sha01, sha1b, sha99
-t adapter1[,adapter2]
Specifies the names of the physical adapters bundled into the virtual adapter. The names are separated by commas ( , ). If a 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 "Local Area Connection" in specifying the name of a physical adapter.
Normal specification (not abbreviated):
> hanetconfig create -n sha0 -t "Local Area Connection 1","Local Area Connection 2" |
Abbreviated specification:
> hanetconfig create -n sha0 -t 1,2 |
The table below shows the adapter names as displayed by Windows and the corresponding abbreviations in GLS commands.
Adapter Name in Windows | Abbreviation in GLS Commands |
---|---|
"Local Area Connection" | 0 |
"Local Area Connection 0" | Cannot be abbreviated |
"Local Area Connection 1" | 1 |
"Local Area Connection 2" | 2 |
You can see the list of physical adapters in the [Network Connections] window (double-click [Network Connections] in the Control Panel) or by executing Windows' ipconfig command.
-v {vlanid | hv}
Sets the virtual adapter VLAN IDs when using VLAN tagging to share physical adapters with multiple virtual adapters. The valid range of vlanids is 1 - 4095. If you specify an vlanid outside this range, this command outputs an error message and exits.
Note that you cannot set more than one virtual adapter with the same vlanid.
When you register a virtual adapter to Virtual Network Manager to use it in a Hyper-V environment on Windows Server 2008 or later operating systems, specify "hv". When you specify "hv", the virtual adapter cannot be shared with physical adapter that is bundled by other virtual adapter.
-a macaddr
Specifies the MAC address to attach to virtual adapters.
GLS usually generates the virtual adapter MAC addresses automatically based on the physical adapter MAC addresses. For this reason, it is not usually necessary to specify this option. However, if you do need to specify this option, note that the MAC addresses must be unique within each segment.
The format of MAC addresses is as follows:
XX-XX-XX-XX-XX-XX |
XX represents a hexadecimal value. Separate the values using hyphens ( - ).
Notes
Deactivate existing virtual adapters before adding new virtual adapters. Use the stphanet command to deactivate virtual adapters. For more details, refer to "6.2.7 stphanet."
Do not bundle GLS virtual adapters with virtual adapters of other products.
This command is not available in safe mode.
Examples
1
To set the virtual adapter sha0 comprised of the physical adapters Local Area Connection 1 and Local Area Connection 2 and not using a VLAN ID:
> hanetconfig create -n sha0 -t "Local Area Connection 1","Local Area Connection 2" |
2
To set the virtual adapter sha0 comprised of the physical adapters Local Area Connection 1 and Local Area Connection 2 and using 2 as the VLAN ID:
> hanetconfig create -n sha0 -v 2 -t "Local Area Connection 1","Local Area Connection 2" |
3
To set the virtual adapter sha0 using 2 as the VLAN ID and the virtual adapter sha1 using 3 as the VLAN ID, both comprised of the physical adapters Local Area Connection 1 and Local Area Connection 2:
> hanetconfig create -n sha0 -v 2 -t "Local Area Connection 1","Local Area Connection 2" > hanetconfig create -n sha1 -v 3 -t "Local Area Connection 1","Local Area Connection 2" |
4
To set the virtual adapter sha0 using 2 as the VLAN ID and the virtual adapter sha1 not using a VLAN ID, both comprised of the physical adapters Local Area Connection 1 and Local Area Connection 2:
> hanetconfig create -n sha0 -v 2 -t "Local Area Connection 1","Local Area Connection 2" > hanetconfig create -n sha1 -t "Local Area Connection 1","Local Area Connection 2" |
5
To set the virtual adapter sha0 comprised of the physical adapters Local Area Connection 1 and Local Area Connection 2 and assign the MAC address 02-01-01-01-01-01 to this virtual adapter:
> hanetconfig create -n sha0 -t "Local Area Connection 1","Local Area Connection 2" -a 02-01-01-01-01-01 |
6
To set the virtual adapter sha0 comprised of the physical adapters Local Area Connection 1 and Local Area Connection 2 and not using a VLAN ID, abbreviating the text string "Local Area Connection":
> hanetconfig create -n sha0 -t 1,2 |
7
To set the virtual adapter for Hyper-V comprised of the physical adapters Local Area Connection 1 and Local Area Connection 2:
> hanetconfig create -n sha0 -v hv -t "Local Area Connection 1","Local Area Connection 2" |
You can use the delete subcommand to delete config information for virtual adapters.
Format
hanetconfig delete -n {vadapter|all}
Description
Deletes config information for virtual adapters.
Options
-n vadapter
Specifies the virtual adapter name for which to delete the config information.
-n all
Specifies that all virtual adapters are to be deleted.
Note
Deactivate virtual adapters before executing the delete subcommand. Use the stphanet command to deactivate virtual adapters. For more details, refer to "6.2.7 stphanet."
Examples
1
To delete the virtual adapter sha0:
> hanetconfig delete -n sha0 |
2
To delete all virtual adapters:
> hanetconfig delete -n all |
You can use the print subcommand to display the config information for the created virtual adapter.
Format
hanetconfig print [-d]
Description
Displays config information of virtual adapters, e.g. names of bundled physical adapters and VLAN IDs. VLAN IDs and MAC addresses can be displayed by specifying the command option.
Option
-d
Displays virtual adapter information such as MAC addresses.
Output Format
Format without -d Option
> hanetconfig print Name VID Adapters +-------+----+----------------------------------------------------------------+ sha0 ---- Local Area Connection 1,Local Area Connection 2 sha1 2 Local Area Connection 3,Local Area Connection 4 sha2 1021 Local Area Connection 3,Local Area Connection 4 sha3 hv Local Area Connection 5,Local Area Connection 6 |
The table below explains the output items.
Item | Details | |
---|---|---|
Name | Virtual adapter name | |
VID | VLAN tagging data | |
---- | Communicates without using VLAN tagging | |
1 - 4095 | VLAN ID | |
hv | Communicates by working together with Hyper-V Virtual Network Manager | |
Adapters | List of physical adapters bundled together in the virtual adapter |
Format with -d Option
> hanetconfig print -d Name VID MAC Address +-------+----+----------------------------------------------------------------+ sha0 ---- Auto sha1 2 Auto sha2 1021 XX-XX-XX-XX-XX-XX sha3 hv Auto |
The table below explains the output items.
Item | Details | |
---|---|---|
Name | Virtual adapter name | |
VID | VLAN tagging data | |
---- | Communicates without using VLAN tagging | |
1 - 4095 | VLAN ID | |
hv | Communicates by working together with Hyper-V Virtual Network Manager | |
MAC Address | MAC Address | |
Auto | Automatically generated MAC addresses assigned to virtual adapters | |
XX-XX-XX-XX-XX-XX | Manually set MAC addresses assigned to virtual adapters |
Examples
1
To display the config information (with sample display):
> hanetconfig print Name VID Adapters +-------+----+----------------------------------------------------------------+ sha0 ---- Local Area Connection 1,Local Area Connection 2 sha1 2 Local Area Connection 3,Local Area Connection 4 sha2 1021 Local Area Connection 5,Local Area Connection 6 |
2
To display detailed settings of virtual adapters:
> hanetconfig print -d Name VID MAC Address +-------+----+----------------------------------------------------------------+ sha0 ---- Auto sha1 2 Auto sha2 1021 02-01-01-01-01-01 |
You can use the version subcommand to display the version of the GLS program.
Format
hanetconfig version
Description
Displays the GLS version.
Example
To display the GLS version information:
> hanetconfig version HA-Net version 1.0 |