Latest LQ Deal: Latest LQ Deals
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-03-2004, 09:18 PM   #1
LQ Newbie
Registered: Mar 2004
Posts: 7

Rep: Reputation: 0
Unhappy How to setup RH9.0 as firewall/router to share internet connection

Hi everybody,

Badly need your help, this is my first time to work on linux especially configuring a linux as a firewall and router to share my Internet connection to my private network. I already setup RH9.0 and configure the 2 NIC, eth0 to connected to my ISP and eth1 connected to private network. I test my connection both outside in inside network, using ping command and recieved a succesful reply. But i have no idea what to do next, obviously i'm newbie. Pls hep me to complete my server configuration on secured manner. thanks in advance.
Old 03-04-2004, 02:23 AM   #2
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
u need to learn "iptables"
u may also use "squid" cache proxy with "iptables". its called transparent proxy
u may find documents at

i will try to explain basicly how to share internet connection for your local network, but these will just share internet connection via NAT, visit to configure your firewall.
first enable routing beetween network devices.
edit "/etc/sysctl.conf" file and chance the following line
net.ipv4.ip_forward = 1

the following command enables NAT for local network (chance to your real local network) eth0 must have a static public ip
iptables -t nat -A POSTROUTING -s -o eth0 -j SNAT --to ip_of_eth0

and save iptables config:
service iptables save
Old 03-04-2004, 02:23 AM   #3
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Rep: Reputation: 30
you will need to use iptables to set up the sharing.... I have done up a website to show you how to and it includes example scripts.

check out

Old 03-04-2004, 02:33 AM   #4
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
by the way your local clients will have trouble to connect ftp . u must enable passive ftp

u can add the following lines to startup file "/etc/rc.d/rc.local". so your linux will load ftp modules every startup:

modprobe ip_conntrack_ftp
modprobe ip_nat_ftp


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 and firewall setup jibskg Linux - Networking 1 08-23-2004 09:01 AM
need to setup router to share and route dialup connection Insurr3cti0n Linux - Networking 2 11-18-2003 12:32 AM
RH9 internet connection setup jewe Linux - Newbie 2 11-08-2003 03:25 AM
RH9 internet connection setup jewe Linux - Networking 1 11-07-2003 07:49 PM
router/firewall setup please help?! basatum Mandriva 1 09-20-2003 03:53 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:08 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
Open Source Consulting | Domain Registration