LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2002, 09:29 AM   #1
corrierich
LQ Newbie
 
Registered: Oct 2002
Distribution: Red Hat 7.3
Posts: 10

Rep: Reputation: 0
Can't ftp/ping external addresses from client


Hi,

Following an excellent tutorial (http://homepage.ntlworld.com/jandg-cooper/home_network/) I successfully setup a home network which consists of a redhat 7.3 server acting as a gateway and two clients (WinXP PC and a Win98 laptop). The gateway connects to the Net via a cable modem with a dynamic IP address and almost everything works brilliantly...

My one big problem is that I cannot ftp from the clients to external sites!!! The names/ip's resolve OK but then nothing. A ping from a client to an external site name shows the ip address being resolved but then the request just times out, as if the firewall is silently dropping the reply? (It happens on both W98 and XP but I can ping externally ok from the gateway itself) I think I have loaded the necessary modules - ip_conntrack_ftp and ip_nat_ftp (full list at the end)

I would be very grateful if somebody could have a look at the firewall script I am using and give me an idea why ftp/ping is not working (if it is to do with the firewall). And of course if you have any suggestions to improve it feel free.

It's probably something really simple that i have missed, but i don't know what to try!

Thanks


# eth0 is connected to the lan and eth1 is connected to NTL Cable modem

# Flush nat table and set policies
iptables -t nat -F
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT

# Masquerade the internet connection
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

# Flush Filter table and set policies
iptables -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

# Allow email in
iptables -A INPUT -i eth1 -p TCP --dport smtp -j ACCEPT
iptables -A INPUT -i eth1 -p UDP --dport smtp -j ACCEPT

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# The next settings open ports to allow NTL network management over
# the cable modem link.

# allow pings
iptables -A INPUT -i eth1 -p ICMP -j ACCEPT


# allow DHCP messages from the ubr
iptables -A INPUT -i eth1 -s 172.29.xxx.xxx -p UDP --dport bootpc -j ACCEPT

# allow DHCP messages from the NTL DHCP servers
iptables -A INPUT -i eth1 -s 62.252.32.3 -p UDP --dport bootpc -j ACCEPT
iptables -A INPUT -i eth1 -s 62.252.32.4 -p UDP --dport bootpc -j ACCEPT
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# Disallow any other NEW and INVALID incoming or forwarded packets
# from the internet
iptables -A INPUT -i eth1 -m state --state NEW,INVALID -j DROP
iptables -A FORWARD -i eth1 -m state --state NEW,INVALID -j DROP


#[END]


The modules I have loaded are...

lsmod

Module Size Used by Not tainted
ip_conntrack_ftp 4768 0 (unused)
ip_nat_ftp 4160 0 (unused)
autofs 11940 0 (autoclean) (unused)
3c509 10624 1
3c59x 27432 1
ipt_state 1408 2 (autoclean)
ipt_MASQUERADE 2272 1 (autoclean)
iptable_nat 19348 2 (autoclean) [ip_nat_ftp ipt_MASQUERADE]
ip_conntrack 20044 3 (autoclean) [ip_conntrack_ftp ip_nat_ftp ipt_state ipt_MASQUERADE iptable_nat]
iptable_filter 2624 1 (autoclean)
ip_tables 13536 6 [ipt_state ipt_MASQUERADE iptable_nat iptable_filter]
ide-cd 29856 0 (autoclean)
cdrom 33184 0 (autoclean) [ide-cd]
ext3 64448 5
jbd 47608 5 [ext3]
 
Old 10-29-2002, 09:46 AM   #2
lintadsl
LQ Newbie
 
Registered: Oct 2002
Posts: 25

Rep: Reputation: 15
It seems like you need to open TCP and UDP protocol on port 21.
The other thing is have you enabled your wuftp or proftp whatever you use for ftp server?

Lintadsl
 
Old 10-29-2002, 10:01 AM   #3
corrierich
LQ Newbie
 
Registered: Oct 2002
Distribution: Red Hat 7.3
Posts: 10

Original Poster
Rep: Reputation: 0
I don't actually want to run an ftp service on the gateway, I just want to be able to ftp to external sites from a client within the network.
 
Old 04-14-2003, 05:14 AM   #4
delvit
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Rep: Reputation: 0
Did you solve this problem?? I have same situation here?
 
Old 04-14-2003, 12:08 PM   #5
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
try
iptables -A FORWARD -i eth1 -m state --state INVALID -j DROP
against used
iptables -A FORWARD -i eth1 -m state --state NEW,INVALID -j DROP
above is not safe but I hope will help (pls inform me if helps)
 
Old 04-14-2003, 05:15 PM   #6
delvit
LQ Newbie
 
Registered: Apr 2003
Posts: 2

Rep: Reputation: 0
Actually I have aDSL so I need to do that from ppp0 so I will try it and I will let you know
 
Old 04-15-2003, 12:18 PM   #7
corrierich
LQ Newbie
 
Registered: Oct 2002
Distribution: Red Hat 7.3
Posts: 10

Original Poster
Rep: Reputation: 0
The problem was very simple in the end, IP forwarding did not survive a reboot! I did not check the simple stuff before assuming it must be the firewall.
 
  


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
Ping ip range to find live ip addresses? ginda Linux - Networking 2 07-16-2005 09:58 PM
dhcp client can't ping gateway but can ping other local hosts dirty_forks Linux - Networking 7 10-08-2004 10:54 AM
ping and IP addresses BACTRATE Mandriva 3 06-16-2004 06:49 PM
Cant ping external ip addresses from DHCP clients!!! debloxie Linux - Networking 17 01-24-2004 03:00 AM
I can ping google.com successfully,but ping client(in my intranet) failed.Why? whepin Linux - Newbie 4 12-30-2001 04:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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