In order to set and use GLS correctly, you must make IP address settings for the virtual adapters.
For more information on using the netsh command, refer to the OS manual.
When using the adapter setting script of GLS
You can set IP addresses automatically using the adapter setting script provided with GLS.
Note that this script is executed automatically after you execute the strhanet command to activate all virtual adapters. For more details, refer to "6.2.7 strhanet."
The method is described below.
Open the following file.
<GLS Installation Folder>\usr\script\adapter\netconf.bat |
Enter and save the required information in the file. The following example shows how to use the netsh command to set the IP address 192.168.1.10 for the virtual adapter sha0.
netsh interface ip set address "sha0" static 192.168.1.10 255.255.255.0 |
The following example shows the configuration when setting the IPv6 address (fc00::2).
netsh interface ipv6 set address "sha0" fc00::2 |
You can use the script that takes the name of the virtual adapter which has been transited from the inactive state to the active state as the argument.
Open the following file.
<GLS Installation Folder>\usr\script\adapter\netconf_indivi.bat |
Enter the required information and save the file.
Except for the point that the name of the virtual adapter which has been transited from the inactive state to the active state is taken as the argument, this step is the same as for netconf.bat. Note that the name of the virtual adapter is in the shaX (where X is an integer of 0 or larger) format. The number of arguments is one or more. The script may take one or more arguments.
The following example shows how to use the netsh command to set the IP address 192.168.110.1 for the virtual adapter sha0 and the IP address 192.168.254.1 for the virtual adapter sha1.
@echo off :LOOP_START if "%1"=="" GOTO :LOOP_END if "%1"=="sha0" ( netsh interface ip set address "sha0" static 192.168.110.1 255.255.255.0 ) if "%1"=="sha1" ( netsh interface ip set address "sha1" static 192.168.254.1 255.255.255.0 ) shift goto :LOOP_START :LOOP_END |
The following example shows the configuration when setting the IP address (fc00:10::100) to the virtual adapter (sha0), and when setting the IP address (fc00:20::200) to the virtual adapter (sha1).
@echo off :LOOP_START if "%1"=="" GOTO :LOOP_END if "%1"=="sha0" ( netsh interface ipv6 set address "sha0" fc00:10::100 ) if "%1"=="sha1" ( netsh interface ipv6 set address "sha0" fc00:20::200 ) shift goto :LOOP_START :LOOP_END |
Moreover, if you have executed the strhanet command with the -n option, you can prepare scripts for each virtual adapter.
Create the following file.
<GLS Installation Folder>\usr\script\adapter\netconf_shaX.bat (X is an integer) |
Enter the required information and save the file.
Enter the same data as netconf.bat.
The following table shows when each script is called.
strhanet | strhanet -n shaX | |
---|---|---|
netconf.bat | Y | N |
netconf_indivi.bat | Y | N |
netconf_shaX.bat (X is an integer) | N | Y |
Note
Do not enter GLS commands in the netconf.bat, netconf_indivi.bat, and netconf_shaX.bat (X is an integer) files.
When activating a virtual adapter without specifying the -n option with the strhanet command, all the commands entered in the netconf.bat are executed. This time, if there are active virtual adapters, communications may be temporarily disabled by resetting IP addresses with netconf.bat.
When using the function of Windows
You can also use standard Windows functions to set IP addresses manually. There are two methods:
Setting by GUI
Setting by Commands
Note that, in order to set IP addresses manually, the virtual adapter must be activated in advance. For more details, refer to "3.4.6 Activating Virtual Adapters."
Display the [Network Connections] window by selecting from [Control Panel]-[Network and Internet]-[Network and Sharing Center]-[Change adapter settings], then right click on your network adapter and open the [Properties] window, where you can change the IP address.
From [Properties] window of your network adapter, select and display [Internet Protocol Version 4 (TCP/IPv4)] or [Internet Protocol Version 6 (TCP/IPv6)]
Specify the IP address of the virtual adapter in the displayed window.
Windows provides the netsh command for setting IP addresses by command.
The following example shows how to use the netsh command to set the IP address for the virtual adapter from the Command Prompt.
> netsh interface ip set address "sha0" static 192.168.1.10 255.255.255.0 |
The following example shows the configuration by using the netsh command when setting the IPv6 address to the virtual adapter.
> netsh interface ipv6 set address "sha0" fc00::2 |
See
For more details on netsh, refer to "netsh /?".