This program is a Bash script that generates a random MAC address for a wireless interface using the macchanger tool. It allows users to change their MAC address easily to enhance privacy or bypass MAC address-based restrictions.
Before using this program, ensure that you have the following prerequisites installed:
- macchanger: This tool is used to manipulate the MAC address of network interfaces. You can install it using the package manager of your Linux distribution.
- Open a terminal and navigate to the directory where the script is located.
- Run the following command to make the script executable:
chmod +x random_mac_generator.sh
- Execute the script using the following command:
./random_mac_generator.sh
The script will perform the following actions:
- Retrieve a random vendor MAC address from the macchanger tool's output.
- Generate a random MAC address by generating three random numbers in the range [0, 255].
- Combine the vendor MAC address with the random address to form the final MAC address.
- Disable the network interface (replace
<YOUR_NETWORK_INTERFACE>
with your actual wireless interface name). - Change the MAC address of the network interface to the generated random MAC address.
- Enable the network interface.
Note: Replace <YOUR_NETWORK_INTERFACE>
with the name of your wireless interface. You can find the name of your wireless interface by running the ifconfig
command in the terminal and identifying the interface name starting with wlan
or wlo
.
- The MAC address of your wireless interface will be changed to the randomly generated MAC address.
If you want the program to run automatically at system boot, you can use the crontab utility to schedule its execution. Here's how:
- Open a terminal and run the following command to edit your user's crontab:
crontab -e
- In the crontab file, add the following line to schedule the script execution at system boot:
@reboot /path/to/random_mac_generator.sh
Replace /path/to/random_mac_generator.sh
with the actual path to the script file.
- Save the crontab file and exit the editor.
Now, the script will run automatically each time the system boots up, ensuring that your wireless interface is assigned a random MAC address.
Contributions are always welcome! If you find any issues with the application or would like to suggest improvements, please open a new issue or submit a pull request.
This application is released under the MIT License. See LICENSE for more details.