Dingo Network AutoDHCP function impacts network management

Please post any bugs you have found
Message
Author
User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

Dingo Network AutoDHCP function impacts network management

#1 Post by rerwin »

NOTICE: Please download the localized version later in this thread, for use with Puppy 4 alpha 5. But the version in this post is still good, too.

Dingo 4a4 contains dhcpcd 3.1.8, which defaults to using a new (IPv6-specification) client ID format that some router firmware does not support. Those routers expect the client ID to be the MAC address of a PC's network interface adapter and permit control of connectees by those addresses. An option that allows Puppy to use either the old or new defaults would remedy that problem, while letting Puppy keep up with new versions of dhcpcd.

The new default format appears to be intended to simplify network maintenance by identifying a workstation (PC) by software installation, wherein all interfaces (wired, wireless, USB) have the same client ID, so the administartor sets up filters (or whatever they use) for the PC and not separately for each network interface. The assumption, probably, is that a PC will contain only one software system, so a client ID represents an OS and the computer containing it.

But in the Puppy Linux world it is common for several instances of Puppy to reside in the same machine; each pup-save file or partition constitutes a separate system, each with its own client ID and IP address (under Puppy 4.x). Instead of identifying itself, by interface, as 1-to-3 entities (client IDs), a PC hosting, say, ten Puppys would have ten client IDs for one PC, complicating LAN management rather than simplifying it! Each live-CD boot creates a new client ID (and IP address); saving to a pup_save file/partition creates a second ID upon first reboot with the pup_save. This profusion and discarding of so many client IDs/IP addresses could be eliminated if the network wizard would manage the client IDs so that all Puppys within a partition would use the same ID.

