Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-15-2004, 01:12 AM   #1
LQ Newbie
Registered: Mar 2004
Posts: 7

Rep: Reputation: 0
Smile Configure rh9 as a firewall and router for my windows webserver

Hi All,

Can you help me how to setup my rh9 linux box as firewall/router for my internal network as internet gateway and router to provide connection for windows web server and show to internet.

Additional question how to setup/create iptables rules to run automatically after booting.

thanks in advance.

Old 03-15-2004, 02:07 AM   #2
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
u need to read howto's.. u can find them at
i will try to explain basicly..

1 - first u must enable routing. edit /etc/sysctl.conf and change the line like this
net.ipv4.ip_forward = 1

2 - enable SNAT (to allow web server reply tcp packets comes from internet)
iptables -t nat -A POSTROUTING -s web_server_ip -j SNAT --to linux_public_ip

3 - redirect tcp port 80 pakets which comes from internet, to web server.. change eth0 to interface which connected to internet..
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to web_server_ip

u must read howtos to config your linux as a firewall. these commands just redirects tcp 80 port to web server. and allow webserver ro reach internet via NAT.

following line will save iptables configuration..
service iptables save

this line shows the config of iptables
service iptables status


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Router/firewall/webserver 2 nics dsl question don_from_wi Linux - Networking 2 03-29-2005 06:02 PM
how to configure 6 NICs on Red hat 9.0 to make a firewall/router for 5 lans? johnny_boy_2k3 Linux - Hardware 1 05-02-2004 08:28 PM
How to setup RH9.0 as firewall/router to share internet connection iel Linux - Networking 3 03-04-2004 02:33 AM
RH9 Firewall blocking webserver lsgko Linux - Newbie 3 08-17-2003 07:40 AM
how to configure a linux firewall behind my cisco router totfc Linux - Security 0 06-01-2002 11:04 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration