Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- iniciar(){
- /etc/init.d/network-manager stop
- iwconfig wlan0 mode ad-hoc
- iwconfig wlan0 essid Rede_3G
- iwconfig wlan0 key restricted XXXXXXXXXX
- ifconfig wlan0 192.168.1.XX netmask 255.255.255.0
- /sbin/modprobe ip_nat_ftp
- echo 1 > /proc/sys/net/ipv4/ip_forward
- /etc/init.d/dhcp3-server start
- /sbin/iptables -t nat -F
- /sbin/iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -o ppp0 -j MASQUERADE
- }
- parar(){
- /etc/init.d/dhcp3-server stop
- /sbin/iptables -t nat -F
- /etc/init.d/network-manager start
- }
- case "$1" in
- "start") iniciar ;;
- "stop") parar ;;
- "restart") parar; iniciar ;;
- *) echo "Use os parâmetros start ou stop"
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement