DHCP works, static IP doesn't

Status
Not open for further replies.

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
I must be missing something here: Lately I changed my network setup from DHCP to a static IP. This worked, however I noticed that the server did not send emails anymore and was stuck while checking for updates. Reason was that there was no nameserver configured. However the nameserver was configured in the general network setup just fine ...

So I configured DHCP again, everything is back to normal.

How can I setup the server to a static IP including configuration of a nameserver?
 
Joined
Dec 2, 2015
Messages
730
I looked at my network setup, using static IPs with FreeNAS-9.10-STABLE-201604181743. Network -> Global Configuration shows three Nameservers, all IPV4. But, if I look at Network -> Network Summary, the only nameserver listed is IPV6. If I look in /etc/resolv.conf, the name server entry is IPV6, with no IPV4 nameservers listed. My system works like this. Emails get sent, updates work, etc.

Do you have "Auto configure IPV6" selected in Network -> Interfaces? If not, try selecting it.
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
In /var/log/messages i found this, but this is not explaining the reason of course:

Code:
Apr 21 07:36:31 unger manage.py: [freenasOS.Configuration:623] Unable to load http://update.freenas.org/FreeNAS/trains.txt: <urlopen error [Errno 8] hostname nor servname provided, or not known>
Apr 21 07:36:31 unger manage.py: [freenasOS.Configuration:623] Unable to load http://update-master.freenas.org/FreeNAS/trains.txt: <urlopen error [Errno 8] hostname nor servname provided, or not known>
Apr 21 07:36:31 unger manage.py: [freenasOS.Configuration:637] Unable to load ['http://update.freenas.org/FreeNAS/trains.txt', 'http://update-master.freenas.org/FreeNAS/trains.txt']: <urlopen error [Errno 8]


But I don't exactly remember when I configured for static IP and where to look and for what.

Would it help if I configured my server to static IP, make a reboot and post the log here?

Do you have "Auto configure IPV6" selected in Network -> Interfaces? If not, try selecting it.

Actually I do. However I have no IPv6 connectivity into the internet. Kevin, from your post I take that you have IPv6 connectivity into the internet? This looks like a relevant difference between your setup and mine.

Maybe FreeNAS only considers IPv6 for nameservers if IPv6 is configured activated and ignores any configured IPv4 nameserver entries? This would explain my problem.
 
Joined
Dec 2, 2015
Messages
730
Actually I do. However I have no IPv6 connectivity into the internet. Kevin, from your post I take that you have IPv6 connectivity into the internet? This looks like a relevant difference between your setup and mine.
According to test-ipv6.com, I can reach a DNS server using IPV6, but I cannot reach IPV6-only web sites. But DNS seems to be the issue here, so perhaps that is good enough for FreeNAS's purposes.

What do you have in /etc/resolv.conf? If there is no IPV4 nameserver, perhaps you should edit it to add one.
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
This is in resolv.conf when configuring for static IP:

Code:
[root@unger] /var/log# less /etc/resolv.conf
# Generated by resolvconf
search localdomain

/etc/resolv.conf (END)


There is not even an IPv6 nameserver. There is no way how there could be one of course:

network_summary.png

When configured for static IP but 'Auto configure IPV6' not set, then there is a nameserver entry:

network_summary_2.png

Is this a bug?

I keep the DHCP setting because I want the IPv6 active. This increases reliability of network browsing from my Mac.

-fun-
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
Addition: I assume editing the /etc/resolv.conf is not the best idea. This might work, but the file seems to be (re)generated on configuration changes. This would make keeping the file up to date a bit difficult.
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
Addition 2:

That's interesting. Anything in /var/log/messages?

I can provide complete logs now. I have done a change to static IP configuration and rebooted and know now where this is in the log. I assume the problem is clear without, but if it helps I can share this of course.
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
Here it is. The strange order of entries is as in the original logfile (see time stamps ...)

-flo-
 

Attachments

  • extract.txt
    53.7 KB · Views: 594

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
I didn't work on this any further, so no progress.

Situation: As far as I understand when FreeNAS is using DHCP for IPv4 AND is using IPv6 THEN only IPv6 name servers will be used. IPv4 name servers configured in FreeNAS as well as those communication via DHCP are ignored. If there is no IPv6 name server available the system will not have any name server available. This results in the loss of connectivity in all cases where FreeNAS is required to resolve DNS names.

The problem exists regardless of whether FreeNAS assigns a link local address (IPv6 autoconfigure turned on, no router advertisements found) or whether FreeNAS has a routable IPv6 address. (It is unclear from Kevins post above whether he has a DHCPv6 server assigning a complete IPv6 address to his FreeNAS box or whether his router is delegating a prefix.)

Of course expected behavior is that any IPv4 name servers communicated by DHCP are available in addition to any IPv6 name server and are used whenever FreeNAS "speaks" IPv4. Using them as fallback in IPv6 is not possible but this is not a problem: When a routable IPv6 address is available then an IPv6 name server will typically also be available anyway.
 
D

dlavigne

Guest
As far as I understand when FreeNAS is using DHCP for IPv4 AND is using IPv6 THEN only IPv6 name servers will be used. IPv4 name servers configured in FreeNAS as well as those communication via DHCP are ignored. If there is no IPv6 name server available the system will not have any name server available.

This is the default FreeBSD behavior (it always prefers IPv6 if configured). However, you can create a tunable to change that:

Name: ip6addrctl_enable
Value: AUTO
Type: rc.conf

Alternately, if you want to always use IPv4 for DNS, use ipv4_prefer for the value. Otherwise, if it sees IPv6, AUTO will try to use it. See https://www.freebsd.org/cgi/man.cgi?query=rc.conf for more information about ip6addrctl.
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
Ah, thanks for this information!! So this is not a bug. I'll check this in the next few days.

I'm not running FreeBSD anywhere except as the base OS for FreeNAS and pfSense. So I'm not fluent with the FreeBSD insides. :smile:
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
I looked this up. Just for the records I consider worth mentioning: ip6addrctl_enable is a boolean value. A value as ipv4_prefer should go into another variable ip6addrctl_policy.

From the man page:

The table can be speci-
fied in another variable ip6addrctl_policy. For
ip6addrctl_policy the following keywords can be specified:
``ipv4_prefer'', ``ipv6_prefer'', or ``AUTO''.

(I still have to test this though ...)
 
Status
Not open for further replies.
Top