LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-18-2002, 06:07 PM   #1
pmoss
LQ Newbie
 
Registered: Feb 2002
Posts: 7

Rep: Reputation: 0
Question Trying to setup a firewall router using iptables


I'm trying to setup a firewall and router using iptables. My setup is as follows:
eth0 connected to cable modem (dynamic ip)
eth1 internal network static ip address (x.x.x.10)
rh7.2

My iptables settings are as follows: (Based on several howtos)

modprobe ipt_MASQUERADE
/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t mangle -F
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
echo " enabling forwarding.."
echo 1 > /proc/sys/net/ipv4/ip_forward

From my firewall/router Ihave web access and can ping my other computer on the internal network (ip x.x.x.1).

From my internal network computer I can ping the firewall/router however I cant connect to the outside.
I've set the browser to use a proxy server (x.x.x.10:80)

Question I'm I missing something?
Do I need to be running a proxy server or can I just use iptables with masquerading?


Thanks
p.s. I've spent about 5hours playing with diffrent -i/-o eth1/eth0 settings.
 
Old 03-18-2002, 07:25 PM   #2
porky
LQ Newbie
 
Registered: Feb 2002
Location: London
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
just set the nic card of the pc on the lan to have a gateway of *.*.*.10 and your nameservers. no need to use it as a proxy.
 
Old 03-19-2002, 10:52 PM   #3
pmoss
LQ Newbie
 
Registered: Feb 2002
Posts: 7

Original Poster
Rep: Reputation: 0
That help some

thanks - that helped some. I'm able to pull up web pages if I use the IP addr but not if I use the name.

I think I just need to add the ISP DNS server information on each internal computer; but, that's tomorrows task of the day - ha.

Thanks again for your help.
 
Old 03-20-2002, 12:15 AM   #4
bbenz3
Member
 
Registered: Feb 2002
Location: Orlando
Distribution: Whatever I feel like at the time I install.
Posts: 284

Rep: Reputation: 30
I personally just installed a DHCP server for the internal lan. It really isn't that hard and it saves you the trouble of only having to setup the info once. From the looks of your firewall you are accepting everything. I would suggest looking for one posted by one of the moderators in the security section as a guideline. I started with that one and then edited it to meet my needs. to find it search for iptables in the security section forum.
 
  


Reply


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
Can't get to IMAP server through iptables firewall/router matthanley Linux - Networking 0 05-05-2004 07:09 PM
RH 9 Firewall/Router Iptables DMZ Dammas Linux - Software 0 03-30-2004 01:02 AM
router/firewall setup please help?! basatum Mandriva 1 09-20-2003 03:53 PM
isight through a linux router/firewall (iptables) rob_roman23 Linux - Networking 2 07-23-2003 10:19 AM


All times are GMT -5. The time now is 07:27 AM.

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