Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Strange behaviour of dhcpcd
Date: Fri, 31 Oct 2014 06:53:12
Message-Id: 1639884.UKlFl08jV7@andromeda
In Reply to: Re: [gentoo-user] Strange behaviour of dhcpcd by Marc Joliet
1 On Tuesday, October 28, 2014 07:31:56 PM Marc Joliet wrote:
2 > Am Tue, 28 Oct 2014 16:28:37 +0000
3 >
4 > schrieb Mick <michaelkintzios@×××××.com>:
5 > > On Monday 27 Oct 2014 23:44:58 Marc Joliet wrote:
6 > > > Hi list
7 > > >
8 > > > First off: this is a "fixed" issue, in that I don't see the behaviour
9 > > > anymore, so time is not of the essence ;) . I'm only looking for an
10 > > > explanation, or for comments from other people who experienced this.
11 > > >
12 > > > So the issue was some really strange behaviour on the part of dhcpcd. I
13 > > > completed a move a few weeks ago and got an internet connection last
14 > > > Wednesday (using a local cable company, that is, using a cable modem
15 > > > connected to via ethernet). I reconfigured my system to use regular DHCP
16 > > > (a relief after the PPPoE mess in the dorm), but dhcpcd could not apply
17 > > > the default route; it *obtained* one, but failed with "if_addroute:
18 > > > Invalid argument". I tried it manually, to no effect: "ip route"
19 > > > complained about invalid arguments, and I think plain "route" said "file
20 > > > exists", but I'm not sure anymore (either way, the error messages were
21 > > > less than clear). The funny thing is, I *could* set the default route,
22 > > > just not to the one advertised via DHCP, but to the x.y.z.2+ instead of
23 > > > x.y.z.1, which even gave me access to the internet part of the time.
24 > > >
25 > > > Now the funny thing is what fixed it:
26 > > > *commenting out the entirety of /etc/dhcpcd.conf*
27 > > >
28 > > > Then dhcpcd ran with default settings and could apply the default
29 > > > route.
30 > > > Even more bizarre is the fact that it kept working after uncommenting it
31 > > > again (and I track it with git, so I'm 100% sure I got it back to its
32 > > > original state). This leads me to believe that there was some
33 > > > (corrupted?)
34 > > > persistent state somewhere that got overwritten by starting dhcpcd after
35 > > > I
36 > > > commented out the file, but I have no clue where.
37 > > >
38 > > > Has anyone seen this sort of behaviour before, or anything similar to
39 > > > it?
40 > > > I searched for the error messages I was seeing, but couldn't find
41 > > > anything. I was using gentoo-sources-3.15.9 (now I'm at 3.16.6) and
42 > > > dhcpcd 6.4.3 at the time, but also had the issue with dhcpcd 6.4.7, to
43 > > > which I could upgrade by using the aforementioned x.y.z.2 gateway.
44 > > > Perhaps
45 > > > it was a bug in the kernel? But that's just guessing.
46 > > >
47 > > > Regards,
48 > >
49 > > Since dhcpcd doesn't misbehave any more it would be difficult to check
50 > > what
51 > > was the cause of this problem. You didn't say if the cable modem is
52 > > functioning as a router or as in a full or half bridge mode and if there
53 > > is a router between your PC and the modem that distributes IP addresses.
54 > > You also didn't say if the ISP has allocated an IP block or just a single
55 > > IP address.
56 > First off: thanks for the response. Note that I have no clue about modems
57 > (other than that the modulate and demodulate signals), let alone cable
58 > modems and the wide variety of hardware out there. I also have no clue
59 > about the protocols involved (save for a tiny bit of IP and TCP/UDP). Just
60 > so you know what to expect.
61 >
62 > Anyway, in answer to your queries:
63 >
64 > - I do not know for sure how the modem is configured, and whether it hands
65 > out the addresses itself or whether these come from the other end of the
66 > cable connection. But from what I can observe it does *not* function as a
67 > router; it has *one* Ethernet connection, and that's it. I did not test it
68 > in a bridged network, to see if it hands out addresses to multiple clients.
69 > Our ISP refers to it as a "LAN modem".
70
71 Sounds similar to what I've been using for the past 10+ years.
72
73 > OK, I looked up more information: It's a Thomson THG571, and the manual
74 > (I found a copy here:
75 > http://www.kabelfernsehen.ch/dokumente/quicknet/HandbuchTHG570.pdf) refers
76 > to "Transparent bridging for IP traffic", and AFAICT makes no mention of
77 > routing. It does explicitly say that it gets an IP address from the ISP,
78 > so I suspect that it acts as a bridge for all IP clients (like the "IP
79 > Client Mode" in Fritz!Box routers). So it sounds to me that the DHCP
80 > packets likely come from a server beyond the router. Is this the half
81 > bridge mode you alluded to?
82
83 Not sure about half-bridge mode. But most cable-modems work in bridge-mode.
84 (If they have more then 1 ethernet-port, they act as routers)
85
86 > Oh, and there are two powerline/dLAN adapters in between (the modem is in
87 > the room next door), but direct connections between my computer and my
88 > brother's always worked, and they've been reliable in general, so I assume
89 > that they're irrelevant here.
90
91 Uh-oh... If you have multiple machines that can ask for a DHCP-lease, you
92 might keep getting a different result each time it tries to refresh.
93
94 > Furthermore, I found out the hard way that you *sometimes* need to reboot
95 > the modem when connect a different client for the new client to get a
96 > response from the DHCP server (I discovered this after wasting half a day
97 > trying to get our router to work, it would log timeouts during
98 > DHCPDISCOVER). I didn't think it was the modem because when we first got
99 > it, I could switch cables around between my computer and my brother's and
100 > they would get their IP addresses without trouble. *sigh*
101
102 That's a common flaw. These modems are designed with the idea that people only
103 have 1 computer. Or at the very least put a router between the modem and
104 whatever else they have.
105 Please note, there is NO firewall on these modems and your machine is fully
106 exposed to the internet. Unless you have your machine secured and all unused
107 services disabled, you might as well assume your machine compromised.
108
109 I once connected a fresh install directly to the modem. Only took 20 seconds
110 to get owned. (This was about 9 years ago and Bind was running)
111
112 > - At the time there was no router, just the modem. We now have a Fritz!Box
113 > 3270 with the most recent firmware, but we got it after I "solved" this
114 > problem.
115 >
116 > - I don't know whether we have an IP block or not; I suspect not. At the
117 > very least, we didn't make special arrangements to try and get one.
118
119 Then assume not. Most, if not all, ISPs charge extra for this. (If they even
120 offer it)
121
122 --
123 Joost

Replies

Subject Author
Re: [gentoo-user] Strange behaviour of dhcpcd Mick <michaelkintzios@×××××.com>
Re: [gentoo-user] Strange behaviour of dhcpcd Marc Joliet <marcec@×××.de>