LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-05-2006, 05:48 PM   #1
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30
problem with IPtables?


i thought i had my iptables script setup correctly. after installing my ventrilo server before opening the ports on it for my firewall i was able to connect to it through the ventrilo client software. so maybe something is wrong?

[root@vps local]# iptables -L -v -n
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
174 13112 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dpor ts 21,22,25,80,110,3784,10000,14534,51234
37 1776 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport dpor ts 3785,8767

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 162 packets, 13044 bytes)
pkts bytes target prot opt in out source destination


i just put in the ventrilo ports needed for the server so they show up in there now but for some reason it let in a packet through a port which i dindt specify to ACCEPT

this is the script im using

#!/bin/bash

IPT="/sbin/iptables"

$IPT -P INPUT DROP
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD DROP
$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT
$IPT -t mangle -P PREROUTING ACCEPT
$IPT -t mangle -P OUTPUT ACCEPT

$IPT -F
$IPT -F -t nat
$IPT -F -t mangle

$IPT -X
$IPT -X -t nat
$IPT -X -t mangle

# $IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -m state --state NEW
$IPT -A INPUT -i lo -j ACCEPT

$IPT -A INPUT -p tcp -m multiport --dports \ 21,22,25,80,110,3784,10000,14534,51234 -j ACCEPT
$IPT -A INPUT -p udp -m multiport --dports \ 3785,8767 -j ACCEPT

i have the states taken out right now becasue im still trying to resolve a kernel problem with my VPS with my host

Last edited by MrSako; 08-05-2006 at 05:49 PM.
 
Old 08-06-2006, 08:25 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
hello MrSako... try appending a LOG rule to the end of your INPUT chain... this way you can monitor the logfile to see what is getting filtered...
Code:
$IPT -A INPUT -j LOG --log-prefix "INPUT DROP: "
then to monitor the logfile:
Code:
tail -f /var/log/syslog
 
  


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
problem iptables stomach Linux - Software 2 05-07-2007 03:47 AM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
iptables problem Israfel2000 Linux - Security 10 06-09-2005 10:47 PM
problem in iptables alvi2 Linux - Networking 1 03-23-2005 12:31 PM
iptables problem shailesh_jain Linux - Security 2 05-25-2004 07:42 AM

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

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