Click to See Complete Forum and Search --> : Simple ICS in RedHat 9
blobaugh
06-06-2003, 07:04 PM
I just installed RedHat 9 and I'm planning on making it my gateway to the internet. Is there a REALLY easy way to setup Internet Connection Sharing? And what other stuff do you recommend I run? Should I run DHCP? I was thinking of trying to set it up. Anywho, what I really want is an easy way to ICS.
linnov
06-07-2003, 12:30 AM
A simple ICS
iptables --policy INPUT ACCEPT
iptables --policy OUTPUT ACCEPT
iptables --policy FORWARD ACCEPT
iptables -t nat -A POSTROUTING -s $INTLAN -o $EXTIF -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
Replace $INTLAN with your network range example 192.168.0.0/24
Replace $EXTIF with the external interface name example ppp0
Course this would be wide open, and I would suggest running something like firestarter to tighten up the rules once you know what you want to run.
You can get it here.
http://firestarter.sourceforge.net/
As far as dhcp, I like it, saves configuring PC's. RH comes with one standard that you can install off the CD or download it from here and install.
ftp://ftp.rpmfind.net/linux/redhat/9/en/os/i386/RedHat/RPMS/dhcp-3.0pl1-23.i386.rpm
blobaugh
06-09-2003, 02:08 PM
Ok I haven't had time to try that yet, but say I had it all setup and was running DHCP. Do I have to tell the other computers where the gateway is or will it automagically find it, and if I ran DHCP on a different computer than the one sharing internet would it still work?(It will all be on the same computer, I just was wondering...)
linnov
06-09-2003, 02:16 PM
your dchpd.conf will have an entry for the lan side like so
ddns-update-style none;
subnet 172.16.4.0 netmask 255.255.255.0 {
# default gateway
option routers 172.16.4.1;
option subnet-mask 255.255.255.0;
option domain-name "xxxxx.net";
option domain-name-servers xxx.xxx.xxx.xxx, xxx.xxx.xxx.xxx;
range 172.16.4.100 172.16.4.200;
default-lease-time 21600;
max-lease-time 43200;
}