This article provides instructions on specifying a static IP address in TBWinPE/RE. This is useful when connecting to a network without a DHCP server or other cases when a specific address is required. The process can be done manually after booting or it can be configured to run automatically as part of initialization.
Manually set static IP
- Boot to TBWinPE/RE.
- Open a Command Prompt.
- Determine the appropriate interface name used by running one of the following commands:
netsh interface ip show addresses
netsh interface ip show interfaces
Common interface names include Local Area Connection, Ethernet, and Ethernet0.
- Run the following command to set a static address. This example uses Ethernet0 for the interface name, an address of 192.168.0.252, subnet mask of 255.255.255.0, and a gateway of 192.168.0.1. (Command should all be on one line.)
netsh interface ip set address "Ethernet0" static 192.168.0.252 255.255.255.0 192.168.0.1
Help and examples are available by running:
netsh interface ip set address /?
- If necessary, DNS addresses can also be added. (Commands should each be on one line line.)
netsh interface ip add dnsservers "Ethernet0" 192.168.0.25 index=1
netsh interface ip add dnsservers "Ethernet0" 192.168.0.26 index=2
- The address change should take affect within a few seconds.
Set static IP during initialization
If you would like the commands to run automatically as part of the TBWinPE/RE initialization you can add them to InitScript.cmd when creating the build.
- Determine the appropriate interface name (see steps 1 through 3 in the above manual instructions).
- Run TBWinPE/RE Builder.
- Go into Settings and click the Scripts tab.
- Check the Include InitScript.cmd option and then click the Edit link. The script will open in Notepad.
- Add the commands to the end of the file (these will be the commands you would run in steps 4 and 5 in the above manual instructions). Save the file and exit Notepad when finished.
- Back in TBWinPE/RE Builder Settings, click the TBLauncher tab.
- Make sure the Run network initialization option is checked.
- Make sure the Run initialization programs in background option is unchecked (this is necessary so that network initialization can complete prior to InitScript.cmd being run).
- Click OK to close Settings.
- Continue creating the TBWinPE/RE build.