Moin!
Leider musste ich mein Heimnetz von DHCP auf statische IPs umstellen (Server streikt ), kriege aber die Umstellung beines Raspi 3B (mit aktuellem Raspbian) auf statische IPs nicht mehr hin: Meiner Lektüre (Stackexchange) entnahm ich, dass man eine statische IP über den DHCP-Client regeln muss, indem man sie in die /etc/dhcpcd.conf schreibt. Die schaut bei mir jetzt so aus:
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
# Configures eth0 for a static IP address and routing.
# Added 2017/12/25 by JR.
interface eth0
static ip_address = 169.254.164.3/24
static routers = 169.254.164.1
static domain_name_servers = 212.6.64.14
Alles anzeigen
Starte ich den dhcpcd per systemctl (oder gleich den ganzen Raspi) neu, gibt mir ifconfig aber immer noch die alte Adresse aus (von der ich nicht mal weiß, wo sie herkommt, weil sie nicht mal zu meinem Netzsegment passt):
eth0 Link encap:Ethernet HWaddr b8:27:eb:4c:cb:8c
inet addr:169.254.168.86 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::243a:4333:fc91:c87/64 Scope:Link
Der Start des Client haut aber offenbar normal hin:
● dhcpcd.service - dhcpcd on all interfaces
Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled)
Active: active (running) since Sun 2017-12-24 22:28:40 CET; 12min ago
Process: 1396 ExecStop=/sbin/dhcpcd -x (code=exited, status=0/SUCCESS)
Process: 1401 ExecStart=/sbin/dhcpcd -q -b (code=exited, status=0/SUCCESS)
Main PID: 1402 (dhcpcd)
CGroup: /system.slice/dhcpcd.service
└─1402 /sbin/dhcpcd -q -b
Dec 24 22:28:40 autoradio dhcpcd[1401]: dev: loaded udev
Dec 24 22:28:40 autoradio systemd[1]: Started dhcpcd on all interfaces.
Dec 24 22:28:40 autoradio dhcpcd[1402]: DUID 00:01:00:01:1e:da:f2:49:b8:27:eb:94:1f:4d
Dec 24 22:28:40 autoradio dhcpcd[1402]: eth0: IAID eb:4c:cb:8c
Dec 24 22:28:40 autoradio dhcpcd[1402]: wlan0: waiting for carrier
Dec 24 22:28:40 autoradio dhcpcd[1402]: eth0: soliciting a DHCP lease
Dec 24 22:28:40 autoradio dhcpcd[1402]: eth0: soliciting an IPv6 router
Dec 24 22:28:50 autoradio dhcpcd[1402]: eth0: using IPv4LL address 169.254.168.86
Dec 24 22:28:50 autoradio dhcpcd[1402]: eth0: adding route to 169.254.0.0/16
Dec 24 22:28:52 autoradio dhcpcd[1402]: eth0: no IPv6 Routers available
Alles anzeigen
Ignoriert der Client also die Befehle in seiner eigenen Config-Datei? Danke für jeden zweckdienlichen Hinweis!
UPDATE: Der Server beschwert sich nun lautstark über eine «martialsche» IP-Adresse meines Raspis: