Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Network Troublshooting => General Networking Support in Linux => Topic started by: sathish on November 27, 2003, 09:21:46 PM

Title: IPtable and Internet sharing REDHAT LINUX 9.0
Post by: sathish on November 27, 2003, 09:21:46 PM
Hello Sir,

In my office i am having WAN link, my ISP provider has provided 12 IP address. I want to use this 12 ip addres in IP table (it should work in roundrobin system in the NAT table).

1) eth0 -  is the ISP provider link
2) eth1 - is the our private LAN link.

and also
I want to share the internet to the private LAN link.

Thank you.
Sathish :)
Title: IPtable and Internet sharing REDHAT LINUX 9.0
Post by: narsingh on November 28, 2003, 04:20:55 AM
Any problem in using Squid proxy server for the purpose?
Title: IPtable and Internet sharing REDHAT LINUX 9.0
Post by: Ricky on November 28, 2003, 04:34:47 AM
Satish... If u need to share internet from linux box to other clients by Iptables.. then run following script..
Code: [Select]
#!/bin/sh

iptables=/sbin/iptables



$iptables --flush -t nat



iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Execute the above script.. and u will be able to share internet from your linux box. In your clients, give the ip of your linux box as the gateway.
Please give litle more detail that wht do u want to do.. i.e. roundrobin system..
Title: IPtable and Internet sharing REDHAT LINUX 9.0
Post by: MiG-15 on December 02, 2003, 07:35:33 AM
how many users do you have in your office setup, i use the same sort of setup for my home but i only have one ip and about a dosen computers on the lan via dhcp.  the script  Ricky posted should work nicely..  and dhcp is easy to setup...  lol with webmin(!)
Title: internet sharing in linux
Post by: wajeh786 on December 02, 2003, 08:01:58 AM
hi dears
 
  i can share the internet with the squid through my linux box but i must give the proxy server address to each client's web browere which i donot want to each time cuz i have more than 50 clients in my lan  and also i can not use the  mail,ftp etc clients on my windows machines.
 

  one more thing is that my network configurations are:

i have one network card with two ips one is lan and other is real
 
eth0 is for local ip
and eth0:1 is for real ip

can any body help me in configuing the transparent proxy
regards
 wajeh
Title: IPtable and Internet sharing REDHAT LINUX 9.0
Post by: Ricky on December 02, 2003, 09:00:19 AM
Well! you have to create a script and execute that.. then u will not need to configure each client..
Script is at
http://www.linuxsolved.com/forums/viewtopic.php?p=298#298
Title: IPtable and Internet sharing REDHAT LINUX 9.0
Post by: manoj on March 08, 2004, 10:39:21 AM
Hi Sathish,
An elegant way (which I use) would be to put all your client in DHCP mode and configure your dual-homed host as an DHCP server. Then you do not have to assign gateway etc to each individual client on the network.
Along with this, you need to configure your iptables as pointed out by Ricky.
This should solve your problem of internet sharing.