Score:1

NFS multiples NIC

in flag

I have install nfs server into Ubuntu Hirsute, using two NIC, like that:

/nfs    172.16.0.0/24(fsid=0,rw,insecure,sync,wdelay,no_subtree_check,no_root_squash)
/nfs    172.18.0.0/24(fsid=0,rw,insecure,sync,wdelay,no_subtree_check,no_root_squash)
/nfs/share1 172.16.0.0/24(rw,insecure,sync,wdelay,no_subtree_check,no_root_squash)
/nfs/share1 172.18.0.0/24(rw,insecure,sync,wdelay,no_subtree_check,no_root_squash)

In the client side, I have mounted the share like this:

mount -t nfs4 172.16.0.100:/nfs /mnt/ -o async,auto,exec,_netdev,nodev,rw,retry=5,rsize=32768,wsize=32768,proto=tcp,hard,intr
mount -t nfs4 172.18.0.100:/nfs /mnt/ -o async,auto,exec,_netdev,nodev,rw,retry=5,rsize=32768,wsize=32768,proto=tcp,hard,intr

As you can see I have mounted twice in the same directory. i.e, /nfs

When I put down the NIC which holds the 172.16.0.100 address, in the client side I still can ls into the /nfs directory. So I check that work with the second interface online and the first offline. Then I brought the first interface on line again. However, when I put down the NIC which holds the 172.18.0.100 address, in the client side the mounted nfs share hangs, and I no longer can access the /nfs directory.

What I doing wrong here??

Thanks for any tips.

Score:1
de flag

With mounting as in your example

mount -t nfs4 172.16.0.100:/nfs /mnt/ ...
mount -t nfs4 172.18.0.100:/nfs /mnt/ ...

you mount server 172.18.0.100 on top of 172.16.0.100. NOTE: This is not using both NICs, this is mounting two different servers into a single directory. The last mount wins, e.g. visible. Thus by switching off 172.16.0.100 nothing happens, as it not used anyway.

As linux mount command (and NFS client) doesn't supports multiple servers, you should use NIC bonding if you want redundancy of aggregated bandwidth.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.