LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-15-2016, 01:22 PM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 610

Rep: Reputation: 34
Unable to mount NFS with iptables


Hi Below is my environment

CentOS release 6.8 (Final)
NFS 1:1.2.3-70.el6

export file is as -
/exp_fs *(rw,async,no_root_squash,no_subtree_check)

I can mount this while iptables are down on the server but as soon as I start I am getting an rpc error when I do showmount.

below are my iptables rules, what am I doing wrong

-A INPUT -s 172.16.10.0/24 -p udp -m state --state NEW -m udp --dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p tcp -m state --state NEW -m tcp --dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p tcp -m state --state NEW -m tcp --dport 2049 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p tcp -m state --state NEW -m tcp --dport 32803 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p udp -m state --state NEW -m udp --dport 32769 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p tcp -m state --state NEW -m tcp --dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p udp -m state --state NEW -m udp --dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p tcp -m state --state NEW -m tcp --dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p udp -m state --state NEW -m udp --dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p tcp -m state --state NEW -m tcp --dport 662 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -p udp -m state --state NEW -m udp --dport 662 -j ACCEPT

Thanks and Regards
 
Old 06-15-2016, 02:30 PM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 404

Rep: Reputation: 73
Hi,

NFS (at least old version) relies on additional random ports to work.
If I remember correctly, they are commented through out the /etc/sysconfig/nfs configuration file.
Edit it, uncomment the port lines. And make sure you allow them all in your iptables INPUT rules.

Sorry, I am not accurate, long time I worked on RHEL 6 or clones.
My suggestion is: upgrade to CentOS 7.
 
Old 06-15-2016, 02:31 PM   #3
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 404

Rep: Reputation: 73
I think you also need to allow 2049/udp port as some old NFS clients work on UDP.
 
Old 06-15-2016, 02:56 PM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,091
Blog Entries: 3

Rep: Reputation: 178Reputation: 178
This might help you.

Tutorial – Configure IPTables for NFS Server on CentOS 6
 
Old 06-15-2016, 11:32 PM   #5
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 610

Original Poster
Rep: Reputation: 34
Hi Guys, thank you for the reply and I just got back to off and will try and updat you

Thanks and Best Regards
 
Old 06-16-2016, 12:40 AM   #6
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 610

Original Poster
Rep: Reputation: 34
Hi Guys your replies helped me to narrow down the matter, the problem was the placing of the reject all rual ,

-A INPUT -j REJECT --reject-with icmp-host-prohibited


Thank you and best of regards
 
Old 06-16-2016, 10:48 AM   #7
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,091
Blog Entries: 3

Rep: Reputation: 178Reputation: 178
That is your last rule? If things got that far you are missing other rules that are needed.

Post your firewall rules and we will see if we can figure out where the problem lies.
 
1 members found this post helpful.
Old 06-27-2016, 04:17 AM   #8
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 610

Original Poster
Rep: Reputation: 34
Hi Lazboy, this I overlooked fault on my side

Thanks and Best Regards
 
  


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
Unable to Mount NFS share with Iptables on ameharhughes Linux - Software 1 04-19-2014 09:43 PM
[SOLVED] NFS Client Unable to Mount the NFS Share devUnix Linux - Server 7 10-31-2013 02:12 PM
Unable to mount nfs samkhan83 Linux - Newbie 13 08-13-2012 02:41 PM
NFS through iptables: unable to configure it guarriman Fedora 1 12-06-2006 03:28 AM
iptables blocking NFS mount karwoski Linux - Networking 0 11-19-2003 02:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration