Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables rule problems

Reply
Thread Tools Display Modes

iptables rule problems

 
 
Kauna
Guest
Posts: n/a

 
      10-10-2003, 09:05 AM
Hi folks,

I've a lot of problems with iptables configuration on my RH 9. In
particular when I try to connect with FTP client (port 21).
I can use correctly SSH and HTTP protocol, only FTP appears not
enabled! When I try to connect via FTP onto my linux box the session
was stalled.

Below, I have showed my rules:

----------------------------------
iptables --flush
iptables --delete-chain
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -s 255.0.0.0/8 -j LOG --log-prefix "Spoofed IP"
iptables -A INPUT -s 255.0.0.0/8 -j DROP
iptables -A INPUT -s 0.0.0.0/8 -j LOG --log-prefix "Spoofed IP"
iptables -A INPUT -s 0.0.0.0/8 -j DROP
iptables -A INPUT -s 127.0.0.0/8 -j LOG --log-prefix "Spoofed IP"
iptables -A INPUT -s 127.0.0.0/8 -j DROP
iptables -A INPUT -s 192.168.0.0/16 -j LOG --log-prefix "Spoofed IP"
iptables -A INPUT -s 192.168.0.0/16 -j DROP
iptables -A INPUT -s 172.16.0.0/12 -j LOG --log-prefix "Spoofed IP"
iptables -A INPUT -s 172.16.0.0/12 -j DROP
iptables -A INPUT -s 10.0.0.0/8 -j LOG --log-prefix "Spoofed IP"
iptables -A INPUT -s 10.0.0.0/8 -j DROP
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j LOG
--log-prefix "Stealth attempt"
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A INPUT -p tcp -j ACCEPT --dport 21 -m state --state NEW
iptables -A INPUT -p tcp -j ACCEPT --dport 22 -m state --state NEW
iptables -A INPUT -p tcp -j ACCEPT --dport 80 -m state --state NEW
iptables -A INPUT -p udp -m udp -s 0/0 --sport 67:68 -d 0/0 --dport
67:68 -i eth0 -j ACCEPT
iptables -A INPUT -p udp -m udp -s 0/0 --sport 67:68 -d 0/0 --dport
67:68 -i eth1 -j ACCEPT
iptables -A INPUT -p udp -m udp -s 10.212.44.1 --sport 53 -d 0/0 -j
ACCEPT
iptables -A INPUT -p udp -m udp -s 10.212.44.4 --sport 53 -d 0/0 -j
ACCEPT
iptables -A INPUT -j LOG --log-prefix "Default dropped"
iptables -I OUTPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -j LOG --log-prefix "Default dropped"
----------------------------------

Any ideas?

Many thanks for your suggestions!

Kauna
 
Reply With Quote
 
 
 
 
Mike
Guest
Posts: n/a

 
      10-14-2003, 01:39 PM
1. /sbin/modprobe ip_conntrack_ftp
2. open the 20 (ftp-data) port
3. try to use "passive mode" in your ftp client

Mike


 
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables rule Bonno Bloksma Linux Networking 6 03-06-2010 10:48 PM
iptables: rule with RETURN target just after a rule with ACCEPT target Neroku Linux Networking 0 04-25-2007 08:13 AM
iptables: rule with RETURN target after a rule with the ACCEPT target Neroku Linux Networking 0 04-24-2007 08:43 PM
iptables add rule case jeniffer Linux Networking 4 11-07-2006 09:35 AM
Iptables rule ID drg Linux Networking 3 02-22-2006 02:24 AM



1 2 3 4 5 6 7 8 9 10 11