LinuxQuestions.org
Review your favorite Linux distribution.
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 06-18-2005, 06:01 AM   #1
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Rep: Reputation: 43
Debian - IPTABLES


I have just started administrate Debian server. The previews admin left no documentation for configuration of this system.
My knowladge is good about Slackware but I never used other distro.

This server is MTA ( on postfix) for Exchange 2003. It is conected to external net on eth0, and on eth1 connected directly to Exchange server.
All i need to do at first is to block all incomeing connection on eth0 ( external net) on port 21,22,23 ( ftp, ssh, telnet ).

In slack it was easy. I could use IPTABLES and below entries:

insmod ip_conntrack
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -m multiport --dport 21,22,23 -j DROP

but when i rune this under that Debian server i received errors:

insmod: ip_conntrack: no module by that name found
iptables v1.2.6a: can't initialize iptables table `filter': Table does not exist
(do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.2.6a: can't initialize iptables table `filter': Table does not exist
(do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Is that mean that this server has no IPTABLES ?
If not, then how can I install it ?
Does anyone know reason of this ?

Does anyone has description of how to configure MTA (mail tyransport agent ) on POSTFIX on SLACKWARE ?
 
Old 06-18-2005, 08:55 AM   #2
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,883
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
Sounds like you need to upgrade the kernel.

And that iptables may not be install. That is an easy fix in a terminal/console/shell
type apt-get install iptables. You might want to install webmin and webmin-firewall so you can access the control from the web.
 
Old 06-18-2005, 09:46 AM   #3
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Original Poster
Rep: Reputation: 43
in answer i received this:

Reading Package Lists... Done
Building Dependency Tree... Done
Sorry, iptables is already the newest version.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

correct me if I am wrong. That means IPTABLES is installed ?
It would be good if i havent to upg kernel - never done this before.

#edit
when i type in shell "iptables" then i receive this:
iptables v1.2.6a: no command specified
Try `iptables -h' or 'iptables --help' for more information.

looks like iptables is alrdy in system.

#edit 2
Where should i look for iptables script in Debian ?
In slackware the default location is /etc/rc.d/rc.firewall

Last edited by czezz; 06-18-2005 at 09:52 AM.
 
Old 06-18-2005, 01:55 PM   #4
Noth
Member
 
Registered: Jun 2005
Distribution: Debian
Posts: 356

Rep: Reputation: 30
What version of kernel and Debian are you using?
 
Old 06-19-2005, 05:17 AM   #5
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 924

Original Poster
Rep: Reputation: 43
this is 2.4.24
 
Old 06-19-2005, 08:36 PM   #6
larrysu
LQ Newbie
 
Registered: Jun 2005
Posts: 3

Rep: Reputation: 0
You can read manual at /usr/share/doc/iptables/

vi /usr/share/doc/iptables/examples


you should

1.mkdir /var/lib/iptables
2.run your iptables command or iptables script
3./etc/init.d/iptables save active -->save yor iptable command or script to file "/var/lib/iptables/active"
4./etc/init.d/iptables save inactive -->save debain default stop iptabes script to file "/var/lib/iptables/inactive"

then use "sysvconfig" to set above iptables script start at boot.



sorry for my poor english.
 
Old 06-20-2005, 05:07 AM   #7
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Sounds like the kernel wasn't built with netfilter support..

Have a look in /lib/modules/2.4.24/kernel/net/ipv4/netfilter for the netfilter modules. If they aren't there, you will need to install a better kernel.

Debian released a new version last month, so I suspect your update setup may cause problems if it is set to use stable packages.
Have a look in /etc/apt/sources.list and change the word stable to woody
then do apt-get update.
The list of servers in sources.list should look like..

deb ftp://ftp.pl.debian.org/debian woody main contrib non-free
#deb ftp://ftp.pl.debian.org/debian sarge main contrib non-free

deb http://security.debian.org/ woody/updates main contrib non-free
#deb http://security.debian.org/ sarge/updates main contrib non-free

Then do..
apt-get install kernel-image-2.4.18-bf2.4
This kernel number remains the same but the updates are the latest

You should have an older version of this already installed, but an updated copy is necessary.

Change /etc/lilo.conf to use this new image and then do lilo -v to write it to the drive, then reboot.

Postfix is an easy system to configure once you can understand the terminology. If you would like me to give it an initial look and setup my gg number is 6245456
There are a lot of configuration items to consider that you can learn once it is running properly, and webmin is an excellent tool for that. Once it is running ok, it ususlly doesn't need to be touched for a very long time.

Last edited by peter_robb; 06-20-2005 at 05:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Debian iptables kingcomein Debian 4 10-31-2005 10:17 PM
Debian iptables kingcomein Linux - Networking 6 10-26-2005 06:20 AM
iptables on Debian ujotne Linux - Security 4 09-16-2005 07:36 PM
IPtables - Debian set up fredg Linux - Security 4 05-26-2005 05:04 PM
debian and iptables? banana2 Linux - Security 5 01-12-2003 09:35 AM

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

All times are GMT -5. The time now is 07:29 AM.

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