LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 12-14-2007, 10:50 AM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Rep: Reputation: 30
Thumbs up Firewall blocking the NFS server.


Hi everyone,


I have 2 servers connected to internet , but they are in the same location and subnet.
NFS server is running on server1(for example 192.168.1.1). i am able to access the server(192.168.1.1) from client 192.168.1.2 , even able to mount shares. Whenever i start the firewall(Iptables) in server1 , the NFS connection is refused and unable to mount the shares:

The following is the error i get:
mount: mount to NFS server 'x.x.x.x' failed: System Error: No route to host.

I have added the client IP to the firewall of server1 as follows. Is it enough to allow the NFS service?

iptables -A INPUT -s 192.168.1.2 -p udp --dport 2049 -j ACCEPT
iptables -A INPUT -s 193.168.1.2 -p udp --dport 2219 -j ACCEPT


IS it ok? or am doing something wrong. Please advice me.

Thanks in Advance.
 
Old 12-15-2007, 07:42 PM   #2
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
Do you by any chance have rules in your firewall that are doing NAT between the greater Internet and your private net (192.168.x.x)? If so, there is a real likelihood that a flaw in the rules may be doing you in. Once upon a time, I had a rule in my NAT table that said
Quote:
-t nat -A POSTROUTING -s 192.168.x.0/24 -j snat --to-source 216.39.145.64
This rule is missing a critical bit of qualification: it will remap packets originating on the local net without regard for whether they are going to the Internet. In particular, packets that originate on the firewall, and are intended for the local net will have their source address translated. This is not generally too big a problem, since the firewall knows both of its addresses, but in the case of NFS, the altered source address is probably not permitted to connect to the target, and you get an error.

The solution is to include an additional qualifier in the NAT rule:
Quote:
-t nat -A POSTROUTING -o {public net interface IP} -s 192.168.x.0/24 -j snat --to-source 216.39.145.64
This restricts the address translation to those packets that are headed out to the public Internet, and leaves traffic between the firewall and internal net hosts unmolested.

HTH
 
Old 12-17-2007, 04:34 AM   #3
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 598

Original Poster
Rep: Reputation: 30
Thank you dkm999,
I had open the port and it is working. Thank you
 
Old 12-17-2007, 09:09 AM   #4
wanghao
Member
 
Registered: Mar 2007
Distribution: centos
Posts: 126

Rep: Reputation: 15
what did you find,and how it was solved !
"i have open the port ",that means you used the incorrect ports in you firewall rule ,is it ? or you blocked you rpc port 111 ?

Last edited by wanghao; 12-17-2007 at 09:14 AM. Reason: for more info
 
  


Reply



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
Firewall blocking NFS even though ports are open OmnipotentOscar Linux - Security 13 01-25-2010 12:47 PM
NFS Mount to Server behind Firewall bigfoilin Linux - General 1 10-23-2007 03:06 PM
nfs apparantly not getting through server firewall PreacherBill Linux - Networking 2 03-28-2007 06:54 PM
Firewall setup for NFS server, Suse 9.1 deh6 Linux - Networking 1 08-25-2004 02:24 AM
help with client side NFS-firewall setup and server side NIS-firewall setup niverson Linux - Networking 3 02-02-2004 08:52 AM

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

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