日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

如何快速切换静态和动态ip

發(fā)布時(shí)間:2025/3/15 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何快速切换静态和动态ip 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

@echo off
rem eth //eth 為網(wǎng)卡名稱,可在網(wǎng)絡(luò)連接中查詢,如"本地鏈接"
set eth="本地連接"
rem ip //ip 為你想更改的IP
set ip=202.198.24.125?
rem gateway //gateway 為網(wǎng)關(guān)地址
set gateway=202.198.24.254
rem netmasks //netmasks 為子網(wǎng)掩碼
set netmasks=255.255.255.0
rem dns //dns 為首選DNS
set dns=202.98.18.3
rem dns2 //dns2 為備用DNS
set dns2=
echo 正在將本機(jī)IP更改到: %ip% 請(qǐng)等候...
rem
if %gateway%==none netsh interface ip set address %eth% static %ip% %netmasks% %gateway% > nul
if not %gateway%==none netsh interface ip set address %eth% static %ip% %netmasks% %gateway% 1 > nul
if %dns%==none netsh interface ip set dns %eth% static %dns%> nul
if not %dns%==none netsh interface ip set dns %eth% static %dns%> nul
if %dns2%==none netsh interface ip add dns %eth% %dns2%> nul
if not %dns2%==none netsh interface ip add dns %eth% %dns2% 2> nul
echo.........................
echo 檢查當(dāng)前本機(jī)IP:
ipconfig
echo.........................
echo 成功將本機(jī)IP更改為%ip%!
pause
close

將如上代碼保存為gotostatic.bat 執(zhí)行它即可轉(zhuǎn)換成靜態(tài)ip,紅色的地方指示的IP地址(192.168.1.12)、網(wǎng)關(guān)、DNS改為你所用的IP和網(wǎng)關(guān)

?

echo off
netsh interface ip set address? name ="本地連接" dhcp?
netsh interface ip set dns? name ="本地連接" dhcp???
pause

?

將如上代碼保存為gotodynamic.bat 執(zhí)行它即可轉(zhuǎn)換成動(dòng) 態(tài)ip

總結(jié)

以上是生活随笔為你收集整理的如何快速切换静态和动态ip的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。