At least shown commands look correct. If this isn't a complete firewall configuration you've using on Raspberry Pi, i.e. if you have have other rules or have changed default forwarding policy (it is ACCEPT by default, changed with iptables -P), you also probably need to enable reply traffic, by adding state match:
iptables -I FORWARD 1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
This will enable connection tracker to detect reply packets as belonging to the same connection originated on the inside interface and accept them.
I cant't remember for sure, if Raspberry Pi kernel hasn't enabled conntrack match, you have to use (old, deprecated) state extension instead:
iptables -I FORWARD 1 -m state --state ESTABLISHED,RELATED -j ACCEPT
You have to enter only one of these. I prefer to adding this as first rule in the chain.
The eth0 interface on Raspberry Pi and your computer behind it should have addresses from another network. For example, you can use 192.168.10.1/24 (or /255.255.255.0 which is the same) on RasPi and 192.168.10.2 on target host.
On the target host you set eth0 address of RasPi (192.168.10.1 in previous example) as the default gateway, and DNS servers to the same as set on your RasPi. You can inspect which servers RasPi uses by issuing on it: cat /etc/resolv.conf, and look to 'nameserver' entries. Or you can just set up google public DNS (8.8.8.8, 8.8.4.4).
>
If I ping an IP, I get
host not reachable
– wb9688 – 2015-11-28T10:22:39.517Okay then, how about those interfaces then? Which is input, which is output? Wlan0 is where you connect the internet, right? "
On my Raspberry Pi B+, I just have normal internet access from wlan0.
" – Apache – 2015-11-28T10:23:17.533@Shiki Yes, wlan0 is connected to the internet – wb9688 – 2015-11-28T10:24:17.887
What is the routing table on your laptop?
ip route show
. – MariusMatutiae – 2015-11-28T10:44:49.120