New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Arch B3 gets 2 IPs via DHCP on the interface?

Got problems with your B2 or B3? Share and get helped!
Post Reply
stasheck
Posts: 126
Joined: 15 Jan 2014, 13:13

Arch B3 gets 2 IPs via DHCP on the interface?

Post by stasheck »

Hi,
I feel kind of stupid by posting a question I can probably figure out on my own, but here it's related to B3's networking - which is the only way to communicate with B3. The device is installed remotely, so if I mess up, it will stay down (well, up, but incommunicado) until I can get there. So, please help.

I have a B3 with Arch that constantly gets 2 IP addresses via DHCP:

Code: Select all

# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:22:02:00:42:f4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.107/24 brd 192.168.1.255 scope global dynamic eth0
       valid_lft 28218sec preferred_lft 28218sec
    inet 192.168.1.108/24 brd 192.168.1.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::aee0:549:54da:9ddf/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:22:02:00:42:f5 brd ff:ff:ff:ff:ff:ff
Relevant log lines (reverse order):

Code: Select all

Sep 23 14:41:16 kbsf-backup systemd-timesyncd[161]: Synchronized to time server 217.182.76.134:123 (2.arch.pool.ntp.org).
Sep 23 14:41:16 kbsf-backup systemd-timesyncd[161]: Network configuration changed, trying to establish connection.
Sep 23 14:41:16 kbsf-backup systemd-networkd[231]: eth0: Configured
Sep 23 14:41:16 kbsf-backup dhcpcd[189]: eth0: no IPv6 Routers available
Sep 23 14:41:09 kbsf-backup dhcpcd[189]: eth0: adding default route via 192.168.1.1
Sep 23 14:41:09 kbsf-backup dhcpcd[189]: eth0: adding route to 192.168.1.0/24
Sep 23 14:41:09 kbsf-backup dhcpcd[189]: eth0: leased 192.168.1.108 for 43200 seconds
Sep 23 14:41:04 kbsf-backup systemd-networkd[231]: eth0: Gained IPv6LL
Sep 23 14:41:04 kbsf-backup dhcpcd[189]: eth0: soliciting an IPv6 router
Sep 23 14:41:03 kbsf-backup dhcpcd[189]: eth0: probing address 192.168.1.108/24
Sep 23 14:41:03 kbsf-backup dhcpcd[189]: eth0: rebinding lease of 192.168.1.108
Sep 23 14:41:03 kbsf-backup systemd[1]: Started Hostname Service.
Sep 23 14:41:03 kbsf-backup systemd-timesyncd[161]: Network configuration changed, trying to establish connection.
Sep 23 14:41:03 kbsf-backup systemd-networkd[231]: eth0: DHCPv4 address 192.168.1.107/24 via 192.168.1.1
Sep 23 14:41:03 kbsf-backup dhcpcd[189]: eth0: adding address fe80::aee0:549:54da:9ddf
Sep 23 14:41:03 kbsf-backup dhcpcd[189]: eth0: IAID 02:00:42:f4
Sep 23 14:41:03 kbsf-backup dhcpcd[189]: DUID 00:01:00:01:1c:9f:f8:af:00:22:02:00:3a:ac
Sep 23 14:41:03 kbsf-backup systemd-networkd[231]: eth0: Gained carrier
Sep 23 14:41:03 kbsf-backup dhcpcd[189]: eth0: carrier acquired
Sep 23 14:41:03 kbsf-backup kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sep 23 14:41:03 kbsf-backup kernel: mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
Services:

Code: Select all

  atop.service                                                                                            loaded    active   running   Atop advanced performance monitor
* auditd.service                                                                                          not-found inactive dead      auditd.service
  autossh.service                                                                                         loaded    active   running   AutoSSH service for Central Dogma
  bootled.service                                                                                         loaded    active   exited    Turn Front Panel LED Green
  bubba-buttond.service                                                                                   loaded    active   running   Rear-button handler (buttond)
  cronie.service                                                                                          loaded    active   running   Periodic Command Scheduler
  dbus.service                                                                                            loaded    active   running   D-Bus System Message Bus
  dhcpcd.service                                                                                          loaded    active   running   dhcpcd on all interfaces
