-   Linux - Networking (
-   -   Sharing internet connection (DSL router) betweeen two machines (

vharishankar 12-14-2005 06:44 AM

Sharing internet connection (DSL router) betweeen two machines
I have two machines at home. One of them is connected to my DSL provider's router which has a local IP address assigned. Both machines are connected by LAN.

Can anybody give me a basic guide on how to share this internet connection between the two machines or point me to any online resources.

Right now I'm using PPPOE in Linux, but I am unaware of how to configure the ethernet port of the router to allow the two machines to share the connection. The two machines are connected in LAN through another ethernet port.

Please don't suggest buying any equipment like network switches or anything because it's not in my budget to buy any new equipment.

hiren_bhatt 12-14-2005 07:21 AM

You can do this by making your computer a Gateway to which your DSL is connected. For how to make a Linux Gateway and how to chare connection, you can refer to the following link.

Here every thing is explained very nicely, and you will get how to make the gateway secure, how to do Masquerading and so on. See 8.2 thats what you want, but I suggest to read the whole document carefully. If the two machines are connected via an another ethernet card or port, you need not to buy any thing else....Enjoy

ncorreia 12-14-2005 10:47 AM

If linux box is the one connected to the Internet and all you want is http/https/ftp, easiest way to solve the problem is setting up squid there.

hiren_bhatt 12-14-2005 11:07 AM

If you want to setup a proxy server and also want to take advantages of caching and other things then ofcourse one can go for squid, it is basically a proxy server. But if you just want to setup a gateway one can do it by some simple means as well.

Well when there are more then ways to do same thing one should try atleast more then one way, atleast to know how things work. This is the beauty of open source, you have more then one solution to chose a better match for your problem, customizing things...bla bla bla

vharishankar 12-14-2005 09:38 PM

Well I also want POP and SMTP because my father uses Outlook Express to check his mail on the Windows box.

A proxy server really doesn't seem a good solution unless of course there's an easy to configure mail server which I can use.

Any suggestions welcome!

winsnomore 12-14-2005 09:43 PM

I assume that the first machine that magically connects to the lan (local) and the DSL router has 2 ethernet ports

If it does then it can act as a router and pass it's own and everyone's request to the router .. (Even it is connected with USB or other magic .. it can do it).

So it will need to run the DHCP SERVER so it can dole out out local address (to the folks on the lan)
It will need to run NAT to translate local lan IP to "outside" IP addresses.
It will need iptables or something like it to route traffic.

now you know what to read ..
forget about that stuff about proxyserver and squid .. squid's ar ugly fish and now one really knows if a giant squid exists or not ..
+the last couple of mails are philosophical not technical ..what can one expect from the wonderous valley of bihisht

vharishankar 12-15-2005 06:15 AM

The machine which is connected to the router indeed has two ethernet ports. One to the router and the other to the local LAN. I assume I'll have to configure IP forwarding? I'm now in unfamiliar territory and I'm not sure how the ISP's technician configured the router.

I'll have to investigate a bit about this. Thanks for the tip.

hiren_bhatt 12-15-2005 06:20 AM

Well in my very first mail I have said the same thing, you need to make the machine a gateway (router), which is connected to DSL. I also have mentationed about NAT (Masquerading) and given the link which describes every thing how to do all this.
Its all about playing with ipchains and iptables, For NAT just reffer to "Linux IP Masquerade HOWT" on tldp. You dont need to run a DHCP server for just one another machine. I dont know where people find philosophical thing.

Well I also do not suggest squid, for your problem but doesnt means squid is useless . Think of if you have a complete network behind, instead of just one machine?

All times are GMT -5. The time now is 10:29 PM.