LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-11-2018, 07:51 AM   #1
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 239

Rep: Reputation: 30
what is the best way to limit nfs shares to two IPs in a cluster environment


I have searched the interwebs but couldn't get a working answer.

I want to create a nfs share to only 2 hosts, which i can easily do by:

Code:
cat /etc/exports
/data 1.1.1.1(rw,sync,no_root_squash) 1.1.1.2(rw,sync,no_root_squash)
in a cluster environment; the above file is not utilized anymore and instead it options should be set inside a cluster resource. But I don't know how i can add that as a resource without the need to create 2 individual resource for each IP address. The following will allow all IPs in the same subnet but I only want 2 specific IPs access.

Code:
pcs resource create nfs-root exportfs \
clientspec=1.1.1.1/255.255.255.0 \
options=rw,sync,no_root_squash \
directory=/data \
fsid=0 --group clustergrp
Appreciate if you can share any information that can help me solve this.
 
Old 06-11-2018, 09:52 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
This suggests you have to add two separate client spec resource lines - one for each IP (example is subnets).

Alternativekly you might be able to change the netmask to 255.255.255.254 if the IPs are consecutive as you show. That would limit it to 2 IPs allowed in that subnet. That is to say the subnet you use in the export doesn't necessarily have to match the subnet of the server to which you're exporting.
 
Old 06-12-2018, 08:32 AM   #3
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 239

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by MensaWater View Post
This suggests you have to add two separate client spec resource lines - one for each IP (example is subnets).

Alternativekly you might be able to change the netmask to 255.255.255.254 if the IPs are consecutive as you show. That would limit it to 2 IPs allowed in that subnet. That is to say the subnet you use in the export doesn't necessarily have to match the subnet of the server to which you're exporting.
thanks i saw this post as well. its the closest solution.
 
  


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
LXer: How to configure an NFS server and mount NFS shares on Ubuntu 14.10 LXer Syndicated Linux News 0 11-26-2014 07:31 PM
LXer: How to configure a NFS server and mount NFS shares on Ubuntu 14.04 LXer Syndicated Linux News 0 07-09-2014 09:00 AM
HA nfs cluster problem (with pacemaker, openais, nfs and drbd ) ratotopi Linux - Server 0 11-08-2013 11:44 PM
I want to limit IPs in /etc/networks, how? Jykke Linux - Networking 3 08-28-2010 02:01 PM
NFS and RH Cluster Suite; Problems relating services/resources to NFS l_long_island Linux - Server 5 08-30-2008 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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