November 22, 2024, 05:14:12 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: IPtable and Internet sharing REDHAT LINUX 9.0  (Read 13774 times)

Offline sathish

  • Linux Learner
  • ***
  • Posts: 73
IPtable and Internet sharing REDHAT LINUX 9.0
« 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 :)

Offline narsingh

  • Linux Noob !
  • *
  • Posts: 13
IPtable and Internet sharing REDHAT LINUX 9.0
« Reply #1 on: November 28, 2003, 04:20:55 AM »
Any problem in using Squid proxy server for the purpose?

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
IPtable and Internet sharing REDHAT LINUX 9.0
« Reply #2 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..

Offline MiG-15

  • Linux Noob !
  • *
  • Posts: 8
IPtable and Internet sharing REDHAT LINUX 9.0
« Reply #3 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(!)

Offline wajeh786

  • New Member
  • Posts: 1
internet sharing in linux
« Reply #4 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

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
IPtable and Internet sharing REDHAT LINUX 9.0
« Reply #5 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

Offline manoj

  • New Member
  • Posts: 1
IPtable and Internet sharing REDHAT LINUX 9.0
« Reply #6 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.