Do I need a Proxy Server to let all requests go through one machine?

1

I recently moved out into a new bedsit which provides internet to each apartment through a 3rd party. The 3rd party has a webpage you must log into in order to connect to the internet (like in a hotel). The problem is that they only let you be logged in from one location at once, and I need to use my laptop and desktop at the same time.

What I need to do is connect my desktop to the internet through my laptop.

Wireless → Laptop → UTP → Desktop

So I tried bridging the connection. This worked, I had internet on both devices. However they were still seen as one device and thus only one could be logged in.

What I need to happen is for all requests to go through the laptop and then be passed on to the desktop, allowing me to use both at the same time. According to my (limited) knowledge, is this the function of a proxy server?

Are there any simple and lightweight (the laptop only has an Intel Atom) proxy servers you can recommend I use? The laptop dual-boots Windows 7 and Gentoo, so one that runs on either OS will do.

PSYU

Posted 2011-08-12T12:48:09.853

Reputation:

This question is probably a better fit for Super User. Just hold tight and we'll get you migrated there... – jscott – 2011-08-12T12:50:08.790

A proxy's more trouble than it's worth: NAT's easier. Internet Connection Sharing on Windows is the easiest way to do so, but you can do the same in Gentoo using a series of iptables rules. – Michael Lowman – 2011-08-12T12:57:03.347

Answers

2

I think SSH Tunelling would solve this problem. Install ssh on your laptop and use this command to mount a tunnel from your Windows box to the laptop (you can use putty on Windows):

ssh user@laptop -D 8080

Make sure you protect your ssh server though, using keys only to authenticate and protecting it with a pasword is the best way to be safe. To copy you default local public key (on *NIX) on the server use this command:

ssh-copy-id user@laptop

Shadok

Posted 2011-08-12T12:48:09.853

Reputation: 3 760

just for clarity, that opens a SOCKS5 proxy. So you should configure your browser to connect to said proxy at localhost port 8080. – Michael Lowman – 2011-08-12T13:20:12.693

@Shadok I have a similar requirement. Do I have to do something on the server side too to make this work, because currently I am getting connection refused on my terminal when I try to access a page through my firefox – AnkurVj – 2011-08-20T14:58:06.480

1@AnkurVj the only requirement is that ssh portforwading must be enabled IMO, are you sure you are actually connected to the ssh server ? You should see a listening tcp socket on your client, like that: tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 1000 77434718 23750/ssh – Shadok – 2011-08-22T08:45:07.970

The machine that I am ssh-ing to is on the local network. Do I still need to do ssh port forwarding ? Where do i look for the listening tcp socket ? – AnkurVj – 2011-08-22T08:48:31.077

yes, you need portforwarding as it allows you to tunnel through the ssh server. To check your open ports use "netstat -an" under windows or "netstat -altupen |grep 8080" (if you used port 8080). – Shadok – 2011-08-22T10:56:00.643

0

For gentoo using iptables something like this should work:

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

/sbin/iptables -t nat -A POSTROUTING -o <wifi interface> -j MASQUERADE

done. :-)

Sirex

Posted 2011-08-12T12:48:09.853

Reputation: 10 321