Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # desc share your internet access to another v.2
- # author root@abimayu.com
- # site www.abimayu.com
- #
- # another computer use this range 172.16.1.2 - 172.16.1.254
- # to run, running this command
- # sudo bash share-internet.sh
- # set interface
- sudo ifconfig eth1 down
- sudo iwconfig eth1 channel 4
- sudo iwconfig eth1 mode ad-hoc
- sleep 1;
- sudo ifconfig wlan0 172.16.1.1/24 up
- # set as gateway to internet
- sleep 0.5;
- sudo echo 1 > /proc/sys/net/ipv4/ip_forward
- sudo iptables -F
- sudo iptables -t nat -F
- sudo iptables -t nat -A POSTROUTING -s 172.16.1.0/24 -j MASQUERADE
- sudo iptables -A FORWARD -s 172.16.1.0/24 -j ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement