Absrtact: Recently I need to write a simulation program with PHP, the program needs to constantly change the public network IP address, as well as modify the MAC address of this computer. After a period of research, I found the solution. Here to share this method with you, I hope this method
Recently I need to write a simulation program with PHP, the program needs to constantly change the public network IP address, as well as modify the MAC address of this computer.
After a period of research, I found the solution. Here I would like to share this method with you, and I hope this method can be used somewhere.
Helpful to readers.
One. Public network Address
The so-called public network address, is relative to the intranet address. Intranet address mainly has the following 3 kinds of 192.168.x.x,10.x.x.x,172.16.x.x format. To family without line by example, through ipconfig see IP address is intranet address. Public network view can be viewed by accessing ip138.com
How to modify a public network IP address
I'm using the easiest way to modify my IP address.
1. I applied for an ADSL dial-up broadband first. $120 per month
2. Modify IP Address by redial
The relevant code is as follows:
This program is to achieve automatic dialing by calling external rasdial.
Two. MAC address
MAC address network card address. A MAC address is used to flag only a single computer. In other words, a single computer has only one MAC address.
This is also the way many programs use to flag independent users. But the MAC address is divided into the physical Mac and the driver layer's MAC address.
The MAC address of the driver layer can be modified. This Mac has the same MAC address as the physical NIC before it is modified.
Program Read Mac can not get the physical Mac directly, but get the driver layer of the Mac. So we can achieve our goal by changing the driver layer Mac.
How to modify a MAC address
You can modify the MAC address by changing the registry, or you can download the existing MAC address modifier
1. Download the McGrady program. Download Address http://www.technitium.com/tmac/index.html
2. Tmac-n local-s-r-re-to generate a MAC address. Local Connection Name
The relevant code is as follows:
Three. PHP long run mode
PHP program to run after a period of time automatically ended, in order to allow PHP to run can modify php.ini parameter max_execute_time.
Modified Max_execution_time = 0