Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Don't know much about iptables, but I think that it's preventing me from FTP-ing on my local network. Have wu-ftp set up on machine A, and can ftp into the localhost with no problem. However, if I try to ftp into A from machine B the connection is refused. Port 21 is open on machine A. Machine A also serves as a firewall, web server, smtp server, and sql server. I'm interested in only allowing local (192.168.1.*) ftp transfers between machine A and machine B. I know absolutely nothing about iptables, but it appears as though the machine is accepting ssh, http, and smtp from anywhere - is this where the problem is?
If you have this system running on a private network and feel safe enough to flush the iptables, then you could do a quick test. run "iptables -F" which will remove all rules. Then try to connect again. If you are successful, then it is a firewall issue.
If this turns out to be the case, I can try to check the rules you posted and see if I can give you a specific line to add to your iptables file to allow the traffic you want.
Originally posted by adamgedde
Don't know much about iptables, but I think that it's preventing me from FTP-ing on my local network. Have wu-ftp set up on machine A, and can ftp into the localhost with no problem. However, if I try to ftp into A from machine B the connection is refused. Port 21 is open on machine A. Machine A also serves as a firewall, web server, smtp server, and sql server. I'm interested in only allowing local (192.168.1.*) ftp transfers between machine A and machine B. I know absolutely nothing about iptables, but it appears as though the machine is accepting ssh, http, and smtp from anywhere - is this where the problem is?
The problem lies with your iptables settings below. You could add a second layer of security by using the hosts.allow and hosts.deny.
in /etc/hosts.deny add the following line
Code:
wu-ftpd: ALL EXCEPT 192.168.1.
this (above) would block all wu-ftpd traffic except for clients from 192.168.1.*
From what I can see, the rules are pretty weird. If I knew a little more about what specifically you needed, I could try to help you clean this up. Below is what I can tell about it (although I am not an iptables expert)
The first rule allows all ntp (network time protocol) comms.
2nd, 3rd, & 6th rules - do some logging
4th & 5th - drop all outbound packets from <private-IP> (I assume you used <private-IP> for 2 different nets, you normally reflect that in a post by saying <private-IP1> and <private-IP2>)
7th - is a repeat of rule # 1
8th - accept all udp traffic from <private-IP> high ports 1025 through 65535 from any server on port 53 (DNS)
9th - accept any connections to smtp server (may not be a problem - on RH 9 sendmail is configured to only accept mail from localhost by default)
10th - accept any connections to http server
11th - accept any connections to ssh server
12th & 13th - both allow all udp (connectionless) bootp traffic bootps = BOOTP server bootpc = BOOTP client
14th - accept all traffic from anywhere to anywhere
15th - reject all tcp traffic not already explicitly allowed to ports 0 through 1023
16th - reject all traffic to nfs (redundant from rule 15)
17th - reject all udp traffic not already explicitly allowed to ports 0 through 1023
18th - reject all udp traffic to nfs (redundant from rule 17)
19th - reject all tcp traffic to ports 6000 to 6009
20th - reject all tcp traffic to xfs (X font server)
you would want to add this above all other rules but below the part that says "-A FORWARD -j RH-Lokkit-0-50-INPUT". It doesn't have to be in that spot, but it would need to come before any REJECT rules.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.