Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. iniciar(){
  4. /etc/init.d/network-manager stop
  5. iwconfig wlan0 mode ad-hoc
  6. iwconfig wlan0 essid Rede_3G
  7. iwconfig wlan0 key restricted XXXXXXXXXX
  8. ifconfig wlan0 192.168.1.XX netmask 255.255.255.0
  9. /sbin/modprobe ip_nat_ftp
  10. echo 1 > /proc/sys/net/ipv4/ip_forward
  11. /etc/init.d/dhcp3-server start
  12. /sbin/iptables -t nat -F
  13. /sbin/iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -o ppp0 -j MASQUERADE
  14. }
  15.  
  16. parar(){
  17. /etc/init.d/dhcp3-server stop
  18. /sbin/iptables -t nat -F
  19. /etc/init.d/network-manager start
  20. }
  21.  
  22. case "$1" in
  23. "start") iniciar ;;
  24. "stop") parar ;;
  25. "restart") parar; iniciar ;;
  26. *) echo "Use os parâmetros start ou stop"
  27. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement