更改IP位址批處理

2021-09-06 06:17:48 字數 680 閱讀 2287

在虛擬機器中從nat方式到橋接的時候可能會用到,特別是做滲透測試的時候。

@echo off

rem eth // 設定網絡卡名稱,如"本地連線"

set eth="本地連線"

rem ip // 設定ip位址

set ip=192.168.1.111

rem gw // 設定閘道器

set gw=192.168.1.1

rem netmasks //設定子網掩碼

set netmasks=255.255.255.0

echo 正在將本機ip更改為:%ip%

echo 正在將本機子網掩碼更改為:%netmasks%

echo 正在將本機閘道器更改為:%gw%

netsh inte***ce ip set address "%eth%" static %ip% %netmasks% %gw% default

echo ---------------------------------

echo 老闆,ip更改完畢,今晚請吃飯哈...

echo ---------------------------------

pause

close

儲存為bat即可。

批處理設定IP位址

echo 現在開始設定本機網路位址 echo 現在開始設定本機ip netsh inte ce ip set address 本地連線 source static addr 172.31.13.199 mask 255.255.254.0 echo 現在開始設定本機gateway netsh int...

批處理設定IP位址

今天參照一篇文章,弄了個批處理設定ip位址 說是參照,因為我直接按照文章所給的 設定後,沒有成功 後來參照網上其他的方法,修改了 終於成功了!echo off echo 修改本機ip位址工具 echo 正在設定您的ip位址為靜態位址,請稍等.netsh inte ce ip set address ...

DOS批處理修改IP位址

echo off echo 正在切換到網際網路,請稍等.netsh inte ce ip set address name 本地連線 source static addr 172.16.5.6 mask 255.255.255.0 netsh inte ce ip set address name ...