# NFS and default router



## vbelousov (May 3, 2010)

Hello,

I have a single installation of FreeBSD (9.0  Current) which is basically SAN/NAS. It's dispencing SMB and NFS over home network and doing some other network services such HAVP, DNS, VoIP BPX and others. Everything works fine and all okay until my uplink going down. And then NFS stop working at all. I don't know how this service related to Internet uplink while I using NFS at home only... And as soon as I do remove default route all starting to working fine even with no uplink at all.

Any ideas where is the problem?


----------



## SirDice (May 3, 2010)

Please tell how your network is set up. We have no idea what your network looks like and thus cannot solve any routing problems.


----------



## DutchDaemon (May 3, 2010)

Are you sure your Samba/NFS services are bound to the internal interface only?


----------



## vbelousov (May 3, 2010)

SirDice said:
			
		

> Please tell how your network is set up. We have no idea what your network looks like and thus cannot solve any routing problems.



This is topology of my home network.







Feel free to ask additional questions if you will need to clarify other aspects.


----------



## vbelousov (May 3, 2010)

DutchDaemon said:
			
		

> Are you sure your Samba/NFS services are bound to the internal interface only?



Actually I didn't bound any interfaces to NFS. I don't even know how it is possible. Would you please be so kind to give me an advise where I can check it?

I'm sure about SMB. There is commented row in smb.conf and instead of NFS - SMB has no problem with availability in same conditions. So it works fine.


----------



## SirDice (May 3, 2010)

Nice drawing  

But it doesn't tell us what network segments and addresses you have.


----------



## vbelousov (May 3, 2010)

Thanks. Would rc.conf parts be helpful for you?


```
###
###     Network
###
defaultrouter="192.168.10.1"
hostname="nasbox.tpaktop.com"
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_igb0="up"
ifconfig_igb1="up"
ifconfig_bge0="up"
cloned_interfaces="lagg0 vlan10 vlan30 vlan40 vlan1001"
ifconfig_lagg0="laggproto failover laggport em0 laggport em1 laggport igb0 laggp                               ort igb1 laggport bge0"
ifconfig_vlan10="inet 192.168.10.10/24 vlan 10 vlandev lagg0"
ifconfig_vlan30="inet 192.168.30.10/24 vlan 30 vlandev lagg0"
ifconfig_vlan40="inet 192.168.40.10/24 vlan 40 vlandev lagg0"
ifconfig_vlan50="inet 192.168.50.10/24 vlan 50 vlandev lagg0"
ifconfig_vlan1001="inet 192.168.20.10/24 vlan 1001 vlandev lagg0"

###
###     NFS Server
###
rpcbind_enable="YES"
nfs_server_enable="YES"
nfsd_flags="-u -t -n 20"
mountd_enable="YES"
mountd_flags="-r"
```

Shall I post here switch or router configs or partiqular parts of configs? If so please tell me what is needed.


----------



## DutchDaemon (May 3, 2010)

nfsd(8)


```
-h bindip
             Specifies which IP address or hostname to bind to on the local
             host.  This option is recommended when a host has multiple inter-
             faces.  Multiple -h options may be specified.
```

These should be set in /etc/rc.conf. The defaults (in /etc/defaults/rc.conf) are nfs_server_flags="-u -t -n 4", so I guess you could tack a -h flag onto that. P.S. I see you already have flags set, so add -h to bind nfsd to one interface only. Not sure if that solves any problems, but keeping services bound to the interfaces that need them is always a good idea.


----------



## SirDice (May 3, 2010)

What address does the machine have which cannot access NFS when your uplink is down?

Directly connected networks do not need a default gateway. So unless your network isn't set up properly it should work regardless of the state of your uplink.


----------



## vbelousov (May 3, 2010)

Yes, it helped. Now it works fine even when router switched off. You was right for one hundred percents. 

I belive that problem was strightly here:



> -a      Specifies that nfsd should bind to the wildcard IP address.  This
> is the default if no -h options are given.  It may also be speci-
> fied in addition to any -h options given.	*Note that NFS/UDP does
> not operate properly when bound to the wildcard IP address
> whether you use -a or do not use -h.*


----------

