RPI3 Network Manager fallback to auto ip if no DHCP available

I am looking if there is some guidance on being able to do automatic private IP (APIPA) in the scenario when a RPI3 device is connected directly over ethernet to a computer. If I plug in the PIs ethernet to my network then obviously I get assigned an IP address from the router which is great. I can then discover it using zeroconfig and get both an IPv4 and IPv6 address. If I plug the PIs ethernet directly into a computer, the PI gets no IPv4 address only its IPV6 address. I can still discover using avahi or using ping6 but I can not connect to a web server for example using a browser given the IPv6 address nor use its zeroconfig/bonjour address.

I would imagine this being a fairly typical scenario. Plug ethernet into router and get assigned an IPv4 address as well as plug directly to a computer and perform auto ip (169.254..).

I know this post is a bit old, but I’m still having this exact same issue. I’m attempting to run some Balena devices on a network with no DHCP server, just all link-local addressing. It’s not falling back to autoip however.

Is there some configuration I can change (maybe in NetworkManager config) that will allow this to work?

Thanks,

  • Darryl

So for anyone looking to do something similar, this worked for me.

You need to create 2 network connection files in boot/system-connections. One for DHCP, and one for link-local fallback.

ethernet-auto

[connection]
id=ethernet-auto
type=ethernet
autoconnect=yes
autoconnect-priority=1
autoconnect-retries=2
interface-name=eth0


[ipv4]
method=auto
may-fail=no
dhcp-timeout=2

[ipv6]
method=disabled

ethernet-local

[connection]
id=ethernet-local
type=ethernet
interface-name=eth0
autoconnect=yes
autoconnect-priority=0
autoconnect-retries=-1
may-fail=yes

[ipv4]
method=link-local

[ipv6]
method=disabled
1 Like

Thanks for sharing the solution that worked for you @woodzie

Could you please tell us more about your use case where you do not need a DHCP server on your network? Thanks :slight_smile: