dhclient dirty trick

Found a bug in Parted Magic?

Moderators: Patrick Verner, Icecube

dhclient dirty trick

Postby n8bounds » Fri Aug 28, 2009 6:14 pm



This is bad form, Sir...

Code: Select all
send host-name "andare.fugue.com";
send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
send dhcp-lease-time 3600;
supersede domain-name "fugue.com home.vix.com";
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
   domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;
timeout 60;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;
script "/etc/dhclient-script";
media "-link0 -link1 -link2", "link0 link1";
reject 192.33.137.209;

alias {
  interface "ep0";
  fixed-address 192.5.5.213;
  option subnet-mask 255.255.255.255;
}

lease {
  interface "ep0";
  fixed-address 192.33.137.200;
  medium "link0 link1";
  option host-name "andare.swiftmedia.com";
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.33.137.255;
  option routers 192.33.137.250;
  option domain-name-servers 127.0.0.1;
  renew 2 2000/1/12 00:00:01;
  rebind 2 2000/1/12 00:00:01;
  expire 2 2000/1/12 00:00:01;
}


User avatar
n8bounds
 
Posts: 11
Joined: Tue Feb 03, 2009 3:59 pm
Location: North Carolina, USA

Re: dhclient dirty trick

Postby n8bounds » Fri Aug 28, 2009 7:12 pm

Just in case the developers don't delete my post out of anger, here is my little script to "fix" this "bug":

Code: Select all
#!/bin/bash
mv /etc/dhclient.conf /etc/dhclient.conf-old

cat >> /etc/dhclient.conf << "EOF"
request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;
timeout 60;
retry 60;
select-timeout 5;
initial-interval 2;
script /etc/dhclient-script;
media -link0 -link1 -link2, link0 link1;
EOF

ifconfig eth0 up
udhcpc -n


Use this guide to apply it to your setup: http://partedmagic.com/documentation/125-pxe.html
User avatar
n8bounds
 
Posts: 11
Joined: Tue Feb 03, 2009 3:59 pm
Location: North Carolina, USA

Re: dhclient dirty trick

Postby Patrick Verner » Fri Aug 28, 2009 9:10 pm

If you download the source package for dhcp-3.1.2p1, that is the exact example config files that comes with it. Go ahead and look.

http://ftp.isc.org/isc/dhcp/dhcp-3.1.2p1.tar.gz

/dhcp-3.1.2p1/client/dhclient.conf

I'm sorry, was I supposed to use the one from Ubuntu or something?

What the heck is going on? First I'm racist because I won't include mplayer and now the example config files that come with dhcp-3.1.2p1 are a "dirty trick".

Can you please explain why this is a "dirty trick"? What was I supposed to be attempting to do? Seriously. Was I out to get you? booga booga booga
Last test version of Parted Magic: http://beefdrapes.partedmagic.com
User avatar
Patrick Verner
Site Admin
 
Posts: 880
Joined: Wed Nov 19, 2008 2:27 am
Location: Kaukauna, Wisconsin

Re: dhclient dirty trick

Postby n8bounds » Sun Aug 30, 2009 7:43 pm

My apologies for being unclear.

The default configuration file from ISC exactly the same as the one from Pmagic, as you mentioned. It pre-pends domain name servers and supersedes domain search parameters used in /etc/resolv.conf later, presumably as an example of how to do so. This configuration is, while educational, not optimal for the use cases of the Pmagic distro or particularly "nice" to your users, especially as it pre-pends loopback as a name server when there is certainly none listening there. Your version of this configuration file, while verbatim of the example of ISC, does little for your users. In either case, you appear never to use it, so it doesn't really matter how it reads. I apologise for pointing it out without noticing it was the example file from ISC's site and that you never really call dhclient anyway.

I mistakenly thought it was with that configuration file that you were "tweaking" the network of Pmagic. It is, however, that by running /usr/bin/pmagic_net, Pmagic users result with a primary nameserver of 203.8.183.1 as it is pre-pended to the list of name servers offered to the dhcp client of Pmagic by the dhcp server.

I noticed in the first place because the dhclient script appears to not work. I went looking for your supported method, and found the sh script /usr/bin/pmagic_net, which, among other things calls udhcpc instead of dhclient. No big deal, and I can see why, as this is a very "light" distro. After finding /usr/bin/pmagic_net, I was further frustrated to find that DNS lookups continued to fail in spite of an apparently successful DHCP lease negotiation. At this point checking the /etc/resolv.conf,revealed the foreign, pre-pended name server of 203.8.183.1. (You do this in line 111/143 of /usr/bin/pmagic_net, with no explanation or comment.) DNS lookups were failing, for me, because I allow DNS lookups to be performed solely by my own name server, via my firewall rules.

The funny thing about 203.8.183.1 is that there is a PTR of yalumba.connect.com.au. for 1.183.8.203.in-addr.arpa. 203.8.183.1 appears to belong to a large netblock running from 203.8.176.0 - 203.8.183.255. Connect.com.au. appears to be an Australian ISP, owned by some company known as AAPT Limited, or somesuch. http://www.search.asic.gov.au/cgi-bin/g ... &srchsrc=1 I have failed to locate the association with Australia and Parted Magic, particularly since you hail from Kaukauna, Wisconsin or Sheridan, MI, depending on where I look.

Anyway,host yalumba.connect.com.au (203.8.183.1) appears to be listening only on port 53 (DNS) and answers non-authoritatively and recursively for (probably) all domains. Authoritative servers at connect.com.au appear to be yarrina.connect.com.au. & warrane.connect.com.au.

No less than three lines of the /usr/bin/pmagic_net shell script are dedicated to overriding the name servers provided by DHCP, and I couldn't help but think there must be some important reason why. I can only guess that you either A) operate this server yourself or in conjunction with others in an attempt to gage usage of Pmagic by monitoring lookup requests at that server, or B) you innocently wanted to share an open/recursive name server to help your users "work-around" any potential DHCP misconfigurations they might run across while using Pmagic. It just seems a little odd, and since I can find no mention of it anywhere on this web site, it seemed a little bit like a dirty trick.

Anyway, what is the reason an Australian DNS server is being forced upon the Pmagic users?

Please discontinue this behaviour in the next release. This is GNU/Linux, which is about openness. Sneaky tricks many of your users will never notice is not in keeping with that spirit.

I await your enlightenment, and hope whomever accused you of racism had as much, or more, evidence.
User avatar
n8bounds
 
Posts: 11
Joined: Tue Feb 03, 2009 3:59 pm
Location: North Carolina, USA

Re: dhclient dirty trick

Postby Patrick Verner » Sun Aug 30, 2009 8:25 pm

B) you innocently wanted to share an open/recursive name server to help your users "work-around" any potential DHCP misconfigurations they might run across while using Pmagic.


That's exactly why. What's a better way to do it that's more reliable?

Should I use one from here instead? http://en.wikipedia.org/wiki/OpenDNS Lots of people use that one from Australia. Google it: 203.8.183.1 There is nothing wrong with using that for a secondary DNS, lots of people do.

Why would you think I was doing anything dishonest, like tracking users? I've been using that DNS for years and nobody has complained until now.

If you have better ways to do things that will help users here, by all means, suggest it. Don't come here with conspiracy theories. And don't ask me to add mplayer. :lol:
Last test version of Parted Magic: http://beefdrapes.partedmagic.com
User avatar
Patrick Verner
Site Admin
 
Posts: 880
Joined: Wed Nov 19, 2008 2:27 am
Location: Kaukauna, Wisconsin

Re: dhclient dirty trick

Postby linus72 » Sun Aug 30, 2009 8:38 pm

LOL
yeah, cause if'n you ask for mplayer you'll get banned into a non-pmagic realm dude

Personally, I want Open Office too :o

I'm sure if Pat wanted to harm someones PC he'd just make gparted or something auto-destroy all partitions!

I like the one where Pat asked the guy if he ate paint chips as a kid!
Ha!
LOL
LOL
...gurgling sound in background...
...hack!
....cough...cough...cough
What a hit!
I gotta quit smokin this stufff...cough!
LOL
linus72
 
Posts: 31
Joined: Sat Jul 04, 2009 11:02 am

Re: dhclient dirty trick

Postby Patrick Verner » Sun Aug 30, 2009 8:43 pm

Okay, I changed my script. It uses this now:

Code: Select all
#OpenDNS provides the following recursive nameserver address
#http://en.wikipedia.org/wiki/OpenDNS
echo "nameserver 208.67.222.222" | cat > /etc/resolv.conf


From this:

Code: Select all
echo "nameserver 203.8.183.1" | cat > /etc/resolv.conf


This should be better because OpenDNS is more known.
Last test version of Parted Magic: http://beefdrapes.partedmagic.com
User avatar
Patrick Verner
Site Admin
 
Posts: 880
Joined: Wed Nov 19, 2008 2:27 am
Location: Kaukauna, Wisconsin

Re: dhclient dirty trick

Postby n8bounds » Sun Aug 30, 2009 8:46 pm

I'm happy I was wrong and I apologize for my tone.

It does mess with local domain searches though. What do you think about appending to the name server list instead of pre-pending to it?

For example, if there is a local domain set up where all the hosts dynamically register thier DHCP leases (not that uncommon, even Tomato Firmware supports this now), resolutions which would normally work (ping servername) when the DHCP server specifies a domain search parameter will fail when an external DNS server is listed first (requiring ping servername.localdomain.lan instead.)
Last edited by n8bounds on Sun Aug 30, 2009 9:32 pm, edited 1 time in total.
User avatar
n8bounds
 
Posts: 11
Joined: Tue Feb 03, 2009 3:59 pm
Location: North Carolina, USA

Re: dhclient dirty trick

Postby Patrick Verner » Sun Aug 30, 2009 9:31 pm

I've updated pmagic_net again. I removed the code for the loop so the local one is preferred. I hope people don't start losing the interwebs. This is how the new one will read:

/etc/resolv.conf
Code: Select all
nameserver xxx.xxx.xxx.xxx
#OpenDNS provides the following recursive name server address
#http://en.wikipedia.org/wiki/OpenDNS
nameserver 208.67.222.222


xxx.xxx.xxx.xxx is the name of yours. I hope the comments make this DNS address that's coming out of nowhere better known and more transparent.

Is this acceptable?
Last test version of Parted Magic: http://beefdrapes.partedmagic.com
User avatar
Patrick Verner
Site Admin
 
Posts: 880
Joined: Wed Nov 19, 2008 2:27 am
Location: Kaukauna, Wisconsin

Re: dhclient dirty trick

Postby n8bounds » Sun Aug 30, 2009 9:34 pm

People are accustomed to relying on their local resolver anyway. Your new solution is quite acceptable. I appreciate your efforts and responsiveness.

Thanks,
nb
User avatar
n8bounds
 
Posts: 11
Joined: Tue Feb 03, 2009 3:59 pm
Location: North Carolina, USA

Next

Return to Bugs

Who is online

Users browsing this forum: No registered users and 2 guests