LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-03-2002, 07:46 AM   #1
gtgeo
LQ Newbie
 
Registered: Oct 2002
Posts: 1

Rep: Reputation: 0
firewall questin. smtp name server.


i am runing debian. with smtp (postfix) name server (bind 9.x)
i want to open only needed ports. 53 udp (ns) 25 tcp (smtp)
is it right? or i have to open 53 tcp/udp and 25 tcp/udp.?
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p udp --dport 53 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -j DROP
ns does not work. smtp works but do not send messages. obnly reciving.
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p udp --dport 53 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p tcp --dport 53 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -j DROP
name server works. but smtp the same problem. what shouild i do? please help.
 
Old 10-03-2002, 01:51 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I don't know why you use FORWARD... Maybe INPUT would be better?
 
Old 10-04-2002, 06:42 AM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Re: firewall questin. smtp name server.

Quote:
Originally posted by gtgeo
i am runing debian. with smtp (postfix) name server (bind 9.x)
i want to open only needed ports. 53 udp (ns) 25 tcp (smtp)
is it right? or i have to open 53 tcp/udp and 25 tcp/udp.?
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p udp --dport 53 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -j DROP
ns does not work. smtp works but do not send messages. obnly reciving.
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p udp --dport 53 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p tcp --dport 53 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -d 213.157.20.62 -i eth1 -j DROP
name server works. but smtp the same problem. what shouild i do? please help.
Try
iptables -P INPUT DROP
iptables -A INPUT -i eth1 -s my.dns.server.ip -p udp --sport 53 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp -m state --state NEW,INVALID -j DROP
iptables -A INPUT -i eth1 -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
as a start.
FORWARD is used to filter packets being sent to other pc's.
Don't worry about the -d my.ip coz the rp_filter will take care of the bad destination numbers.

Regards,
Peter
 
  


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
Questin about mandrake licencing jedimastermopar Mandriva 7 06-16-2004 07:56 PM
SMTP router & firewall gizbourn Linux - Wireless Networking 1 02-18-2004 01:19 PM
firewall setup and MX smtp router gizbourn Linux - Networking 0 02-18-2004 07:03 AM
Help! Can I install an smtp Server/(sendmail) on my firewall? mfeoli Linux - Networking 4 02-12-2004 09:19 AM
NMF (Network Multi Firewall) 8.2 and SMTP; POP3 access Cayouettem Linux - Networking 0 08-23-2003 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:48 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