# Routing and Workgroups



## amtrakuk (Oct 24, 2014)

I hold my hand up - I'll tell you why,

I have been using my _Free_BSD 10 box running Samba and FTP services for months with no problem. I was thinking of swapping over to a NAS box for power saving measures but ever since putting a NAS box on the network the Samba server has done a disappearing act and doesn't show up when browsing the "workgroup".

The NAS and the _Free_BSD box do have sep*a*rate IP addresses and names.

I had the _Free_BSD box set for a static IP manually entered in rc.conf but found that didn't match the one reserved on the router but as the _Free_BSD box wasn't using DHCP I guessed that didn't matter.

Now when I have set[]up the LAN card for "DHCP" in rc.conf it*'*s now getting the correct IP by checking `ifconfig` but something odd is happening. I am able to `ping` IP addresses but hosts like www.bbc.co.uk or update.freebsd.org can't be resolved.

I tried changing the _IP_ from 127.0.0.1 in /etc/resolv.conf to match the router*'*s internal IP with no luck and I understand if the LAN card is set to "DHCP" (which I did last night before going to bed) in rc.conf the defaultrouter option doesn't need to be entered.

Where should I be looking to fix the resolution issue? The _Free_BSD box is on a home workgroup NOT a domain and is pingable by IP from workgroup computers as well as SMB shares can be mounted with smb:\\x.x.x.x.

I'm hoping the IP issue when resolved will encourage it to broadcast itself on the workgroup as it was before.


----------



## SirDice (Oct 24, 2014)

The resolv.conf should be overwritten with information obtained by DHCP. If you can't resolve anything and the DNS servers are incorrect you should have a look at your DHCP server; it's not supplying the correct DNS settings.


----------



## amtrakuk (Oct 24, 2014)

I may have found the problem. The netmask is corrupt. It*'*s showing;


```
root@Leopard:/etc # ifconfig
stge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
    ether 00:06:4f:7f:b7:50
    inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
    inet 127.0.0.1 netmask 0xff000000
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

It _should_ be DHCP. Why it*'*s got 0xffffff00 as the netmask I don*'*t know, but it has the UP and gateway IP ok. Any ideas?


----------



## usdmatt (Oct 24, 2014)

The netmask is fine. 0xffffff00 is the hex for 255.255.255.0, which is most likely the correct mask for your network. It will not say DHCP anyway in `ifconfig` output. `ifconfig` just shows the actual configuration, it doesn't care whether it was set manually or via DHCP.

As mentioned, when configuration is set via DHCP, the DHCP client should update /etc/resolv.conf automatically. What does the contents of this file look like after DHCP has started?


----------

