1

I am using a Windows 10 Laptop along side an Embedded Single Board Computer running Linux. I usually login to the board via ssh and tranfer files via WinSCP. The board has a Static IP Configuration and I usually connect the ethernet cable directly to the board and change the IP address of the Windows Laptop.

The problem is my development workflow requires me to create Embedded Linux images on a server within our IT Infrastructure and I have to scp the image files using the local LAN Network for quick transfers.

I have a single ethernet port on the Laptop which most of the time is occupied by being connected to the board.

Is there a simple tool to make switching between the IP Configurations on Windows easier as opposed to opening Networking Options and clicking on Properties of the Ethernet Port and entering the Static IPs all the time?

0

1 Answer 1

2

I recommend just making a batch file to swap interfaces as needed; the command you're looking for is netsh, which you can find information about here. An example would be:

@echo off

netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1

exit

Just make sure the name= is whatever your Ethernet adapter is actually called in Device Manager. If you want to get fancy and avoid having different batch files for going to and from the static connection(s), you can add some sort of input prompt and some simple GOTO lines:

@echo off

echo Change IP to board?
set /p opt="Y or N: "
if %opt% == Y GOTO STATICONE

netsh interface ip set address name="Local Area Connection" static 192.168.0.150 255.255.255.0 192.168.0.1 1

exit

:STATICONE
netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1

exit

You can add as many potential answers/variables and GOTO lines as you need.

Alternatively, if you're only swapping between two addresses (or between one static and one DHCP) you can just make your batch file swap automatically without any input by first assigning the current IP address to a variable as they outline here on Stack Overflow and checking it against whatever you need - after which it would set itself back to DHCP or to the other static IP you use.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .