8

My Pi is configured with Arch to use eth0 with a static IP configured in conf.d:

[gotschi@berry ~]$ cat /etc/conf.d/network@eth0

address=10.0.55.5
netmask=24
broadcast=10.0.55.255
gateway=10.0.55.254

This worked better than any other configuration (e.g. netctl) for me since a few weeks. The only weird thing: It uses 2 IP addresses. When I scan my Network Range my Pi shows up 2 Times: One with the static IP of 10.0.55.5 and the other was assigned by my DHCP I assume (Range set on router: 10.0.55.50-150): 10.0.55.55

nmap also reports the hostname only on the .55 address, so http://raspberry.local/ is assigned to .55

my /etc/netctl folder is empty, except for the default folders...

[gotschi@berry ~]$ ls /etc/netctl
    examples  hooks  interfaces

It also responds to 10.0.55.55 correctly!

Where are other configs stored? Thanks!

[gotschi@berry ~]$ ifconfig
    eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 10.0.55.5  netmask 255.255.255.0  broadcast 10.0.55.255
    ether b8:27:eb:50:ec:f4  txqueuelen 1000  (Ethernet)
    RX packets 17227  bytes 1077447 (1.0 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 85328  bytes 127324380 (121.4 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

edit I think I found something here:

[gotschi@berry ~]$ ip addr
    4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:50:ec:f4 brd ff:ff:ff:ff:ff:ff
inet 10.0.55.5/24 brd 10.0.55.255 scope global eth0
   valid_lft forever preferred_lft forever
inet 10.0.55.55/24 brd 10.0.55.255 scope global secondary eth0
   valid_lft forever preferred_lft forever

sudo ip addr del 10.0.55.55/24 dev eth0 disabled the second IP, just trying a reboot now

-> nope, still got 2 ip addresses :/

bfrgzju
  • 191
  • 1
  • 7
Gotschi
  • 608
  • 2
  • 7
  • 16

5 Answers5

8

This helped for me:

update-rc.d dhcpcd disable
service dhcpcd stop
ip addr del %YOURS-SECOND-IP% dev ethX

And when you start raspberry pi again, scope global secondary will disappear.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
DeamonMV
  • 196
  • 1
  • 1
4

Edit /etc/dhcpcd.conf

This happened to me too (albiet on Raspbian).
If you'd rather not totally disable the dhcpcd service, you can add this to /etc/dhcpcd.conf to inform it of your static interface:

interface eth0
static ip_address=192.168.0.10/24   
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 8.8.8.8

This will stop it from grabbing a secondary ip upon rebooting.

(ArchWiki Reference)

Hydraxan14
  • 1,876
  • 1
  • 13
  • 23
3

The issue was caused by a separate dhcp@network laying in /etc/systemd/system/

No clue where it came from, but deleting it solved my problem :)

Gotschi
  • 608
  • 2
  • 7
  • 16
0

On Raspbian, I found that this situation arose from having the GUI Network Manager running while the dhcpcd service is also running. sudo systemctl mask dhcpcd and a subsequent reboot took care of it.

-1

It is getting a DHCP IP from dhcpcd.conf and using your netplan - you can run both, I learned the hard way, I think you can even assign different IP ranges and all work - here's the trick, disable DHCP (and for fun you can rename your conf file - but - with no conf file, if DHCP is still running it will auto-use DHCP and you'll see the ip in ip a.)

systemctl stop dhcpcd

systemctl disable dhcpcd

1coolbox
  • 1
  • 2