2

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).

1
  • 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
    Commented May 15, 2011 at 21:57

1 Answer 1

3

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.

8
  • Well, I'll have a look at -w flag. Maybe it will help.
    – user81420
    Commented May 15, 2011 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
    Commented May 15, 2011 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.) Commented May 16, 2011 at 4:07
  • +1 for openVPN, this is the kind of thing that VPNs are for, not SSH.
    – MaQleod
    Commented May 16, 2011 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 192.168.0.100 and laptops eth0's as 192.168.0.101 and 192.168.0.102. 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
    Commented May 16, 2011 at 10:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .