Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Crea archivo interfaces
- # by Rodrigo Fuenzalida
- # mail: [email protected]
- #
- # parametro $1 = network
- # parametro $2 = ip bradcast
- # parametro $3 = gateway
- clear
- rm /etc/network/interfaces
- echo "# Asignando una interfaz virtual a eth0" >> /etc/network/interfaces
- echo "auto eth0:1" >> /etc/network/interfaces
- echo "iface eth0:1 inet static" >> /etc/network/interfaces
- echo "address 192.168.1.60" >> /etc/network/interfaces
- echo "netmask 255.255.255.0" >> /etc/network/interfaces
- echo "network "$1 >> /etc/network/interfaces
- echo "broadcast "$2 >> /etc/network/interfaces
- echo "gateway "$3 >> /etc/network/interfaces
- cat /etc/network/interfaces
- echo ""
- echo "###########################################"
- echo ""
- echo "Reiniciando -->"
- /etc/init.d/networking restart
Advertisement
Add Comment
Please, Sign In to add comment