The new client ID format makes possible some benefits mainly for large network installations. Identifying a PC as a single entity is one; another is that changing out NIC hardware does not impact the client ID (where previously the changeout would also change the client ID (MAC address), necessitating an administrative chore. Since there may be Puppy users interested in these capabilities, and since other OSes cohabiting with Puppy might adopt the new format, it is reasonable to adapt Puppy to accommodate it with minimal disruption to LAN management.

I have worked up a solution to these issues and offer it for evalutaion and consideration for integration into Puppy. With it, the main network-wizard window contains a checkbox that enables use of the new format; unchecked, the old MAC-address format is retained. When checked, the basis for a single client ID ("duid") is retained at the root of a partition and is used for all DHCP requests for all Puppys in that partition, on all interfaces. This assumes that only one Puppy at a time is ever active in that partition.

Attached are the changed scripts (/usr/sbin/net-setup.sh & /etc/rc.d/rc.network) and highlighted (4alpha 394) listings of them showing the modifications. They are NOT compatible with pre-3.0 versions of dhcpcd, found in most pre-4.0 Puppys; I have tested with the dhcpcd 3.1.8 in Puppy 4 alpha4 (394).
EDIT: Refined version uploaded on 1/4/08.
EDIT: Armor-plated version uploaded on 1/5/08 (10 p.m. EST). Backward compatible with old dhcpcd 1.3.22.
EDIT: Uploaded updated rc.network on 1/9/08 (10:45 p.m. EST); net-setup.sh unchanged.
EDIT 1/11/08: Now that localization improvement has been merged with this fix, Please download the archive from the post near the end of this thread, for use with Puppy 4 alpha5.

Richard
Attachments
net_wiz_clientid_fix.tar.gz
Scripts & listings of network wizard and bootup scripts, to accommodate both IPv6 and IPv4 client ID formats.
(65.18 KiB) Downloaded 1101 times
Last edited by rerwin on Fri 11 Jan 2008, 15:04, edited 5 times in total.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

Richard,
In the 'config.h' file in the dhcpcd source, it has this:

/* We will auto create a DUID_LLT file if it doesn't exist.
* You can always create your own DUID file that just contains the
* hex string that represents the DUID.
* See RFC 3315 for details on this. */
#define ENABLE_DUID

I left that line in, but how would it affect things if the line was commented out? Would that improve the situation? How would commenting it out affect your mods?
[url]https://bkhome.org/news/[/url]

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#3 Post by rerwin »

Barry,
Thanks for getting back to me so soon. I assume that commenting out the #define statement would omit the duid/IPv6-compatibility logic entirely, with the same effect as adding the "-I ''" parameter for the current version of dhcpcd. But the omiision would prevent anyone from interfacing correctly with the modern DHCP servers. Although I have been encouraging you (and Dougal) to remain with the old, MAC-address client ID, I recognize that we should eventually step up to the "state of the art" if we are going to use the latest versions of dhcpcd. (I base my position on tempestuous' findings at http://www.murga-linux.com/puppy/viewto ... 141#143233, and the link he provides.)

I favor making Puppy as compatible with the world as we can, which means making it IPv6-compatible. Instead of attempting to hold back progress, I found a way to "modernize" Puppy without impacting the older networking equipment that frugal Puppians probably use.

To answer your question directly -- the impact of removing the new compatibility in dhcpcd -- my mods would be completely unnecessary. If my mods were put in for future activation of compatibilty, we would need to make sure that dhcpcd could still handle the "-I ''" parameter correctly (as dhcpcd 1.3.22 does NOT). We would also need to address the new checkbox, which would become ineffective. Should it be removed? Or be made to reject being checked? Maybe it would (or could be made to) function the same no matter what the checkbox contains.

So, now that I have "bought into" the new compatibility, I think the better route is to make Puppy future-compliant.

(BTW, I have uploaded a refined version of the mods.)
Richard

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#4 Post by BarryK »

Okay, I'll "bite the bullet" then. I've downloaded your mods and put it into the to-do-soon list.
[url]https://bkhome.org/news/[/url]

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#5 Post by rerwin »

Barry,
Thanks for accepting this fix. Before you work on it, please check my initial post for an updated version. I just uploaded a more robust package that also works with the old version of dhcpcd; it does not support the duid for the older version (of course), just ignores and clears the checkbox setting. However, although it can handle the presence of both the /etc/dhcpc and /var/lib/dhcpcd directories, the upgrade process should probably remove /etc/dhcpc so that the wizard produces the expected result when the box is not checked.
EDIT: To clarify the extent of backward compatability, the fix works with dhcpcd versions 3.1.8 and 1.3.22, which are in Puppy 4.x and 3.x, respectively. The wizard itself does not start at all in Puppy 2.x and 3.01-Retro -- it must be a kernel thing.

Now, if you change the checkbox value after setting up the interfaces, nothing changes until either a reconfigure of the interfaces or a reboot -- the reboot sets all interfaces the same way (DUID or MAC), per the setting in the checkbox.

BTW, I would like to test the case where the eth0mode file s set to "auto"; but I do not see where that is done. Is that obsolete or is it set externally to the wizard? I could create it manually, but I would like to know how it is actually used.

EDIT: for those who know what it means, the fix allows Puppy to identify itself to the network with an IPv6-compliant client ID.
Richard

User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#6 Post by Dougal »

Rerwin, there's something I was wondering about in relation to IPv6:
rc.sysinit has a part where some number is echoed into a file in /proc/sys/net/ip4 or something.
Will something have to be added for IPv6, too?
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

rc.sysinit IPv4 question

#7 Post by rerwin »

Dougal,
The comment before the second rc.sysinit instance of writing "1" into the file in directory ipv4 implies that it relates to dialup, but there is nothing about why it is done. I have no insight into it. I do see in Puppy4 that there is no counterpart directory ipv6. That area goes beyond where I was working. So far, I have not tried puppy4 with a modem; a4 does not recognize my Intel 835ep chip. But I have other modems to try.

In reality, I do not know whether the promised capability to associate multiple intefaces with the same PC actually works. That is the dhcpcd developer's responsibility. I just added the option to use either type of client ID and to propagate the duid across multiple instances of Puppy.
Richard

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#8 Post by MU »

I localized the network-wizard, see:

http://puppylinux.com/blog/?p=112#comment-569

Mark

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#9 Post by BarryK »

MU, yes, the latest version of the network wizard is that posted by rerwin. This was prior to your localisation-finished announcement ...would it be possible to synchronise these two? Actually, rerwin has very clearly indicated in net_setup.sh where he has made the changes.
[url]https://bkhome.org/news/[/url]

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

Updated rc.network (only)

#10 Post by rerwin »

Barry, Mark,
I have just now uploaded the archive with an updated version of rc.network. I have not changed net-setup.sh, as I know MU may be integrating it with his localization code.

I became concerned about the possibility of ending up with the same DUID in multiple PCs, due to using Puppy on portable media. We should not propagate a common DUID beyond a partition, into other PCs. But a portable Puppy could have its unique DUID, as long as it is different from any on a PC.

I coded for that (and tested on a hard drive), but have not tried the fix with installs to flash drives or multisession CDs. I understand that alpha4 has problems with some of those options, so I will wait for alpha5, to do the "fine tuning". The default, older (MAC address) client ID can be used in those cases, until we work out a process for the new IDs.

A write-up will probably be appropriate, to set guidelines for client IDs and portable media. (I can do that.)

BTW, in the listing for net-setup.sh I highlighted lines 961 & 962 in red. They can be deleted, as their function is now done in rc.network. Feel free to remove them while integrating the scripts into Puppy. The lines to remove are:

Code: Select all

   (961)  [ ! -d /var/lib/dhcpcd ] && mkdir /var/lib/dhcpcd
   (962)  [ -s /root/.dhcpcd.duid ] && cp /root/.dhcpcd.duid /var/lib/dhcpcd/dhcpcd.duid
Richard

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#11 Post by MU »

In my update line 60 the german and english variables were mixed:
"NOINTERFACES"=

The german was in the english mo and vice versa.
I updated the archive.
But my archive still contains the old version.
PLEASE use this bugfixed version as a base for further changes.
It is easier for people who write patches to integrate them in the localized script, than the other way round.


If you need translations, I can provide them of course.
I just have seen the last messages now, so it is very likely I will oversee further addons. I just saw them because I wanted to announce my "bugfix".
So I prefer not to be involved in the development of this script.

The way I added the localization also allows you to ignore translations.
Put strings in a new variable, and add it in the english .mo.
Then that english text will be used also in the german one, until someone adds the translation to the german .mo.

The english file is loaded first, then the one from the country-settings, which then will replace variables that are translated.
Non-translated variables will be displayed in english.

Like this you can code without having to care for the translations themselves.

Mark

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

Merged net-setup.sh for alpha5

#12 Post by rerwin »

Mark,
Here is the merged set-setup I promised. My code includes a label in line 244 that probably needs translation:

Code: Select all

<label>Identify all interfaces to the network as representing the same computer.</label>
Richard
Attachments
net_wiz_clientid_fix+localization.tar.gz
Candidate for alpha5 if fix 3.95 gets added and a localization instance gets added.
Contains net-setup.sh and corresponding rc.network scripts.
(82.96 KiB) Downloaded 1037 times
Last edited by rerwin on Sat 12 Jan 2008, 17:36, edited 1 time in total.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#13 Post by MU »

Great!
Here is the translation:

Code: Select all

<label>Identify all interfaces to the network as representing the same computer.</label>

Code: Select all

<label>Alle Interfaces dem Netzwerk gegenüber als denselben Computer darstellen.</label>
Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#14 Post by MU »

added the localization, archive attached.
It also includes the .mo files.
Mark
Attachments
net_wiz_clientid_fix+localization2.tar.gz
(67.39 KiB) Downloaded 995 times

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

Merged version tests successfully!

#15 Post by rerwin »

Mark,
I have tested your uploaded archive and all runs as it did with my fix alone. I do not know how to test localization.

I am concerned that the translation of my new label is 6 characters longer than the original, and that it will exceed the space for the label. Can you test this by starting the network wizard and checking the appearance of the checkbox text. Maybe we need space for a second line. Easy to fix, I think.
Richard
Last edited by rerwin on Sat 12 Jan 2008, 17:34, edited 1 time in total.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#16 Post by MU »

test like this (type in a consolewindow):
export LANG=de_DE
net-setup.sh

But it looks good here :)
Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#17 Post by MU »

I attach a screenshot.
Attachments
netsetupgerman.jpg
(57.86 KiB) Downloaded 395 times

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#18 Post by MU »

there was another wrong entry around line 61 in the .mo files.
I had to split the variable SAVESELECTION now into SAVESELECTION1 and SAVESELECTION2.
In net-setup.sh this is line 417

Code: Select all

<label>\"$SAVESELECTION1$NEWLOADf1$SAVESELECTION2\"</label>
Without this change, $NEWLOADf1 was not shown.

I attach the modified archive including everything.
Mark
Attachments
net_wiz_clientid_fix+localization3.tar.gz
(67.43 KiB) Downloaded 438 times

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#19 Post by MU »

I got this pm from rerwin:
rc.network same as in alpha5, so not needed in archive
Mark,
Thanks for keeping the forum thread current.

The subject says it all. Since rc.network is already in alpha5, it should be removed from your archive so that I can make changes to it without impacting you or risking confusion later.
My main concern is that it not be submitted to Barry with net-setup.sh, because I may submit a change to rc.network myself for the next release.
But you might just upload localization3 again without rc.network and the /etc directory. Maybe also ensure that the description mentions it is for alpha5 only.
Richard
Ok, I attach an archive with only net-setup.sh , and the 2 .mo files.

hm.. what happens if you run it in Puppy 3?
i just added it to my next servicepack.
My Ethernetcard (PCMCIA) was not detected, but could be loaded from the list.
Should I not use this wizard in Puppy 3?
Would the former version work?

Mark
Attachments
net_wiz_clientid_fix+localization4.tar.gz
(17.6 KiB) Downloaded 408 times

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

Localized network wizard and Puppy 3

#20 Post by rerwin »

I did code the fix to function with the old version of dhcpcd, which is used in Puppy3. I tested it successfully, but I think I included the rc.netwok script, as well. But I believe the wizard should work in P3 without the updated rc.network script. It does not support the new client ID selected with the checkbox, so the check will always get cleared.

I have now tested the localization4 archive on my puppy 3.01 system and it works perfectly! Just as I intended.
Richard

Post Reply