Last active
June 9, 2016 10:35
-
-
Save nastra/3a72fbb7a421b010b73f09752561658b to your computer and use it in GitHub Desktop.
Adding loopback interfaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Will add $1 loopback interfaces, starting at 127.0.0.2" | |
ifaces=$(expr $1 + 2) | |
for ((i=2;i<$ifaces;i++)) | |
do | |
sudo ifconfig lo0 alias 127.0.0.$i up | |
echo "Added loopback interface 127.0.0.$i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
./add-loopback.sh 5
will add 5 loopback interfaces, starting at 127.0.0.2