Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Secondary IP addresses using dhcpcd.conf

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
neilneil2000
Posts: 6
Joined: 2017-08-28 07:40

Secondary IP addresses using dhcpcd.conf

#1 Post by neilneil2000 »

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

#2 Post by neilneil2000 »

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.

TonyT
Posts: 575
Joined: 2006-09-04 11:57

Re: Secondary IP addresses using dhcpcd.conf

#3 Post by TonyT »

If a server why are you using dhcp? It should have static ip addresses. Try that.
https://wiki.debian.org/NetworkConfigur ... _Interface

neilneil2000
Posts: 6
Joined: 2017-08-28 07:40

Re: Secondary IP addresses using dhcpcd.conf

#4 Post by neilneil2000 »

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.

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

Re: Secondary IP addresses using dhcpcd.conf

#5 Post by cob »

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:

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5343
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Secondary IP addresses using dhcpcd.conf

#6 Post by dilberts_left_nut »

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

edit: and FFS, it's pi-specific as per:
http://forums.debian.net/viewtopic.php? ... 50#p655250
and
https://www.raspberrypi.org/forums/view ... 6&t=111887
AdrianTM wrote:There's no hacker in my grandma...

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

Re: Secondary IP addresses using dhcpcd.conf

#7 Post by cob »

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.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5343
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Secondary IP addresses using dhcpcd.conf

#8 Post by dilberts_left_nut »

And this is on your RaspberryPi?
AdrianTM wrote:There's no hacker in my grandma...

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

Re: Secondary IP addresses using dhcpcd.conf

#9 Post by cob »

No, amd64 build.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5343
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Secondary IP addresses using dhcpcd.conf

#10 Post by dilberts_left_nut »

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...

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

Re: Secondary IP addresses using dhcpcd.conf

#11 Post by cob »

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


User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5343
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Secondary IP addresses using dhcpcd.conf

#12 Post by dilberts_left_nut »

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...

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

Re: Secondary IP addresses using dhcpcd.conf

#13 Post by cob »

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.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5343
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Secondary IP addresses using dhcpcd.conf

#14 Post by dilberts_left_nut »

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...

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

Re: Secondary IP addresses using dhcpcd.conf

#15 Post by cob »

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?

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5343
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: Secondary IP addresses using dhcpcd.conf

#16 Post by dilberts_left_nut »

FFS.
If you're going to install something, maybe you should, you know, find out how it works first?
Roy Marples wrote:dhcpcd does not parse /etc/network/interfaces.
AdrianTM wrote:There's no hacker in my grandma...

User avatar
litspliff
Posts: 28
Joined: 2011-11-12 20:48

Re: Secondary IP addresses using dhcpcd.conf

#17 Post by litspliff »

sorry about your hellride dude. i think you can just purge the dhcp clients from your system (a server doesn't need dhcp), then reboot. on reboot, the custom configuration in /etc/network/interfaces should take precedence. best of luck, mf

Post Reply