* display-manager.service                                                                                 not-found inactive dead      display-manager.service
  dm-event.service                                                                                        loaded    inactive dead      Device-mapper event daemon
  emergency.service                                                                                       loaded    inactive dead      Emergency Shell
  getty@tty1.service                                                                                      loaded    active   running   Getty on tty1
  haveged.service                                                                                         loaded    active   running   Entropy Harvesting Daemon
  initrd-cleanup.service                                                                                  loaded    inactive dead      Cleaning Up and Shutting Down Daemons
  initrd-parse-etc.service                                                                                loaded    inactive dead      Reload Configuration from the Real Root
  initrd-switch-root.service                                                                              loaded    inactive dead      Switch Root
  initrd-udevadm-cleanup-db.service                                                                       loaded    inactive dead      Cleanup udevd DB
  kmod-static-nodes.service                                                                               loaded    active   exited    Create list of required static device nodes for the current kernel
  ldconfig.service                                                                                        loaded    inactive dead      Rebuild Dynamic Linker Cache
  logrotate.service                                                                                       loaded    inactive dead      Rotate log files
  lvm2-lvmetad.service                                                                                    loaded    inactive dead      LVM2 metadata daemon
  man-db.service                                                                                          loaded    inactive dead      Update man-db cache
  mkinitcpio-generate-shutdown-ramfs.service                                                              loaded    inactive dead      Generate shutdown-ramfs
  netctl.service                                                                                          loaded    inactive dead      (Re)store the netctl profile state
  netctl@lan.service                                                                                      loaded    inactive dead      Networking for netctl profile lan
  netctl@wan.service                                                                                      loaded    inactive dead      WAN Port on B3
* plymouth-quit-wait.service                                                                              not-found inactive dead      plymouth-quit-wait.service
* plymouth-start.service                                                                                  not-found inactive dead      plymouth-start.service
  rescue.service                                                                                          loaded    inactive dead      Rescue Shell
  serial-getty@ttyS0.service                                                                              loaded    active   running   Serial Getty on ttyS0
  setethermac@eth0.service                                                                                loaded    inactive dead      Set MAC address of eth0
  setethermac@eth1.service                                                                                loaded    inactive dead      Set MAC address of eth1
  shadow.service                                                                                          loaded    inactive dead      Verify integrity of password and group files
  smartd.service                                                                                          loaded    active   running   Self Monitoring and Reporting Technology (SMART) Daemon
  sshd.service                                                                                            loaded    active   running   OpenSSH Daemon
  sshdgenkeys.service                                                                                     loaded    inactive dead      SSH Key Generation
