Troubleshooting the Wifi Pineapple

I've discovered a problem that occurs to when setting up my Wifi Pineapple using the script. For whatever reason, the commands do
not run properly and no settings are changed. In lieu of the script, you can do the following to get your Wifi Pineapple working properly every time.

Where $eth1ipaddr is the IP address of the interface connected to the Wifi Pineapple. The Wifi Pineapple runs a DHCP server but assumes that your computer will get an IP address of is not always the case, so double check.

1) Make sure that forwarding is enabled.

echo '1' > /proc/sys/net/ipv4/ip_forward  

2) Create the iptables rules to share the network connection with the Wifi Pineapple.

iptables -F  
iptables -A FORWARD -i $eth1ipaddr -o -s -m state --state NEW -j ACCEPT  
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT`<br>  
iptables -A POSTROUTING -t nat -j MASQUERADE  

3) Finally, ssh into the Wifi Pineapple and set the default route to the correct IP address.

route del default  
route add default gw $eth1ipaddr