Ant mining machine batch modify fixed IP address tutorial
Publish: 2021-04-27 15:15:48
1. For batch installation, the root password should be the same, write expect script, and the program should log in and modify one by one, but first design the binding relationship between DHCP
IP and static IP, and write variables to import and execute
IP and static IP, and write variables to import and execute
2. I'm afraid this is not easy to implement, because the IP address of each machine can't be the same, it may be sequential
only one computer can be changed to one. This is also beneficial. IP addresses may be arranged in order according to the physical location of the machine to facilitate management
if each computer needs to open the network settings, it is relatively slow to modify them. You can use the small software IP address modifier to execute it on each computer
only one computer can be changed to one. This is also beneficial. IP addresses may be arranged in order according to the physical location of the machine to facilitate management
if each computer needs to open the network settings, it is relatively slow to modify them. You can use the small software IP address modifier to execute it on each computer
3. Well, excel
or
WPS can be used
there are five steps
1. Sort out the IP addresses, and each IP address takes up one line. Form a text document<
2. Import excel
and select
.
the separator to form an excel document with four columns and each column is a number
3. Select a column and right-click set cell format - & gt“ Number ", select custom. Fill in
000
in the type box; OK, all the numbers are in the form of 001
4. Save and export to a text document. By default, tab is the separator
5. Replace tab. First a tab key, and then. Find and replace tab with & quot& quot;
ha ha. In fact, it's easier to make a small program, but I can't upload files here. Good luck!
or
WPS can be used
there are five steps
1. Sort out the IP addresses, and each IP address takes up one line. Form a text document<
2. Import excel
and select
.
the separator to form an excel document with four columns and each column is a number
3. Select a column and right-click set cell format - & gt“ Number ", select custom. Fill in
000
in the type box; OK, all the numbers are in the form of 001
4. Save and export to a text document. By default, tab is the separator
5. Replace tab. First a tab key, and then. Find and replace tab with & quot& quot;
ha ha. In fact, it's easier to make a small program, but I can't upload files here. Good luck!
4. Rabbit ~ ~ sub IP, you can change the proxy after connecting, and then click your own website,
browse more than five pages, and stay for about one minute on each page
if you need to change different IP addresses, it will help you a lot to brush the website's hits
browse more than five pages, and stay for about one minute on each page
if you need to change different IP addresses, it will help you a lot to brush the website's hits
5.
Fixed IP settings: right click Network Neighborhood - properties - local connection - properties - drop-down to find the Internet Protocol (TCP / IP Protocol), double-click to open, fill in IP 192.168.1.2 ~ 254 (one of them) subnet mask, default 255.255.255.0 gateway 192.168.1.1 (default router), and finally confirm to close
modify the IP address segment:
connect the computer and router with network cable. Log in to the router and find the network parameter -- LAN port setting. Here is an IP address: 192.168.1.1
6. ChangeIP "192.168.1.2", "255.255.255.0", "192.168.1.1", "192.168.1.1", "192.168.2.1"
'Function ChangeIP (IP As String,NM As String,GW As String,MDNS As String,SDNS As String) As String
Function ChangeIP (IP,NM,GW,MDNS,SDNS) '其中IP,NM,GW,MDNS,SDNS为字符串类型
'返回值说明:返回一个设置的中文说明.
Dim strComputer,objWMIService,colNetAdapters,strIPAddress,strSubnetMask
Dim strGateway,strGatewaymetric,strDNS,objNetAdapter,errEnable,errGateways,errDNS
strComputer = "."
Set objWMIService = GetObject( "winmgmts:\\" & strComputer & "\root\cimv2" )
Set colNetAdapters = objWMIService.ExecQuery( "Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE ")
strIPAddress = Array(IP) 'ip地址
strSubnetMask = Array(NM) '子网掩码
strGateway = Array(GW) '网关
strDNS = Array(MDNS,SDNS) '主DNS各备DNS
strGatewaymetric = Array(1)
For Each objNetAdapter In colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
errDNS = objNetAdapter.SetDNSServerSearchOrder(strDNS)
If errEnable = 0 And errGateways = 0 And errDNS = 0 Then
ChangeIP = "设置成功 "
Else
If errEnable = 0 Then
ChangeIP = "IP地址和子网掩码设置成功, "
Else
ChangeIP = "IP地址或子网掩码设置失败, "
End If
If errGateways = 0 Then
ChangeIP = ChangeIP & "默认网关设置成功, "
Else
ChangeIP = ChangeIP & "默认网关设置失败, "
End If
If errDNS = 0 Then
ChangeIP = ChangeIP & "DNS设置成功 "
Else
ChangeIP = ChangeIP & "DNS设置失败 "
End If
End If
Next
End Function
'Function ChangeIP (IP As String,NM As String,GW As String,MDNS As String,SDNS As String) As String
Function ChangeIP (IP,NM,GW,MDNS,SDNS) '其中IP,NM,GW,MDNS,SDNS为字符串类型
'返回值说明:返回一个设置的中文说明.
Dim strComputer,objWMIService,colNetAdapters,strIPAddress,strSubnetMask
Dim strGateway,strGatewaymetric,strDNS,objNetAdapter,errEnable,errGateways,errDNS
strComputer = "."
Set objWMIService = GetObject( "winmgmts:\\" & strComputer & "\root\cimv2" )
Set colNetAdapters = objWMIService.ExecQuery( "Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE ")
strIPAddress = Array(IP) 'ip地址
strSubnetMask = Array(NM) '子网掩码
strGateway = Array(GW) '网关
strDNS = Array(MDNS,SDNS) '主DNS各备DNS
strGatewaymetric = Array(1)
For Each objNetAdapter In colNetAdapters
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
errDNS = objNetAdapter.SetDNSServerSearchOrder(strDNS)
If errEnable = 0 And errGateways = 0 And errDNS = 0 Then
ChangeIP = "设置成功 "
Else
If errEnable = 0 Then
ChangeIP = "IP地址和子网掩码设置成功, "
Else
ChangeIP = "IP地址或子网掩码设置失败, "
End If
If errGateways = 0 Then
ChangeIP = ChangeIP & "默认网关设置成功, "
Else
ChangeIP = ChangeIP & "默认网关设置失败, "
End If
If errDNS = 0 Then
ChangeIP = ChangeIP & "DNS设置成功 "
Else
ChangeIP = ChangeIP & "DNS设置失败 "
End If
End If
Next
End Function
7. @echo off
set slection1=
set/p slection1=请输入IP地址:
netsh interface ip set address name="本地连接" source=static addr=%slection1% mask=255.255.255.0
set slection2=
set/p slection2=请输入网关地址:
netsh interface ip set address name="本地连接" gateway=%slection2% gwmetric=0set slection3=
set/p slection3=请输入主dns地址
netsh interface ip set dns name="本地连接" source=static addr=%slection3% register=PRIMARYset slection4=
set/p slection4=请输入备份dns地址
netsh interface ip add dns name="本地连接" addr=%slection4%
netsh interface ip set wins name="本地连接" source=static addr=none
pause 如果已有自己想设的固定IP,可以修改下,把请求输入语句去掉,直接运行
set slection1=
set/p slection1=请输入IP地址:
netsh interface ip set address name="本地连接" source=static addr=%slection1% mask=255.255.255.0
set slection2=
set/p slection2=请输入网关地址:
netsh interface ip set address name="本地连接" gateway=%slection2% gwmetric=0set slection3=
set/p slection3=请输入主dns地址
netsh interface ip set dns name="本地连接" source=static addr=%slection3% register=PRIMARYset slection4=
set/p slection4=请输入备份dns地址
netsh interface ip add dns name="本地连接" addr=%slection4%
netsh interface ip set wins name="本地连接" source=static addr=none
pause 如果已有自己想设的固定IP,可以修改下,把请求输入语句去掉,直接运行
8. Unknown_Error
9. There is that kind of software, but the premise is that you have all the MAC address of the machine, and then according to the MAC address changed
view the original post & gt& gt;
view the original post & gt& gt;
Hot content