How to use AUTO-IP in lwip

Hi,
I am trying to setup link-local addressing of my nucleo F767ZI board. I understand there is support for it in the lwip stack, but It doesn’t seem to startup. I have added “LWIP_AUTOIP=1” in custom_targets.json

   #include "autoip.h"
   #include "LWIPStack.h"

 ...

    EthernetInterface eth;
    extern struct netif *netif_default;  
    nsapi_error_t res = eth.connect();
    autoip_start(netif_default);

   wait_ms(1000);
    SocketAddress addr;
    eth.get_ip_address(&addr);
    printf(" ip: %s \r\n", addr.get_ip_address());

Output is
ip: (null)

Is there any way to reach the default netif directly from Ethernet interface? In the EthernetInterface class netif_default is protected. Have anyone managed to run AUTOIP

Thank you
/Carl

Hi,
This is an old thread, but I just tested this feature in mbed 6.15.1 with the same board nucleo F767 and it seems to work OK. I configured the LWIP with these settings:

#define LWIP_AUTOIP 1
#define LWIP_DHCP_AUTOIP_COOP 1
#define LWIP_DHCP_AUTOIP_COOP_TRIES 3

…and I didn’t call autoip_start. It will take about 5s until the link-local address is available. So maybe if you add more delay between connect and get_ip_address, you can get the address?

I have tried these settings, but I only ever get this IP address: 169.254.34.0. Which one do you get? I don’t think this IP address with the zero at the end is correct, is it?