Manage NFS networking using the CLI
This page describes how to configure the NFS networking using the CLI.
Using the CLI, you can:
Configure the NFS export level (permissions)
Configure the NFS cluster level
Set the NFS configuration filesystem
NFSv4 requires a persistent cluster-wide configuration filesystem for the protocol's internal operations.
Use the following command line to set the NFS configuration on the configuration filesystem:
weka nfs global-config set --config-fs <config-fs>
Parameters
Name | Value |
---|---|
|
Create interface groups
Command: weka nfs interface-group add
Use the following command line to add an interface group:
weka nfs interface-group add <name> <type> [--subnet subnet] [--gateway gateway] [--allow-manage-gids allow-manage-gids]
The parameter allow-manage-gids
determines the type of NFS stack. The default value of this parameter is on
, which sets the NFS-W stack.
Do not mount the same filesystem by containers residing in interface groups with different values of the allow-manage-gids.
Example
weka nfs interface-group add nfsw NFS --subnet 255.255.255.0 --gateway 10.0.1.254
Parameters
Name | Value | Default |
---|---|---|
| Unique interface group name. | |
| Group type.
Can only be | |
| The valid subnet mask in the 255.255.0.0 format. |
|
| Gateway valid IP. |
|
| Allows the containers within this interface group to use With Legacy NFS: Each container can be set to be part of interface groups with the same value of |
|
Set interface group ports
Commands:
weka nfs interface-group port add
weka nfs interface-group port delete
Use the following command lines to add or delete an interface group port:
weka nfs interface-group port add <name> <container-id> <port>
weka nfs interface-group port delete <name> <container-id> <port>
Example
The following command line adds the interface enp2s0
on the Frontend container-id 3
to the interface group named nfsw
.
weka nfs interface-group port add nfsw 3 enp2s0
Parameters
Name | Value |
---|---|
| Interface group name. |
| Valid frontend container ID on which the port resides. You can obtain the container ID by running the |
| Valid port's device. Maximum 14 characters.
Example: |
Set interface group IPs
Commands:
weka nfs interface-group ip-range add
weka nfs interface-group ip-range delete
Use the following command lines to add/delete an interface group IP:
weka nfs interface-group ip-range add <name> <ips>
weka nfs interface-group ip-range delete <name> <ips>
Example
The following command line adds IPs in the range 10.0.1.101
to 10.0.1.118
to the interface group named nfsw
.
weka nfs interface-group ip-range add nfsw 10.0.1.101-118
Parameters
Name | Value |
---|---|
| Interface group name |
| Valid IP range |
Configure the service mountd port
The mountd service receives requests from clients to mount to the NFS server. In NFS-W, it is possible to set it explicitly rather than have it randomly selected on each server startup. This allows an easier setup of the firewalls to allow that port.
Use the following command lines to set and view the mountd configuration:
weka nfs global-config set --mountd-port <mountd-port>
weka nfs global-config show
Configure user groups resolution
NFS-W can authenticate more than 16 user groups, but it requires the external resolution of the user's groups, which means associating users with their respective group-IDs outside of the NFS protocol.
Configuring more than 16 user groups is not supported with the legacy NFS.
Procedure
Configure interface groups:
Ensure that the
allow-manage-gids
option is set toon
(default value). See Create interface groups.
Configure NFS client permissions:
Set the
manage-gids
option toon
for the NFS client to enable external group-IDs resolution. See Set the NFS client permissions.
Set up servers for group-IDs retrieval:
Configure relevant servers to retrieve user group-IDs information. This task is specific to NFS-W and does not involve WEKA management. See the following procedure.
Configure the NFS export level (permissions)
Define client access groups
Command: weka nfs client-group
Use the following command lines to add/delete a client access group:
weka nfs client-group add <name>
weka nfs client-group delete <name>
Parameters
Name | Value |
---|---|
| Valid group name. |
Manage client access groups' rules
Clients are part of groups when their IP address or DNS hostname match the rules of that group. Similar to IP routing rules, clients are matched to client groups according to the most specific matching rule.
Command: weka nfs rules
Add DNS-based client group rules
Use the following command lines to add a rule that causes a client to be part of a client group based on its DNS hostname:
weka nfs rules add dns <name> <dns>
Example
weka nfs rules add dns client-group1 hostname.example.com
Delete DNS-based client group rules
Use the following command lines to delete a rule that causes a client to be part of a client group based on its DNS hostname:
weka nfs rules delete dns <name> <dns>
Example
weka nfs rules delete dns client-group1 hostname.example.com
Parameters
Name | Value |
---|---|
| Valid client group name. |
| DNS rule with *?[] wildcard rules. |
Add IP-based client group rules
Command: weka nfs rules
Use the following command lines to add or delete a rule which causes a client to be part of a client group based on its IP and subnet mask (both CIDR and standard subnet mask formats are supported for enhanced flexibility):
weka nfs rules add ip <name> <ip>
Examples
weka nfs rules add ip client-group1 192.168.114.0/8
weka nfs rules add ip client-group2 172.16.0.0/255.255.0.0
Delete IP-based client group rules
weka nfs rules delete ip <name> <ip>
Examples
weka nfs rules delete ip client-group1 192.168.114.0/255.255.255.0
weka nfs rules delete ip client-group2 172.16.0.0/16
Parameters
Name | Value |
---|---|
| Valid client group name. |
| Valid IP address with subnet mask. Both CIDR and standard subnet mask formats are supported for enhanced flexibility. CIDR format: Standard format: |
Manage NFS client permissions
Command: weka nfs permission
Use the following command lines to add NFS permissions:
weka nfs permission add <filesystem> <group> [--path path] [--permission-type permission-type] [--squash squash] [--anon-uid anon-uid] [--anon-gid anon-gid] [--obs-direct obs-direct] [--manage-gids manage-gids] [--privileged-port privileged-port] [--supported-versions supported-versions]
Use the following command lines to update NFS permissions:
weka nfs permission update <filesystem> <group> [--path path] [--permission-type permission-type] [--squash squash] [--anon-uid anon-uid] [--anon-gid anon-gid] [--obs-direct obs-direct] [--manage-gids manage-gids] [--privileged-port privileged-port] [--supported-versions supported-versions]
Use the following command lines to delete NFS permissions:
weka nfs permission delete <filesystem> <group> [--path path]
Parameters
Name | Value | Default |
---|---|---|
| Existing filesystem name. A filesystem with Required Authentication set to ON cannot be used for NFS client permissions. | |
| Existing client group name. | |
| The root of the valid share path. | / |
| Permission type.
Possible values: |
|
| Squashing type.
Possible values: |
|
| Anonymous user ID.
Relevant only for root squashing.
Possible values: |
|
| Anonymous user group ID.
Relevant only for root squashing.
Possible values: |
|
| See Object-store Direct Mount.
Possible values: |
|
| Sets external group IDs resolution. The list of group IDs received from the client is replaced by a list determined by an appropriate lookup on the server.
This option is only applicable in NFS-W.
Possible values: |
|
| Sets the share only to be mounted via privileged ports (1-1024), usually allowed by the root user.
This option is only applicable in NFS-W.
Possible values: |
|
| A comma-separated list of supported NFS versions.
Possible values: |
|
Last updated