@echo off
setlocal
:: ========================
:: EDIT THESE VALUES BELOW
:: ========================
set INTERFACE="Ethernet" & rem Put in quotes if contains spaces (e.g., "Wi-Fi")
set IP=10.65.10.26
set SUBNET=255.255.254.0
set GATEWAY=10.65.10.1
set DNS1=8.8.8.8
set DNS2=8.8.4.4
:: ========================
:: STOP EDITING HERE
:: ========================
:: Apply IP configuration
netsh interface ipv4 set address name=%INTERFACE% static %IP% %SUBNET% %GATEWAY%
:: Set DNS servers
netsh interface ipv4 set dns name=%INTERFACE% static %DNS1% validate=no
netsh interface ipv4 add dns name=%INTERFACE% %DNS2% index=2 validate=no
echo .
echo Network configuration applied successfully!
echo Interface: %INTERFACE%
echo IP Address: %IP%
echo Subnet Mask: %SUBNET%
echo Gateway: %GATEWAY%
echo DNS Servers: %DNS1% (Primary), %DNS2% (Secondary)
echo .
pause
0 comments:
Post a Comment