* syslog.service                                                                                          not-found inactive dead      syslog.service
  systemd-ask-password-console.service                                                                    loaded    inactive dead      Dispatch Password Requests to Console
  systemd-ask-password-wall.service                                                                       loaded    inactive dead      Forward Password Requests to Wall
  systemd-binfmt.service                                                                                  loaded    inactive dead      Set Up Additional Binary Formats
  systemd-firstboot.service                                                                               loaded    inactive dead      First Boot Wizard
  systemd-fsck-root.service                                                                               loaded    active   exited    File System Check on Root Device
  systemd-fsck@dev-sda1.service                                                                           loaded    active   exited    File System Check on /dev/sda1
  systemd-hwdb-update.service                                                                             loaded    inactive dead      Rebuild Hardware Database
  systemd-initctl.service                                                                                 loaded    inactive dead      /dev/initctl Compatibility Daemon
  systemd-journal-catalog-update.service                                                                  loaded    inactive dead      Rebuild Journal Catalog
  systemd-journal-flush.service                                                                           loaded    active   exited    Flush Journal to Persistent Storage
  systemd-journald.service                                                                                loaded    active   running   Journal Service
  systemd-logind.service                                                                                  loaded    active   running   Login Service
  systemd-machine-id-commit.service                                                                       loaded    inactive dead      Commit a transient machine-id on disk
  systemd-modules-load.service                                                                            loaded    inactive dead      Load Kernel Modules
  systemd-networkd.service                                                                                loaded    active   running   Network Service
  systemd-quotacheck.service                                                                              loaded    inactive dead      File System Quota Check
  systemd-random-seed.service                                                                             loaded    active   exited    Load/Save Random Seed
  systemd-remount-fs.service                                                                              loaded    active   exited    Remount Root and Kernel File Systems
  systemd-resolved.service                                                                                loaded    active   running   Network Name Resolution
  systemd-rfkill.service                                                                                  loaded    inactive dead      Load/Save RF Kill Switch Status
  systemd-sysctl.service                                                                                  loaded    active   exited    Apply Kernel Variables
  systemd-sysusers.service                                                                                loaded    inactive dead      Create System Users
  systemd-timesyncd.service                                                                               loaded    active   running   Network Time Synchronization
  systemd-tmpfiles-clean.service                                                                          loaded    inactive dead      Cleanup of Temporary Directories
  systemd-tmpfiles-setup-dev.service                                                                      loaded    active   exited    Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service                                                                          loaded    active   exited    Create Volatile Files and Directories
  systemd-udev-trigger.service                                                                            loaded    active   exited    udev Coldplug all Devices
  systemd-udevd.service                                                                                   loaded    active   running   udev Kernel Device Manager
  systemd-update-done.service                                                                             loaded    inactive dead      Update is Completed
  systemd-update-utmp.service                                                                             loaded    active   exited    Update UTMP about System Boot/Shutdown
  systemd-user-sessions.service                                                                           loaded    active   exited    Permit User Sessions
  systemd-vconsole-setup.service                                                                          loaded    inactive dead      Setup Virtual Console
  updatedb.service                                                                                        loaded    inactive dead      Update locate database
  user@1000.service                                                                                       loaded    active   running   User Manager for UID 1000
What's clear to me is there are 2 services that ask for DHCP: dhcpd and systemd-networkd. From what I already googled, most probably I have netctl configured together with systemd-networkd. I tried to untangle the situation, which yielded me a trip to this remote location to fix, since I lost network connection.

If someone knows how to fix it, I will very much appreciate it.
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Arch B3 gets 2 IPs via DHCP on the interface?

Post by sakaki »

Hi stasheck,

what config files do you have in /etc/systemd/network/? If you are content to use systemd-networkd on its own, disabling dhcpcd, that's probably the easiest way going forward...

Best, sakaki
stasheck
Posts: 126
Joined: 15 Jan 2014, 13:13

Re: Arch B3 gets 2 IPs via DHCP on the interface?

Post by stasheck »

Sakaki to the rescue :)
# cat /etc/systemd/network/eth0.network
[Match]
Name=eth0

[Network]
DHCP=ipv4

[DHCP]
UseDNS=True
I understand that systemd-networkd will also get address from DHCP, not using dhcpcd?

To disable, just "systemctl disable dhcpcd" and reboot? It won't cause netctl to disable interface due to unmet dependency on DHCP client, for example?
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Arch B3 gets 2 IPs via DHCP on the interface?

Post by sakaki »

systemd-networkd has its own DHCP client implementation, yes. Provided it is enabled for eth0 (which would appear to be the case given your config files and the dual-address issue), you should be safe to turn off dhcpcd. The "systemctl disable dhcpcd" command will probably work (or you can also use "systemctl mask dhcpcd" to ensure dhcpcd isn't started as a dependency of another enabled service).

I assume you have some way of determining the IP address that has been allocated to eth0, to enable you to login remotely?

Best, sakaki
stasheck
Posts: 126
Joined: 15 Jan 2014, 13:13

Re: Arch B3 gets 2 IPs via DHCP on the interface?

Post by stasheck »

Yes, I have access to the DHCP server to check that :-) But good point.

I'll try disabling dhcpcd.
Post Reply