B4J Question Change IP of machine in B4J windows 10

Peter Lewis

Active Member
Licensed User
Longtime User
Hi

Is there a way to change the IP address to a static address or to DHCP on a specific ethernet interface within a B4J app.

I have seen one for Linux.

Thank you
 
Solution
Perhaps the old jShell library still works.
Just use Command prompt and run netsh
netsh interface ip set address "Ethernet" static addr=192.168.2.1 mask=255.255.255.0 gateway=192.168.2.251
And if you want to change DNS as well, use:
netsh interface ipv4 add dnsserver "Ethernet" 8.8.8.8 index=1

MicroDrie

Well-Known Member
Licensed User
Longtime User
Perhaps the old jShell library still works.
Just use Command prompt and run netsh
netsh interface ip set address "Ethernet" static addr=192.168.2.1 mask=255.255.255.0 gateway=192.168.2.251
And if you want to change DNS as well, use:
netsh interface ipv4 add dnsserver "Ethernet" 8.8.8.8 index=1
 
Upvote 1
Solution

Peter Lewis

Active Member
Licensed User
Longtime User
This did work

IP:
netsh interface ipv4 set address name="Praxos" static 192.168.20.8 255.255.255.0 192.168.20.254
and back to DHCP was
IP DHCP:
netsh interface ipv4 set address name="Praxos" dhcp
 
Upvote 0
Top