Advertisement

07.26.2004 at 02:29PM PDT, ID: 21071935
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

IPTABLES: NAT and FORWARD

Asked by telman in Linux Network Security

Tags: , ,

Hi,


I am trying to setup a spam filter gateway. We have iptables firewall running on Linux box. Our firewall is connected to the public internet and ip addresses behind firewall are public too.

So I want to redirect email traffic to the spam filter gateway using iptables.
Currently I am using forward rules to forward rules to forward my traffic from eth0 to eth1

   e.g.
    iptables -P INPUT DROP
    iptables -P FORWARD DROP
    iptables -P OUTPUT ACCEPT
    iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 80  -j ACCEPT
    iptables -A FORWARD -p tcp -s 0/0 -d 0/0--dport 443 -j ACCEPT

However I assumed I will have to use NAT to redirect emails to the spam gateway.
 
  iptables -P INPUT DROP
  iptables -P FORWARD DROP
  iptables -P OUTPUT ACCEPT
  iptables -t nat -P PREROUTING DROP
  iptables -t nat -P POSTROUTING DROP

  iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
  iptables -A FORWARD -p tcp -s 0/0 -d 0/0 --dport 80  -j ACCEPT
  iptables -A FORWARD -p tcp -s 0/0 -d 0/0--dport 443 -j ACCEPT

  iptables -A PREROUTING -i eth0 -t nat -p tcp -s 0/0 -d <Public_ip_1> --dport 25 -j DNAT --to-destination <Public_ip_2>:25

1. Can I use forward chain rules and NAT the same time?
2. Do I need to load NAT modules in  /etc/sysconfig/iptables-config?
3. Can I redirect public ip to public ip address or I will have to map public to non-public?
4. What will happen if I do not change default policy for NAT?
5. How do list rules for NAT?
6. Do I need to assign ip address to eth0 (external interface) in order use nat?


I enabled NAT today and firewall went down.


Thanks,

TelmanStart Free Trial
[+][-]07.26.2004 at 02:36PM PDT, ID: 11641885

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2004 at 08:47AM PDT, ID: 11647646

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2004 at 10:24AM PDT, ID: 11648702

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2004 at 11:29PM PDT, ID: 11653862

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux Network Security
Tags: iptables, nat, forward
Sign Up Now!
Solution Provided By: ahoffmann
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.28.2004 at 09:16AM PDT, ID: 11658194

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32