Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have desktop and two laptops with Ubuntu. Normally, internet is shared via router with one port for PPP to provider and four for computers. But router broke and now it works only as switch. So, if I plug all my computers and providers wire into it, I have local network, but only one computer at time can access Internet via ppp. So, I login to Internet with my desktop and use ssh to access it from my laptops. That allows me to run applications and surf Internet on my laptops, but no full access to Internet.

So, the question is - is there a way to share Internet via ssh, so the laptops will have it in same way as connecting to it directly or via router (of course, I will get new router, but the question has theoretical interest and applications like tunneling traffic via safe machine).

share|improve this question
I'm quite interested in the answer to this: it sounds like it might be a networking nightmare, but it's an intriguing idea. – Lukasa May 15 '11 at 21:57

Does it have to be over SSH? It's much simpler to share the connection using standard routing. Since this is all inside the same LAN, you don't lose any security.

If you do need an encrypted connection, consider OpenVPN instead. Run the VPN server on your desktop and connect from laptops; use the same instructions above for connection sharing.

The SSH protocol is not suited for low-level tunneling. However, OpenSSH does have very basic VPN support with the -w option.

share|improve this answer
Well, I'll have a look at -w flag. Maybe it will help. – user81420 May 15 '11 at 22:32
And about sharing connections - all solutions which i've seen involved second network card or router. As I told, i will buy a new router, but i'm curious - if I can surf internet on all computers with one net card per computer and a switch - why can't I get full intenet access with one card? I don't see why it's not technically possible. – user81420 May 15 '11 at 22:36
@user: It is possible. But a more detailed description of your setup would be useful. How exactly is your desktop connecting? Is it using PPPoE? What software? (The two NICs do not have to be both physical -- virtual ones, such as tun0 or ppp0, work the same way as eth0.) – grawity May 16 '11 at 4:07
+1 for openVPN, this is the kind of thing that VPNs are for, not SSH. – MaQleod May 16 '11 at 4:55
@grawity: I've connected all computers and providers wire to four router ports. Then I ran dhclient on all computers and set ips via ifconfig, so I now have desktop eth0 as and laptops eth0's as and After that I run pppoeconf on computer I select (for example, desktop), enter my providers login and password. Now Internet is working only on desktop. Then I ssh -X from laptops to desktop, run browsers and browse web. So, desktop has eth0 and ppp0 and laptops ony eth0's. – user81420 May 16 '11 at 10:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.