Skip to content

Static IP gets overriden by Dynamic IP on Raspberry PI #12

Closed
@aetilley

Description

@aetilley

This is the one big hurdle I had to overcome when completing @jhpoelen 's wonderful walkthrough (available here) on putting a Raspberry Pi + my MyNet600 on the Mesh.

For me the aforementioned tutorial went swimmingly until step 9, where one must reboot, unplug from ethernet port 3 on the router and plug into port 2. After doing this and SSHing into the raspberry pi (which took a few attempts to be successful, which might be related to the below problem), I was not able to ping any outside servers.

Calling ifconfig for interface eth0, we found out that eth0 had been reassigned a dynamic IP address, an apparently was rendering ineffective the change to /etc/dhcpcd.conf in step 7. (Note that calling hostname -I would actually print both ip addresses, but ifconfig would only display the dynamically assigned one.)

Making that change to /etc/dhcpcd.conf adds a static ip address, but there still seems to be some DHCP server continuously assigning a dynamic ip address upon reboot.

My workaround for now is just:

  1. I have to manually delete the dynamic ip address via

sudo ip addr delete 172.22.0.9 dev eth0

  1. After doing so, even though ifconfig eth0 updates immediately to the desired mesh ip address added in /etc/dhcpcd.conf, I still cannot ping the Internet until....

  2. I unplug the ethernet cable from port 2 and then replug the ethernet cable back into port 2. I have no idea why this would help, but it does. After this, I am able to ping the Internet until...

  3. I reboot the Raspberry Pi, at which time, the dynamic ip is reassigned, and I have to start over at step (1) above.

I have found a very long thread devoted to a similar problem at

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=111709

although it does not seem like a clear solution is agreed upon. In particular I do not have "allow-hotplug eth0" in my /etc/network/interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions