Solved

Ipchains only mail

Posted on 2000-05-10
10
298 Views
Last Modified: 2010-04-20
I need put a ipchains for DENY all packets TCP, but no mail packets,from pc 192.168.2.168. I put
ipchains A input -p TCP -s 192.168.2.168 ! pop-3 ! smtp -j DENY. But it doesnt' work as i want it.
0
Comment
Question by:G2MD
  • 5
  • 5
10 Comments
 
LVL 2

Expert Comment

by:ksemat
Comment Utility
I really don't get what you're saying do you want to deny all mail packets from 192.168.2.168 and allow all other tcp packets or the other way round?
have you also tried the full path i.e /sbin/ipchains?
try ipchains -A input -p tcp -s 192.168.2.168 -d $1 25 -j DENY
if what you want is to allow all other packets apart from smtp packets from 192.168.2.168
0
 
LVL 2

Expert Comment

by:ksemat
Comment Utility
oops type the full command path /sbin/ipchains
0
 

Author Comment

by:G2MD
Comment Utility
I want that 192.168.2.168 only use internet for email. That's right
0
 
LVL 2

Expert Comment

by:ksemat
Comment Utility
then try fisrt denying all packets from 192.168.1.168 then specifically allowing smtp packets from it. Something like
/sbin/ipchains -A input -l -s [banned host] -d $1 -j DENY
then add the other rule I gave you except chage it to accept.Where banned host is the IP of the host whose packets you want to deny.
0
 

Author Comment

by:G2MD
Comment Utility
What's $1 in that command?. And For deny a packet you i put -j DENY, what do i put in the command for accept smtp packet [from banned host]?. Do i need accept pop-3 packets,too ?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 2

Expert Comment

by:ksemat
Comment Utility
You only need to accept pop3 packets if your users are going to allow them to pop mail off your server using clients like eudora outlook express pegasus etc
to allow smtp packets
/sbin/ipchains -A input -p tcp -s 192.x.x.x -d $1 25 -j ACCEPT
If you decide to accept pop3 then change the port 25 above to 110 in a separate entry.
to understand ipchains read the manual pages and the howtos on the internet.
0
 

Author Comment

by:G2MD
Comment Utility
These commands wasn't accept for the ipchains, because don't have destination ip address. I probe with this command
/sbin/ipchains -A input -l -s 192.x.x.x -d 0/0 $1 -j DENY

/sbin/ipchains -A input -l -s 192.x.x.x -d 0/0  $1 25 -j ACCEPT

/sbin/ipchains -A input -l -s 192.x.x.x -d 0/0  $1 110 -j ACCEPT

And i can't receive and send email from pc 192.168.x.x.x

0
 

Author Comment

by:G2MD
Comment Utility
/sbin/ipchains -A input -l -s 192.x.x.x -d 0/0 $1 -j DENY

/sbin/ipchains -A input -p tcp -l -s 192.x.x.x -d 0/0  $1 25 -j ACCEPT

/sbin/ipchains -A input -p tcp -l -s 192.x.x.x -d 0/0  $1 110 -j ACCEPT
 
I had to read the howsto and these manuals doesn't speak about parameter $ 1 and i don't understand the parameter -l.

Thank's a lot
0
 
LVL 2

Accepted Solution

by:
ksemat earned 50 total points
Comment Utility
It is probably a problem to do with flushing rulesets now what I suggest is go to http://firewall.langistix.com and download a firewall script from there and then edit it and and make the appropriate changes because ny problem is that explaining ipchains will take a lot of writing just either add your host to the banned or the friends basing on what I have already given you.
I don't use it but I have looked through it and it will definitely help solve your problem.
0
 

Author Comment

by:G2MD
Comment Utility
Than's for everything
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now