Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # internet connection sharing wlan0 is the gate way
- # eth0 is the lan port this might use a straight ethernet cable to a router wan port or a switch or a single PC
- # 192.168.2.2 is the port that is being used by the lan for access I changed it to 192.168.2.254 and set fixed addresses for the wan and router
- #
- # change wlan0 to ppp0 and you can use this for mobile broadband connection sharing
- #
- ip link set dev eth1 up
- ip addr add 10.42.0.1/24 dev eth1
- sysctl net.ipv4.ip_forward=1
- iptables -t nat -A POSTROUTING -o ppp0 -s 10.42.0.0/24 -j MASQUERADE
- iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 3074 -j DNAT --to-destination 10.42.0.2
- iptables -t nat -A PREROUTING -i ppp0 -p udp -m multiport --dports 88,3074 -j DNAT --to-destination 10.42.0.2
- iptables -A FORWARD -i ppp0 -d 10.42.0.2 -p tcp --dport 3074 -j ACCEPT
- iptables -A FORWARD -i ppp0 -d 10.42.0.2 -p udp -m multiport --dports 88,3074 -j ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement