You are not logged in.

#1 2017-02-18 03:16:33

nannerpussy
Member
Registered: 2017-02-15
Posts: 96

[SOLVED] dhcpcd troubles

[SOLVED EDIT]

Keeping the bottom part because I like to show off how dumb I can be. I figured it out with about 20 minutes of trial and error. Here's the TL;DR:

1. Installed Arch with dhcpcd and then NetworkManager for use in GUI later.
2. Accidentally enabled dhcp (not dhclient) at some point I think, and made my router hate me, got wrong IP lease despite router config for local static.
3. NetworkManager only showed the IP I told it to expect, but "ip a" was showing two IPs which is a problem.
4. Changed /etc/dhcpcd.conf to allow wheel group control and edited it accordingly.
5. Ran systemctl disable dhcpcd@enp2s0.service (as sudo) to stop dhcpcd from being a Try Hard on my NIC
6. Kept fucking up "ip" commands with now-deprecated "ifconfig" being what I'm used to, finally ran sudo ip addr add 192.168.1.80/24 dev enp2s0 and rebooted.
7. Won.


Original post below.

I am trying to join my local network with a static IP being issued FROM THE ROUTER to me, rather than me setting static config in NetworkManager. The problem is during the initial install I let dhcpcd handle the connection like normal, but for whatever reason it leased the wrong IP from my U-verse router. Yes, this router is a huge piece of shit, but I have never had any OS take the wrong IP from it util now. Using systemctl (then dhcpcd invoked directly) to kill it dump the IP and the lease, then used NetworkManager GUI alone to reset and let it handle the connection. It can take the right IP, but as soon as dhcpcd is restarted, I am issued a second IP on the same interface without dropping either. I know I'm doing something really stupid here, but I cannot understand what it is. This is the first time I've ever used dhcpcd. Here's my current interface:

2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 74:d4:35:53:72:7d brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.86/24 brd 192.168.1.255 scope global dynamic enp2s0
       valid_lft 86208sec preferred_lft 86208sec
    inet 192.168.1.80/24 brd 192.168.1.255 scope global secondary enp2s0


Note the two IPs. If I use "dhcpcd -k" right now it hangs, regardless of sudo. Same with the "-U" option to dump lease. I also tried manually editing /etc/dhcpcd.conf and uncommented the line to allow wheel group controls. I then thought avahi could fix this since my router has never had a problem with avahi and uPNP and such, so I've also enabled avahi-daemon, which works fine for discovering LAN hosts with broadcasting like my Lubuntu box, but I don't use Windows at all so I don't know if avahi (avahi-daemon specifically) is just a waste of time in all of this. I wanted to mention it though incase it does something stupid to IP leasing as well. Also, my systemctl output is listed as "degraded" without any other issues listed, which didn't make sense to me either.

I checked the wiki and the actual home page of dhcpcd (which was useless as hell) and searched the board here, but I can't find anyone with the same circumstances. What am I doing wrong here..? What about just killing and removing dhcpcd with fire and then installing dhclient? Would that fuck NetworkManger up at all?


Edit: Oh and yes, I did use 'dhcpcd -r (my IP)' and can request it and that works until I reboot. Am I going to have to have systemd invoke dhcpcd with the -r flag each boot? Also, here's "ip netconf":

ipv4 dev lo forwarding off rp_filter off mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
ipv4 dev enp2s0 forwarding off rp_filter strict mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
ipv4 all forwarding off rp_filter strict mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off
ipv4 default forwarsystemctl disable dhcpcd@enp2s0.serviceding off rp_filter strict mc_forwarding off proxy_neigh off ignore_routes_with_linkdown off

'systemctl disable dhcpcd@enp2s0.service' seems to have disabled dhcpcd handing dhcp, now need to reset and clear myself off router to see if netctl will lease the right one...

Edit 2: sudo ip addr add 192.168.1.80/24 dev enp2s0 seems to have worked after a bunch of fucking around with "ip addr" and being used to "ifconfig", NetworkManager seems compliant at least and the second lease for the wrong IP got removed by issuing the same command except "del" instead of "add" on the IP in question..

Last edited by nannerpussy (2017-02-18 04:26:16)

Offline

#2 2017-02-18 21:17:35

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: [SOLVED] dhcpcd troubles

nannerpussy wrote:

2. Accidentally enabled dhcp (not dhclient) at some point I think, and made my router hate me, got wrong IP lease despite router config for local static.
3. NetworkManager only showed the IP I told it to expect, but "ip a" was showing two IPs which is a problem.

Guessing your router obeys ClientID over MAC address and dhcpcd will generate a DUID + IAID as your ClientID rather than using the MAC address in the ClientID like some other DHCP clients.
You can configure this behavior in dhcpcd.conf.

Also, don't run dhcpcd and NetworkManager at the same time.

Offline

Board footer

Powered by FluxBB