# Nmbd no route to host



## charles-martel (Sep 27, 2011)

Hi,

Sorry for my english.

When FreeBSD starts, samba starts, but windows client can't access the samba server and in nmbd log is this:


```
nmbd version 3.5.11 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2011/09/27 22:59:36.211057,  0] libsmb/nmblib.c:839(send_udp)
  Packet send failed to 192.168.1.255(137) ERRNO=No route to host
[2011/09/27 22:59:36.211221,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 192.168.1.255 port 137 failed
[2011/09/27 22:59:36.211251,  0] nmbd/nmbd_nameregister.c:521(register_name)
  register_name: Failed to send packet trying to register name BSD<20>
[2011/09/27 22:59:36.211298,  0] libsmb/nmblib.c:839(send_udp)
  Packet send failed to 192.168.1.255(137) ERRNO=No route to host
[2011/09/27 22:59:36.211366,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 192.168.1.255 port 137 failed
[2011/09/27 22:59:36.211393,  0] nmbd/nmbd_nameregister.c:521(register_name)
  register_name: Failed to send packet trying to register name BSD<03>
[2011/09/27 22:59:36.211433,  0] libsmb/nmblib.c:839(send_udp)
  Packet send failed to 192.168.1.255(137) ERRNO=No route to host
[2011/09/27 22:59:36.211500,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 192.168.1.255 port 137 failed
[2011/09/27 22:59:36.211526,  0] nmbd/nmbd_nameregister.c:521(register_name)
  register_name: Failed to send packet trying to register name BSD<00>
[2011/09/27 22:59:36.211595,  0] libsmb/nmblib.c:839(send_udp)
  Packet send failed to 192.168.1.255(137) ERRNO=No route to host
[2011/09/27 22:59:36.211662,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 192.168.1.255 port 137 failed
[2011/09/27 22:59:36.211689,  0] nmbd/nmbd_nameregister.c:521(register_name)
  register_name: Failed to send packet trying to register name WORKGROUP<00>
[2011/09/27 22:59:36.211730,  0] libsmb/nmblib.c:839(send_udp)
  Packet send failed to 192.168.1.255(137) ERRNO=No route to host
[2011/09/27 22:59:36.211796,  0] nmbd/nmbd_packets.c:158(send_netbios_packet)
  send_netbios_packet: send_packet() to IP 192.168.1.255 port 137 failed
[2011/09/27 22:59:36.211823,  0] nmbd/nmbd_nameregister.c:521(register_name)
  register_name: Failed to send packet trying to register name WORKGROUP<1e>
```

After restart of samba (*service samba restart*), log is clean and windows client can access the server.

My rc.conf:


```
keymap="fr.iso.acc"
sshd_enable="YES"

# -- sysinstall generated deltas -- # Mon Sep  5 17:57:52 2011
ifconfig_bge0="inet 192.168.1.110  netmask 255.255.255.0"
defaultrouter="192.168.1.1"
hostname="biche.home"

pf_enable="YES"
pf_rules="/root/pf.conf"
pflog_enable="YES"
ddclient_enable="YES"
apache22_enable="YES"
mysql_enable="YES"
samba_enable="YES"
```

I think the routing table is not properly initialized at startup but I do not understand why.


----------



## honk (Sep 27, 2011)

I would say that a restart of "samba" should not do anything related to the interface configuration. How does an `ifconfig -a` and a `netstat -rn` look like before your restart the samba service?

Also, have you tried to debug the rc scripts by adding the following parameter to rc.conf?


```
rc_debug="YES"
```


----------



## charles-martel (Sep 28, 2011)

I checked the interfaces and the routing table before restart samba, it is clean.

I tested 
	
	



```
rc_debug="YES"
```
 no problem, but samba works fine at startup (nmbd log is clean), then I put rc_debug to NO and samba does not work (nmbd log same as top). To make it work I must do: `service samba restart`

It's weird, I don't understand.


----------



## wblock@ (Sep 28, 2011)

Is a misconfigured Windows client statically taking 192.168.1.255?  Is the firewall blocking packets that really do need to go to the broadcast address?


----------



## charles-martel (Sep 28, 2011)

192.168.1.255 is don't take on network and I disabled firewall for test no change.


----------



## charles-martel (Sep 28, 2011)

At startup bge0 interface status: no carrier, after startup make ifconfig bge0 status: active, maybe is related ?


----------



## wblock@ (Sep 28, 2011)

charles-martel said:
			
		

> At startup bge0 interface status: no carrier, after startup make ifconfig bge0 status: active, maybe is related ?



Possibly.  PR conf/151063 could help if that's the problem.


----------



## charles-martel (Sep 28, 2011)

I tried with other network card no problem.
A broadcom driver (BCM5750A1) maybe bug ?


----------



## wblock@ (Sep 28, 2011)

charles-martel said:
			
		

> I tried with other network card no problem.
> A broadcom driver (BCM5750A1) maybe bug ?



Maybe not exactly a bug, some cards are just slow to come up.


----------



## charles-martel (Sep 28, 2011)

I'll test the script to wait the network, we will if it works.


----------



## Paul-LKW (Jul 13, 2013)

I just upgraded the system to 8.4 and the problem is exactly the same as in this post, the service is started but log.nmbd says no route to host, if I after the bootup and SSH to the box and make Samba restart all working fine, seems annoying as the LAN card is on board one. NTP also the same issue, LOG saying:

```
Jul 13 20:26:41 OFFICE ntpd_initres[677]: host name not found: 0.freebsd.pool.ntp.org
Jul 13 20:26:41 OFFICE ntpd_initres[677]: couldn't resolve `0.freebsd.pool.ntp.org', giving up on it
```


----------



## Paul-LKW (Jul 13, 2013)

Dear all:

I finally found out that the reason is because I disabled the IPv6 service in /etc/rc.conf which caused such issue.

```
ipv6_enable="YES" ==> ipv6_enable="NO"
```
or removing the entry directory would solve the problem.


----------



## Easter (Jun 18, 2017)

I had a similar problem and found this thread. I figured I would post here just in case anyone else has this problem and finds this post.

It was occurring for me because samba_server was trying to load before wpa_supplicant (I have a wifi connection only). I changed the following line in /usr/local/etc/rc.d/samba_server:

```
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv ntpd
```
changes to

```
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv ntpd wpa_supplicant
```


----------

