I know this but my question is can I define a host name AND IP Addresses in the netgroup? For example:
#netgroup file example linuxhosts (rhel1.corp.com,,) (rhel1-nfs.corp.com,,) (10.10.97.113,,) (10.10.97.114,,)
We have a requirement to create exports and grant access to 1) the server hostname on VLAN1, i.e. rhel1.corp.com 2) the NFS interface hostname on VLAN2, i.e., rhel1-nfs.corp.com 3) the IP address for each of these two hostnames, i.e., 10.10.97.113, 10.10.97.114
I'd prefer not to have to list the IP addresses in the export file if I can just put them in to the netgroup.
This thread is kind of old and marked as resolved, but this may help someone.
Something to try... (tested on 8.2.3p3 7-mode)
Add the ip addresses to your /etc/hosts file
# My Group 1
Use "HostGroup1" as the host in your NFS permissions, or your netgroup definition.
When a nfs host attaches, a reverse lookup via the order defined in nsswitch.conf is done. it will find the ip in the hosts file, and respond with the "HostGroup1" host name that matches your permissions directly or by netgroup it is listed in.