Recently, I need to use php to write a simulation program. this program needs to constantly change the public IP address and modify the mac address of the local machine. After a period of research, I found that I knew what to say. I would like to share this method with you here.
Recently, I need to use php to write a simulation program. this program needs to constantly change the public IP address and modify the mac address of the local machine.
After a period of research, I found that I knew what to say. I would like to share this method with you here. I hope this method can be implemented somewhere at a certain time.
It helps readers.
I. Public network address
The Internet address is relative to the intranet address. Intranet addresses are in the following formats: 192.168.x.x, 10. x, 172.16.x.x. Take home wireless routing as an example. the IP addresses displayed through ipconfig are all intranet addresses. You can view the public network by accessing ip138.com.
How to modify a public IP address
I am using the simplest method to modify my IP address.
1. I first applied for an adsl dial-up bandwidth. RMB 120 per month
2. modify the IP address by dialing again
The related code is as follows:
This program implements automatic dialing by calling external rasdial.
II. Mac address
Mac address Nic address. A mac address is used to identify a unique computer. In other words, a computer only has a unique mac address.
This is also a method that many programs use to mark independent users. However, mac addresses are divided into physical mac addresses and driver layer mac addresses.
The mac address of the driver layer can be modified. The mac address is the same as the mac address of the physical Nic before it is modified.
The program reads mac and does not directly obtain the physical mac, but the mac of the driver layer. So we can achieve our goal by modifying the driver layer mac.
How to modify a mac address
You can modify the mac address or download the current mac address modifier by modifying the registry.
1. download the tmac program. For http://www.technitium.com/tmac/index.html
2. use tmac-n local-s-r-re-to generate a mac address. local is the local connection name.
The related code is as follows:
3. PHP Long Run mode
The php program runs automatically after a period of time. to keep php running, you can modify the max_execute_time parameter in php. ini.
Modify max_execution_time = 0