rodrwan

interfaces

Apr 18th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.79 KB | None | 0 0
  1. #!/bin/bash
  2. # Crea archivo interfaces
  3. # by Rodrigo Fuenzalida
  4. #
  5. # parametro $1 = network
  6. # parametro $2 = ip bradcast
  7. # parametro $3 = gateway
  8. clear
  9. rm /etc/network/interfaces
  10. echo "# Asignando una interfaz virtual a eth0" >> /etc/network/interfaces
  11. echo "auto eth0:1" >> /etc/network/interfaces
  12. echo "iface eth0:1 inet static" >> /etc/network/interfaces
  13. echo "address 192.168.1.60" >> /etc/network/interfaces
  14. echo "netmask 255.255.255.0" >> /etc/network/interfaces
  15. echo "network "$1 >> /etc/network/interfaces
  16. echo "broadcast "$2 >> /etc/network/interfaces
  17. echo "gateway "$3 >> /etc/network/interfaces
  18. cat /etc/network/interfaces
  19. echo ""
  20. echo "###########################################"
  21. echo ""
  22. echo "Reiniciando -->"
  23. /etc/init.d/networking restart
Advertisement
Add Comment
Please, Sign In to add comment