[TAG] how to share internet from a linux server

Kapil Hari Paranjape kapil at imsc.res.in
Sat Jan 13 18:52:33 MSK 2007


Hello,

On Sat, 13 Jan 2007, j.bakshi at icmail.net wrote:
> isp 1--->[ eth0(used to dial isp1) linux eth1]---> [wan2
> port of router] -----> [hub]--> client PCs

I still think that putting the router in the middle is needless
source of confusion in your network. You *can* use it as a DHCP
server even if you link eth1 directly to the hub and use just one
port of your router also connected to the hub. 

Still, the network layout as you gave it, *can* work if configured
properly.

> now here is the setting of eth1
> -----------------------------------------------------
> ip ---> 192.168.0.2
> mask --> 255.255.255.0
> gateway --> gateway of eth0
> dns ----> dns of eth0
<snipped a lot of stuff>

> clients pc settings
> -----------------------------------
> DHCP enable. bcoz the load balancing router has DHCP server
> inbuilt
> gateway ---> 192.168.1.2
<snipped a lot of stuff>

> Could any one kindly point out my mistake ?

What is the Linux box to do when it has a packet which is destined
for 192.168.1.x?

As far as I can make out from your description that packet is
destined for eth0!

Thus you need to have a route on your Linux box
	route add -net 192.168.1.0/255.255.255.0 gateway 192.168.0.144
(where 192.168.0.144 is the address of your router port which is
connect to the box). Now, if your wan router is configured to do this
it will send the packets to the correct machine.

Regards,

Kapil.
--





More information about the TAG mailing list