LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   sharing internet connection, using my desktop as a wifi hotspot (https://www.linuxquestions.org/questions/linux-networking-3/sharing-internet-connection-using-my-desktop-as-a-wifi-hotspot-852701/)

cmd16 12-27-2010 06:12 PM

sharing internet connection, using my desktop as a wifi hotspot
 
hello. this is my first time posting in a forum, sorry if i'm being stiff. i'll try to post as much information as necessary and make clear my objective. also, as to my level of intellect with respect to linux, i hopefully see myself as leaving the newbie stage.

i have two computers:
- one is my desktop, running ubuntu. it has two NIC's one is wired (eth0), the other is wireless (wlan0).
- the other is my laptop, running archlinux. two NIC's as well (eth & wlan).

i would like to connect my desktop to my router via eth0 and connect my laptop to my desktop via wlan0, providing internet access to my laptop. i would like both computers to be able to use the internet simultaneously (not all packets would be forwarded).

any manner of doing this would be ok, but if this is a simple enough task to do it by simply configuring some files (e.g. /etc files) rather than installing some unnecessarily big application, then that would be wonderful!

also, not really as high a priority but if possible, i would like this to perhaps not be limited to my laptop. connecting any device (a psp or pda for example) to the internet this way (making it a hotspot in a sense) would be super! encrypting the connection (WEP for instance) would be ultra-mega!

miscellaneous info:
my desktop uses dhcp to connect to the router, if that helps.

thank you very much in advance and "merry christmas"/"happy holidays"!

p.s. just realized i haven't asked a question... how would i do this?

cmd16 12-27-2010 06:15 PM

p.s.s.

i don't know a lot about networking protocols or their implementation on linux, so please correct me if i'm wrong, but from what i know i think that to do this i would have to use dhcp to allocate an extra private ip-address (192.168.0.0/16) for every device attempting to connect to the desktop's wlan0. then, the desktop would have to forward the packets it receives with that new allocated ip-address from eth0 to wlan0. i don't know if dhcp can allocate more than one address to a given NIC though. would this be the best solution? how would i do this on linux?

tredegar 12-28-2010 04:59 AM

This is possible, because, just for fun, I did it once.

I have now forgotten the exact details, but here is the link I used to set it up:
http://lindesk.com/2007/04/internet-...sing-iptables/

In that link he is using forwarding over a wired link, but it'll work just as well over wireless.

You need to use google.com/linux to search on internet sharing

Another link, referencing wireless:
http://www.facebook.com/notes/ubuntu...s/356751763898

Welcome to LQ!


All times are GMT -5. The time now is 09:19 PM.