Secondary IP addresses using dhcpcd.conf

Kernels & Hardware, configuring network, installing services

Secondary IP addresses using dhcpcd.conf

Postby neilneil2000 » 2017-08-28 07:51

Hi,

I have been wrestling with this problem for a while now and still cannot get the configuration I am after.

My goal is to have two IPv4 addresses associated with the wlan0 interface such that I can communicate with the server on either. Prior to the introduction of dhcpcd in Jessie I would have edited /etc/network/interfaces to include a statement for "interface wlan0" and "interface wlan0:0" however with the new dhcpcd.conf method of network configuration I have been unable to replicate this.

I have tried several approaches including the arping command and referencing out to profile stanzas within the dhcpcd.conf file but to no avail.

Can anyone shed some light on this for me? TIA
neilneil2000
 
Posts: 6
Joined: 2017-08-28 07:40

Re: Secondary IP addresses using dhcpcd.conf

Postby neilneil2000 » 2017-09-11 05:55

If people don't know the answer, are there any suggestions of where to look? I have tried all the FAQs and documents I could find.
neilneil2000
 
Posts: 6
Joined: 2017-08-28 07:40

Re: Secondary IP addresses using dhcpcd.conf

Postby TonyT » 2017-09-11 10:37

If a server why are you using dhcp? It should have static ip addresses. Try that.
https://wiki.debian.org/NetworkConfigur ... _Interface
TonyT
 
Posts: 555
Joined: 2006-09-04 11:57

Re: Secondary IP addresses using dhcpcd.conf

Postby neilneil2000 » 2017-09-13 12:46

The latest versions of Jessie state that static IP configuration should be done via the dhcpcd configuration file - there are notes in /etc/network/interfaces to this effect and indeed manual edits to the interfaces file are overwritten.

I realise I can disable the dhcpcd service which I am happy to do, but this would be avoiding the problem rather than understanding how to address it.
neilneil2000
 
Posts: 6
Joined: 2017-08-28 07:40

Re: Secondary IP addresses using dhcpcd.conf

Postby cob » 2018-03-03 18:49

I'm sorry guys, but this is a primary example of something that should NOT have been changed. Why the hell would you move static interface configuration from /etc/network/interfaces (where everyone has known it to be for YEARS) to...dhcpcd.conf???

Come on.

:evil: :evil: :evil: :evil: :evil: :evil: :evil:
cob
 
Posts: 9
Joined: 2011-07-27 04:52

Re: Secondary IP addresses using dhcpcd.conf

Postby dilberts_left_nut » 2018-03-03 19:10

What a load of bollocks.
It works the same as it always has.

edit: and FFS, it's pi-specific as per:
viewtopic.php?f=3&t=134666&p=655250#p655250
and
https://www.raspberrypi.org/forums/view ... 6&t=111887
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Secondary IP addresses using dhcpcd.conf

Postby cob » 2018-03-03 19:24

No, it doesn't. I had 2 interfaces configured as static in /etc/network/interfaces, and /etc/dhcpcd.conf had only one of them configured. The other started grabbing a second, non-static, DHCP address and screwing up routing, in the recent past.
cob
 
Posts: 9
Joined: 2011-07-27 04:52

Re: Secondary IP addresses using dhcpcd.conf

Postby dilberts_left_nut » 2018-03-03 19:31

And this is on your RaspberryPi?
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Secondary IP addresses using dhcpcd.conf

Postby cob » 2018-03-03 19:36

No, amd64 build.
cob
 
Posts: 9
Joined: 2011-07-27 04:52

Re: Secondary IP addresses using dhcpcd.conf

Postby dilberts_left_nut » 2018-03-03 19:50

OK, so what are you using that pulls in dhcpcd5 rather than the default isc-dhcp-client?
Or did you install it specifically.
It seems it's that package that changes the default behavior.

Presumably because it's gui components need to overwrite the config when the user gets clicky with it...
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Secondary IP addresses using dhcpcd.conf

Postby cob » 2018-03-23 03:37

I have confirmed the same bug with a Raspberry Pi running Raspbian jessie, but it is also occurring with my amd64 server.

Code: Select all
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:13:ef:70:57:0c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.11/24 brd 192.168.1.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet 192.168.1.52/24 brd 192.168.1.255 scope global secondary wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::213:efff:fe70:570c/64 scope link
       valid_lft forever preferred_lft forever


Routing table:

