how to forward wlan0 to eth0?

Solution 1:

You can enable routing. Run this as root

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

Give manual ip addresses to both ethernet ports, the wireless-connected laptop's IP address becomes the "gateway IP" for the other one. make sure they have the same subnet masks. and the kernel would do the remaining magic.

Solution 2:

Sounds like you want to bridge the connections. Depending on your distribution there is a "right" way to configure this such that it will come up on every boot.

Quick and dirty at the command-line, though:

brctl addbr br0
brctl addif br0 eth0
brctl addif br0 wlan0

More info: http://www.linuxfoundation.org/en/Net:Bridge

Not all wireless cards will work with this. Your wireless NIC needs to allow its sending MAC address to be "forged". Your mileage may vary.

If you want to keep communicating from the computer with the wireless NIC in it you're probably going to have to assign an IP address to the bridge, either statically or with DHCP. I don't recall exactly how Linux bridging works and I don't have a box handy.

Edit: I can't tell you if that card will work or not. Give it a try and see. If it doesn't, to kill the bridge do a:

brctl delbr br0