# binding NFS to a specific NIC [solved]

## smadasam

Following the gentoo NFS howto, I set up a working NFS server to export my /home direcotry, and I was wondering if there is a "good" way to bind NFS to a specific NIC instead of allowing access to all connections.  My configuration is like this:

I have a NFS server with 2 NICs.

NIC A is on network A, and

NIC B is on network B

The server does not route 

I want to export my filesystem to network B, but I don't want to allow access to network A at all.  So, that is the basis of my question.  Is there a good way to allow traffic to network B, and not A.  The best solution that I have read is to just use IPTables, but I am hopeing that there is a better solution like some configuration setting in NFS to say just use NIC B.

----------

## massimo

I thought this was done via /etc/exports where you can specify which nfs clients (host[s]|nets|subnets) are allowed to access the shared folders on the server. So you might allow the whole subnet at one NIC to access your shares.

Ciao,

----------

## Voorhees51

use /etc/exports to specify where you want to be able to share to.

 you could also look at  /etc/hosts.allow and /etc/hosts.deny for more options too

----------

## smadasam

I guess I was just trying to be too paranoid.  My exports file is set only for network B.  With a little bit more research, I have learned that even if a crafted packet was sent to NIC A to look like it was going to network B, most of the time, the NIC its self would drop the packet, and if it didn't, the kernel would.  So, really nothing else would need to be done, but I guess it is better to be paranoid than owned.  Thanks for the tips.

----------