Code: Select all
root@raspberrypi:/etc# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         router          0.0.0.0         UG    0      0        0 wlan0
default         router          0.0.0.0         UG    303    0        0 wlan0
192.168.1.0     *               255.255.255.0   U     303    0        0 wlan0



And here's /etc/network/interfaces:

Code: Select all
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
        address 192.168.1.11
        netmask 255.255.255.0
        gateway 192.168.1.1
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf


And finally, boot.log entries showing that dhcpcd started on all interfaces:

Code: Select all
[^[[32m  OK  ^[[0m] Started dhcpcd on all interfaces.


dhcpcd5 and isc-dhcp-client and common installed. I never intentionally installed either of these packages; they must have been installed by default.

Code: Select all
root@raspberrypi:/var/log# dpkg --get-selections|grep dhcp
dhcpcd5                                         install
isc-dhcp-client                                 install
isc-dhcp-common                                 install


[root@amd64-server]# dpkg --get-selections|grep dhcp
dhcpcd5                                         install
isc-dhcp-client                                 install
isc-dhcp-common                                 install

cob
 
Posts: 9
Joined: 2011-07-27 04:52

Re: Secondary IP addresses using dhcpcd.conf

Postby dilberts_left_nut » 2018-03-23 04:05

cob wrote:I have confirmed the same bug with a Raspberry Pi running Raspbian jessie.
...which is irrelevant here.
(and I don't believe it qualifies as a bug as it's the documented behaviour of the package)

Again, how did you achieve this (non-default) configuration on Debian?
What does 'aptitude why dhcpcd5' show?
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Secondary IP addresses using dhcpcd.conf

Postby cob » 2018-03-23 22:11

I have not, by some magic of user idiocy, "achieved a non-default configuration" on Debian. All I have done is upgrade over the years. I couldn't tell you at this point what the original release was for the server or Raspberry Pi, but that's all that's been done, and the IP addressing was never a problem until recent updates.

Code: Select all
i   ifupdown Recommends isc-dhcp-client | dhcp-client
i   dhcpcd5  Provides   dhcp-client


There is no reason why a package that provides DHCP should supersede the network configuration file everyone has grown to know and love.
cob
 
Posts: 9
Joined: 2011-07-27 04:52

Re: Secondary IP addresses using dhcpcd.conf

Postby dilberts_left_nut » 2018-03-23 23:54

cob wrote:I have not, by some magic of user idiocy, "achieved a non-default configuration" on Debian.
Well, it certainly seems that you have.
The popcon results for the two(?) dhcp clients you have installed show that dhcpcd5 is clearly not in any type of "default" install (less than 0.5% of the isc-client installs).
https://qa.debian.org/popcon.php?package=isc-dhcp
https://qa.debian.org/popcon.php?package=dhcpcd5

You have (the default) isc-dhcp-client installed, which also provides the virtual package 'dhcp-client', leaving the logical conclusion that dhcpcd5 is either manually installed, or pulled in by one of a very few packages requiring it.
Code: Select all
apt-cache rdepends dhcpcd5
dhcpcd5
Reverse Depends:
  dhcpcd5:i386
  dhcpcd-dbus

apt-cache rdepends dhcpcd-dbus
dhcpcd-dbus
Reverse Depends:
  dhcpcd-dbus:i386
  dhcpcd-gtk

apt-cache rdepends dhcpcd-gtk
dhcpcd-gtk
Reverse Depends:
  dhcpcd-gtk:i386
  dhcpcd5
..none of which you seem to have installed (any more, if ever), and since it hasn't been auto-removed, again implies manual installation (although it may be held in by the 'recommend' on dhcp-client it provides).
cob wrote:There is no reason why a package that provides DHCP should supersede the network configuration file everyone has grown to know and love.
Again, that's the way dhcpcd5 works, and if you don't want that behaviour, don't install it - it's an installable option, not the default.
Your claims require a bit more proof than "I dunno how it happened so it must be a bug"...
Seems like regular PEBCAK to me. :)
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Secondary IP addresses using dhcpcd.conf

Postby cob » 2018-03-27 00:29

Again, that's the way dhcpcd5 works, and if you don't want that behaviour, don't install it - it's an installable option, not the default.


What? Are you seriously accepting that a package that provides DHCP doesn't respect the networking config file that has been authoritative throughout debian's history?
cob
 
Posts: 9
Joined: 2011-07-27 04:52

Next

Return to System configuration

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable