Automatic DHCP causing problems

Hi, I’m having a lot of fun using Haiku, but I cannot connect to the internet for more than 3 minutes. Basically, I configured the network preferences like this:

Adapter: /dev/net/atheroswifi/0
Mode: DHCP
IP address: 192.168.0.155
Netmask: 255.255.255.0
Gateway: 192.168.0.1
DNS #1: 192.168.0.1
DNS #2:
Domain: bla.bla.bla.bla.

Then used this command to connect to my router:

setwep /dev/net/atheroswifi/0 BJNC *******

And it worked perfectly! But after around 3 minutes or a couple network requests, the Domain is CHANGED from bla.bla.bla.bla. to hsd1.wa.comcast.net. This causes connections to time out. Now, I don’t know much about networking, but my Windows laptop uses hsd1.wa.comcast.net as a connection-specific DNS suffix. So, how do I keep the Domain from constantly being changed to hsd1.wa.comcast.net or how do I get hsd1.wa.comcast.net to become the connection-specific DNS suffix?

I think you should report it as a bug for DHCP, and help the devs with any question they have.

That way we’ll make Haiku a little bit better.

By definition, any hand-configured settings will be eventually overwritten as soon as DHCP client will receive the DHCP offer from your router.

As I suspect your router act as a DNS relay, it make sense that your default domain is changed to one belonging to your ISP.
From here, I’m not sure to understand why you want to force bla.bla.bla.bla to be your domain suffix? You can’t really enforce such thing.

Anyway, could you check for any DHCP messages in /var/log/syslog ?
Maybe the lease time is shorter than expected and we fail to renew it.
Could you also check on your router its DHCP config (lease time, etc) and in its logs for DHCP and wireless sessions, if any.

Also, please, file a bug ticket on our Trac bug manager, as not many developers monitor this forum.

[quote=phoudoin]
As I suspect your router act as a DNS relay, it make sense that your default domain is changed to one belonging to your ISP.[/quote]

It really doesn’t. It’s fine to support setting this via DHCP, but it doesn’t make sense to override manual settings with automatic ones. If the user doesn’t know the correct values, they’d leave them unset.

Of course you can, and would be able to in a good TCP/IP stack - this string is arbitrary, its only purpose is to be the default when you type an incompletely specified name, for example “computer” will be treated as “computer.bla.bla.bla.bla.”

It is not even uncommon to support several such defaults, with priority order, so that it would try e.g. “computer.myhomedomain.example.” and then “computer.business.network.example.com.”

Well after fooling around for a while, I discovered several things. Firstly, I put bla.bla.bla.bla. for the domain because I had to put something there, or else my router would get confused. Also, I checked my routers settings and my Haiku computer is registering, with a lease of around 15 hours or so. So, this morning, when the lease expired, I tried it and it worked with hsd1.wa.comcast.net. as the domain. Maybe Haiku was just getting confused as to the duration of the lease. Oh well, I guess this isn’t a very big deal because it just fixes itself later, cheers!

It’s not fine, it’s contrary to DHCP client expected behavior per RFC, which state clearly that when a DHCP offer don’t provide a parameter, some implementation default or user-defined value should be used, but when this parameter is part of the offer, this MUST be the value used by the client. Default domain provided in DHCP offer should override user-defined one.

Sure, and we already support that (switch to static IP configuration, and change it in /boot/common/settings/network/resolv.conf if you want to). But it’s not because you can that it make sense. I can set my hostname to “www” and my default domain name to “google.com”, but my FQN won’t be valid anytime soon.
If a DHCP server provides the wrong default domain name, it’s there that it should be reconfigured, not on (every!) DHCP clients he serves.

And if an ISP don’t provides a valid one, it’s time to switch to another ISP :wink:

Indeed, and now this is one missing feature we don’t support yet: we don’t parse DHCP search list option and, with multiple interfaces configured via DHCP, we don’t merge default domains from DHCP offers with the optional user-defined search list.

That a feature I plan to fix, BTW.

[quote=phoudoin]
It’s not fine, it’s contrary to DHCP client expected behavior per RFC, which state clearly that when a DHCP offer don’t provide a parameter, some implementation default or user-defined value should be used, but when this parameter is part of the offer, this MUST be the value used by the client. Default domain provided in DHCP offer should override user-defined one.[/quote]

