Thursday, February 5, 2015

Script to Change IP addresses in Kali Linux constantly

Script to Change IP addresses in Kali Linux constantly

Everybody who works in IT know that you need to test the equipment you are going to deploy at the customer premises, so you use your virtual machine to change the IP address from static to dynamic to emulate customer environment.

After several days changing IP address to match the networks and firewalls, etc, etc I created my own scripts to do it, these scripts are simple and modify it what ever you want:

Location of my scripts:


The following files are copies of the Kali network configuration located at /etc/network/interfaces and put them in my /root/myscripts

interfaces-static     -- This is where I put my customer network config

interfaces-dhcp   -- This is the dhcp when I wan my virtual machine to connect to internet

So I modify the static and put my customer site configuration and send the file to /etc/network/interfaces now this require restart services, etc, etc, so I create two scripts one for static and one for dhcp and gave them chmod 777 to each one

Scripts to send the files to /etc/network/interfaces

./networking-static   - Please notice the script chance the interfaces-static to interfaces

./networking-dhcp     - Please notice the script chance the interfaces-dhcp to interfaces

So when I finish working just run ./networking-dhcp and now I can use my virtual machine what ever I wanted.

Do you want to practice your pentest skills, please sing up to

No comments:

Post a Comment