intralu
Posts: 2
Joined: Sat Apr 24, 2021 5:29 pm

Static IP not working for eth0

Sun May 09, 2021 2:53 pm

Hello,

I have an issue with eth0 and assigning the static IP 192.168.12.11, while it is working with another IP like 192.168.12.13.
I have checked the network, there is no other device using 192.168.12.11, the DCHP server address range is 192.168.12.100 to .200 and there is no DHCP address reservation. If I use

Code: Select all

inform=192.168.12.11
instead of static ip_address, it is working as well. Therefor I assume, that something must have become wrong with the config somewhere.
In the deamon.log (see below) I have found two errors: "Operation not permitted" and "defense failed". But how do I address this please?
I could use "inform" oder a different IP, but then a bad feeling would remain, therefor I really like to fix it.

dhcpcd.conf:

Code: Select all

hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier

interface eth0
static ip_address=192.168.12.11
static routers=192.168.12.3
static domain_name_servers=8.8.8.8 192.168.12.3

interface wlan0
static ip_address=192.168.12.12
static routers=192.168.12.3
static domain_name_servers=8.8.8.8 192.168.12.3

Code: Select all

pi@rbp:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::9ba6:77dc:2f0a:4be9  prefixlen 64  scopeid 0x20<link>
        ether e4:5f:01:1b:10:b2  txqueuelen 1000  (Ethernet)
        RX packets 79  bytes 15619 (15.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 50  bytes 5856 (5.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Lokale Schleife)
        RX packets 9  bytes 524 (524.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9  bytes 524 (524.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.12.12  netmask 255.255.255.0  broadcast 192.168.12.255
        inet6 fe80::749:bb44:5d19:4eba  prefixlen 64  scopeid 0x20<link>
        ether e4:5f:01:1b:10:b3  txqueuelen 1000  (Ethernet)
        RX packets 66  bytes 21862 (21.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 81  bytes 13580 (13.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
/var/deamon.log

Code: Select all

May  9 17:12:44 rbp dhcpcd[474]: eth0: deleting route to 192.168.12.0/24
May  9 17:12:44 rbp dhcpcd[474]: eth0: deleting default route via 192.168.12.3
May  9 17:12:44 rbp dhcpcd[474]: eth0: probing address 192.168.12.11/24
May  9 17:12:48 rbp dhcpcd[474]: control_handle_data: Operation not permitted
May  9 17:12:49 rbp dhcpcd[474]: eth0: using static address 192.168.12.11/24
May  9 17:12:49 rbp avahi-daemon[406]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.12.11.
May  9 17:12:49 rbp avahi-daemon[406]: New relevant interface eth0.IPv4 for mDNS.
May  9 17:12:49 rbp dhcpcd[474]: eth0: adding route to 192.168.12.0/24
May  9 17:12:49 rbp dhcpcd[474]: eth0: adding default route via 192.168.12.3
May  9 17:12:49 rbp avahi-daemon[406]: Registering new address record for 192.168.12.11 on eth0.IPv4.
May  9 17:12:49 rbp dhcpcd[474]: eth0: hardware address 00:0c:c8:03:36:4d claims 192.168.12.11
May  9 17:12:49 rbp dhcpcd[474]: eth0: hardware address 00:0c:c8:03:36:4d claims 192.168.12.11
May  9 17:12:49 rbp dhcpcd[474]: eth0: 10 second defence failed for 192.168.12.11
May  9 17:12:49 rbp avahi-daemon[406]: Withdrawing address record for 192.168.12.11 on eth0.
May  9 17:12:49 rbp avahi-daemon[406]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.12.11.
May  9 17:12:49 rbp avahi-daemon[406]: Interface eth0.IPv4 no longer relevant for mDNS.

pidd
Posts: 2056
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Static IP not working for eth0

Sun May 09, 2021 3:38 pm

Which device has mac address 00:0c:c8:03:36:4d

SurferTim
Posts: 2054
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Static IP not working for eth0

Sun May 09, 2021 3:42 pm

Have you added anything to /etc/network/interfaces?
My advice applies to RaspiOS only. Please mention if you use another OS.

epoch1970
Posts: 6476
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Static IP not working for eth0

Sun May 09, 2021 3:53 pm

MAC addresses starting with 00:0c:c8 belong to Xytronics
https://dnschecker.org/mac-lookup.php?q ... %3A0c%3Ac8
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

MiscBits
Posts: 249
Joined: Wed Jan 27, 2021 12:48 pm

Re: Static IP not working for eth0

Sun May 09, 2021 3:55 pm

Try

Code: Select all

interface eth0
static ip_address=192.168.12.11/24
static routers=192.168.12.3
static domain_name_servers=8.8.8.8 192.168.12.3
Is a computer language with goto's totally Wirth-less?

User avatar
butchkemper
Posts: 83
Joined: Sat Jul 22, 2017 8:03 pm
Location: Sachse, Texas USA

Re: Static IP not working for eth0

Sun May 09, 2021 9:50 pm

intralu wrote:
Sun May 09, 2021 2:53 pm
I have checked the network, there is no other device using 192.168.12.11, the DCHP server address range is 192.168.12.100 to .200 and there is no DHCP address reservation.
The error message "eth0: hardware address 00:0c:c8:03:36:4d claims 192.168.12.11" is saying the device with MAC address 00:0c:c8:03:36:4d has IP 192.168.12.11 assigned.

You made the statement that 192.168.12.11 is not assigned to any device because that address is outside the DHCP server range. You also state no DHCP address reservation exists for 192.168.12.11. Just because the IP address is outside the DHCP server range and the server has not made an assignment does not guarantee the IP address is available. Some network device may have a static assignment for the IP address.

You have a device on your network with MAC address 00:0c:c8:03:36:4d that has IP address 192.168.12.11 assigned.

Get a network scanner program and see which network devices have which IP addresses.

I prefer to assign static IP addresses through the DHCP configuration file on the router. This places all IP assignments in a single place.

Butch


Butch

bls
Posts: 1454
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Static IP not working for eth0

Sun May 09, 2021 11:05 pm

butchkemper wrote:
Sun May 09, 2021 9:50 pm

I prefer to assign static IP addresses through the DHCP configuration file on the router. This places all IP assignments in a single place.

Butch
Agree with doing static IP address assignments on the DHCP server rather than on each device on the network, which seems like a major catastrophe waiting to happen.

That said, I prefer to have my DHCP and DNS servers running on not-my-router. So, what used to be on a my x86-based Linux server is now happily running on a Pi4.
Pi tools:
Quickly and easily build customized-just-for-you SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

pidd
Posts: 2056
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Static IP not working for eth0

Mon May 10, 2021 2:44 am

epoch1970 wrote:
Sun May 09, 2021 3:53 pm
MAC addresses starting with 00:0c:c8 belong to Xytronics
https://dnschecker.org/mac-lookup.php?q ... %3A0c%3Ac8
Xytronix - who make web controlled replacement devices (smart home maybe) .... ControlByWeb, WebRelay, WebSwitch etc

(not Xtronics who make soldering irons)

intralu
Posts: 2
Joined: Sat Apr 24, 2021 5:29 pm

Re: Static IP not working for eth0

Mon May 10, 2021 4:43 pm

Oh, I could have seen it on my own in the deamon.log. Indeed, there was a legacy webrelay with 00:0c:c8:03:36:4d connected. Took me some time to even find the device.
Thank you very much to all!

Return to “Networking and servers”