That’s fully crazy, and nobody does that. To my reading RFC 2131 doesn’t even say they SHOULD, not least because clients are not even required to understand all the myriad possible DHCP configuration parameters (e.g. does Haiku implement the option of automatically assuming the local network MTU applies to subnets for IPv6?). DHCP manages just one finite resource, addresses, and DHCP implementations have to either accept an address lease or reject it, but they aren’t obliged to accept random other parameters provided by a possibly malconfigured device. They aren’t even required to have enough RAM to process those parameters and check they decode correctly.

[quote]
Sure, and we already support that (switch to static IP configuration, and change it in /boot/common/settings/network/resolv.conf if you want to). But it’s not because you can that it make sense. I can set my hostname to “www” and my default domain name to “google.com”, but my FQN won’t be valid anytime soon.
If a DHCP server provides the wrong default domain name, it’s there that it should be reconfigured, not on (every!) DHCP clients he serves.[/quote]

The domain name hierarchy does not parallel the address allocation hierarchy. So it does not always make sense for the DHCP server to know any of: the client’s FQDN, the preferred machine name, or the preferred DNS search path.

Although many ISPs provide default forward and reverse these days, I’m not sure it’s worth switching provider over such a thing. And who wants 4-5-2-9.dsl.myisp.example as a machine name? In my case I have a co-operative ISP who have configured their reverse (PTR) to match my (externally supplied) forward (A) for some addresses in my range. But not everyone can expect such service. So long as a matching forward and reverse actually exist (some services like IRC check), there’s no reason to use that unfriendly name if you have a nicer one.

[quote]
That a feature I plan to fix, BTW.[/quote]

While you’re there I suggest: Fixing the UI to not show options that will in fact be ignored or overriden; Improving labels and/or adding tooltips so that it’s obvious what they actually do (did this setting change the hostname? the FQDN? the machine name? the DNS search path? several or all of the above?); making it obvious if things can be ignored/ left blank; accepting or preferring modern configuration (address and network size rather than netmask, default to n+1 gateway using the network size); Your dual objectives should be to make easy things easy (most home PCs should set up in one click) and hard things possible (PCs on esoteric networks should be able to be configured, but it need not be so easy)

“Then used this command to connect to my router: setwep /dev/net/atheroswifi/0 BJNC *******”

Note sure if this is currently valid for configuring connectons, please see the 5th paragraph:

DHCP options are sent by server on client request. When a DHCP client request the #15 “Domain Name” option, the DHCP server, if it supports this parameter - and most does, MUST include it in his reply to client.

The client then SHOULD use it: see RCF 2132 (DHCP options RFC), $3.17: “This option specifies the domain name that client should use when resolving hostnames via the Domain Name System.”
Or face the consequence, like making FQN resolver work harder or possibly broken.

What is currently missing in our client implement is to support merging a user-defined list of domains with the default domain name or search list provided by DHCP server, if any.
When it will be the case, the user-defined values will be added on top to have an higher order. But meanwhile, I see no valid reason to not use the value of an option we ask for.

Dunno, and I’ve no IPv6 network yet to check that.

Fields that are filled from DHCP are already disabled when configuration mode is set to DHCP in Network preflet. Hidding them will make it harder to user to know which values are currently in use.

But I agree that we must add support to user-defined parameters for DNS servers, domains list and hostname, so it could be overriden or expanded by user.

Good suggestion, even if around me more people are still used to the old way for netmask.

Three things:

  1. There is no consequence, like I said, nobody does this (apart from Haiku for some crazy reason). Users who have a specific search path in mind will use it (and for them this Haiku behaviour is a serious misfeature), most don’t and will type full domain names or rely on Google search. The DHCP server’s response might be useful to set your own FQDN, but it equally might not, so best not to even ask for it.

  2. That’s quoting BOOTP documentation from RFC 1497. Although not from the dawn of the Internet, it is basically obsolete. Just because a BOOTP vendor option exists, does not mean your DHCP client should, let alone must, request it and then use it to override the user’s preferences. BOOTP’s designers assumed your client device doesn’t have configuration space for even a 4 byte IP address, let alone a DNS search path.

  3. Because it’s quoting another text, and that text doesn’t use the SHOULD / MAY / MUST convention, and also because the word is not capitalised, it does not have the force of the standards requirement capitalised SHOULD. It’s just a quote of some BOOTP text.

As we’ve seen in this thread, what you do now causes undue confusion. That’s more than enough reason.

The way you do it now causes confusion as we saw.