Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the batch processing of IP address automatic setting

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to achieve IP address automatic setting of batch processing, the article introduces in great detail, has a certain reference value, interested friends must read it!

@ echo offMODE con: COLS=80 lines=30 color 0btitle automatic IP By Lecho = echo automatic IP By Lecho = rem eth / / eth is the name of the network card echo 1. Detect the active network card. Rem gets the network connection name @ (for / f "tokens=3*"% an in ('netsh interface show interface ^ | more + 2') do @ echo %% b) > "network.txt" set j=0for / f "tokens=*"% I in (network.txt) do (set / a jacks 1 set contextual%% I call set ethic%% contextual%%) echo current active Nic name is:% eth%set ipduan=149.32.49rem gw / / gateway set gw=%ipduan%.1rem netmasks / / subnet mask set netmasks=255.255.255.0rem maximum and minimum IP address set MAXID=205set MINID=5echo 2. Check the ID configuration. Set j=0for / f "tokens=*"%% I in (nowid.txt) do (set / a jacks checking 1 set contextual jacks%% I call set oldidstones% contexts%) if% oldid% LSS% MINID% (echo checks nowid.txt files, ID:%oldid% cannot be less than% MINID%goto changeerror) echo 3. Generate the next ip address... set j=0for / f "tokens=*"%% I in (nowid.txt) do (set / a jacks 1 set contexts%% call set idling%% contexts%%) echo-echo the last ip address is:% id%echo the last ip address is:% ipduan%.%id%echo-set / a newid=%id%+1if% newid% GTR% MAXID % (echo IP segment allocation has reached the upper limit:% ipduan%.% MAXID%! Please modify the nowid.txt file or check the IP address goto changeerror) else (echo% newid% > nowid.txtecho next number:% newid%) rem ip / / ip for the next ip address you want to change:% ip%echo next ip address Gateway:% gw%echo next ip address mask:% netmasks%echo-echo 4. Native IP changes:% ip% rem netsh interface ipv4 set address% eth% static% ip%% netmasks%% gw% rem > nulecho.echo 5. Verify the current native IP:ipconfig-all > ipconfig.txttype ipconfig.txt | find "% ip%" & & goto success:changeerrorecho modification failed, please manually assign IP address! goto: end:successecho modified successfully goto: end:endpause echo. The above is all the contents of the article "how to realize the batch processing of IP address automatic setting". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report