Sunday, June 1, 2008

LinuxByExamples: a stupid way of internet sharing between two laptops

I always want to find an easy way to do an internet sharing between my two laptops. Well I figure out a way, which is really stupid! but well, for some extend, it works. I know there should be a proper ways to do that, but with the limited knowledge of networking, this is only what I can come out for the moment.

If you are a super linux admin user and reading this, try not to think in the perspective of admins, but try to put yourself as a layman, as I doesn’t know much about hard core network stuff, but I know ifconfig and ssh, which is some how efficient to make a “fake” internet sharing works.

Okay! lets look at the scenario I have. I have a new laptop (L1) that have wireless capabilities as well as wired installed with fedora 8. And another old laptop (L2) which only have LAN port installed with kubuntu. Obviously I want to share my internet connection from L1 to L2, well is a bit easy for me, because both of them are running linux.

I use wlassistant to connect myself to wireless LAN because fedora 8 Network Manager is so “intelligently” switch to wired when i plug in my LAN cable. After L1 is hook up to the internet wirelessly, i setup my eth0 with root privilege.

ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

Okay L1, is done, lets look at L2, same way i setup my eth0 at L2.

ifconfig eth0 192.168.1.2 netmask 255.255.255.0 up

Connect both LAN ports with LAN cable, and then do ping from L2!

ping 192.168.1.1

Okay! Now let me reveal the stupid but working way using ssh. I do this at L2.

ssh -Y mysurface@192.168.1.1 konqueror

Haha! konqueror start up and now you can surf the net from L2!

Eh! wait what is -Y option of ssh? and Why it works?
If you read up the ssh manpage, you will get this line

-Y Enables trusted X11 forwarding.

Yeah, I am loading L1’s browser and run it at L2, you can try to save a files from the internet. It will save it in L1 instead of L2, therefore this is not a real Internet sharing!

Well, I still figuring how to do an internet sharing across the LAN cable.

Do a bridging at L1 between wireless and wired interface? Then do a dynamic tunneling from L2? I tried and it doesn’t seems to be working.

Play some trick in iptables to do ip forwarding? emm may be I should try this out.

Dear Admin, do you have any suggestion?

Related Posts
Hustle! Ad Hoc Wireless connections from Linux to WindowsHustle! To setup an Ad Hoc wireless connection between windows and Linux, it spend me half an hour of trying just becaus...

stupid way to make mplayer repeatly playI am so desperately wanna make mplayer repeat a song, somehow I obtain a song in flv format. I fail to figure out how to...

LinksLets work together to links the world up! GoTechno- Latest news, Top downloads, Technology product reviews and more...