Hello Im running linux on my laptop, and netbsd on my desktop. My laptop connects to the internet wirelessly. I would like my desktop to be able to share that connection through its ethernet adapter that is connected to a switch, and the switch is connected to my laptop's ethernet adapter. Is this impossible ? Ive been having an incredibly difficult time figuring out what to do. I am of course a networking idiot, no matter how many classes I take and pass I still can't wrap my head around it at all.
This link will show you how to setup a simple Linux router using IP forwarding.
The problem you'll probably face is that your Internet router NATs your 192.168.0.0/255.255.255.0 network (256 IP addresses from 192.168.0.0 to 192.168.0.255) for your laptop to get to the Net.
You'll have to put your wireless card and ethernet NICs on 2 separate networks. The problem is that router won't NAT anything on its home NIC that it feels isn't on this network.
The trick is to create two 128 IP address networks that just fit inside the 192.168.0.0/255.255.255.0 network.
Use a mask of 255.255.255.128 on your wireless NIC that is between 192.168.0.1 (the usual address of the router) and 192.168.0.127 (the broadcast address).
Use a mask of 255.255.255.128 for the ethernet NICs, the IP addresses need to be between 192.168.0.128 and 192.168.0.255. Say for example you use the address 192.168.0.129 for the laptop, make sure that this iP address becomes the PC's default gateway.
Set up ip forwarding and you should be OK. DON'T change the mask on the router. It must still think it's on a 255.255.255.0 network when in fact there are two half sized 255.255.255.128 networks behind there. As subnet masks are not transmitted with the IP traffic, it won't figure out trick.
This link will show you more about subnet masking.
Hope this helps.