LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 12:22 PM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

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, 01:30 PM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
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, 01:31 PM   #3
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

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

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

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

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-15-2016, 11:40 PM   #6
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

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, 09:48 AM   #7
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
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, 03:17 AM   #8
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 651

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

Thanks and Best Regards
 
  


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

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

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