Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

p3scan iptables rules

Posted on 2004-04-08
4
Medium Priority
?
828 Views
Last Modified: 2010-05-18
hello,

May you know the http://p3scan.sourceforge.net/ project. It is a transperent pop3 proxy which use iptables to redirect tcp packets to port 8110 and run virus scanning. This port is p3scan own. The readme say: in the default case we can use the next iptables rule: "iptables -t nat -A PREROUTING -p tcp -i eth0 --dport pop3 -j REDIRECT --to 8110" and it's works fine when a packet coming from some clients from our local network. But I want to set up an another iptables rule, which say the next: if our linux gw (the p3scan runing on this server too) want to download our mails so that will be redirect to the port 8110 too.

thanks your help!
0
Comment
Question by:Kosztik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:brabard
ID: 10785063
Well , the core of iptables rules that redirect some requests by ports/services is to catch the requests before leaving the gateway , so you can try -o eth1 in OUTPUT chain , assuming eth1 is the interface that connect you to the Internet .

Tommorow I will try it with my pop3vscan .
0
 
LVL 9

Assisted Solution

by:Alf666
Alf666 earned 100 total points
ID: 10787463
You can not do that. This would create a loop.

You need your linux box to be able to connect to POP3 servers on the internet. If you add a rule on the OUTPUT, then your p3scan will connect to itself. BAD !

The only thing you can do is to configure your clients on the gateway to connect directly to port 8110.
0
 
LVL 5

Accepted Solution

by:
brabard earned 400 total points
ID: 10789557
Alf666 is absolutely right , the use of this rule will maka e loop , but the answer is in the bottom of README file of my pop3vscan distribution . Assuming p3scan is running as a special user , the rules have to be :
iptables -t nat -A OUTPUT -p tcp --dport pop3 -m owner --uid-owner UID -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport pop3 -j REDIRECT --to 8110

0
 

Author Comment

by:Kosztik
ID: 10789836
>  , but the answer is in the bottom of README file of my >pop3vscan distribution

oh really! Thank you !!!
0

Featured Post

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question