LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-27-2002, 02:20 AM   #1
FredrikN
Member
 
Registered: Nov 2001
Location: Sweden
Distribution: GNU/Linux since -97
Posts: 149

Rep: Reputation: 15
Simple problem with ....


Hi, I'm trying to write an Online Firewall creator but I have one problem.

This will fix Masq and Forwarding

echo '1'> /proc/sys/net/ipv4/ip_forward
/sbin/iptables --table nat --append POSTROUTING -o eth1 -j MASQUERADE
/sbin/iptables --append FORWARD --in-interface eth0 -j ACCEPT


But problem is that anything from eth1(LAN) will be accepted
out to Internet.

I want to enable Masq and Forwarding AND by default deny everything from eth1.

And then I want to open upp some selected ports, udp and tcp.

I have been reading some docs but can't figure it out

Does anyone have a clue ?


 
Old 10-27-2002, 05:57 AM   #2
davebarnes
LQ Newbie
 
Registered: Dec 2000
Location: Derbys, UK
Distribution: RedHat, Slackware
Posts: 29

Rep: Reputation: 15
Set your default policy on the forward chain to DROP - then you'll have to specifically allow any forwarding, as in your 3rd line
 
  


Reply



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
Simple problem Blitzkreig75 Slackware 7 11-21-2005 08:13 PM
a simple C problem! kapsikum Programming 10 04-14-2005 03:07 AM
simple C++ Problem :) indian Programming 2 02-28-2005 09:42 AM
Help....Simple problem hkstandard Mandriva 1 09-20-2004 05:03 AM
A Simple Problem! r52 Linux - Newbie 1 11-02-2003 06:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:05 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration