Skip to content

WiFiClient cannot connect to IPv6 link local address #6626

Open
@Jamesits

Description

@Jamesits

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP8266MOD
  • Core Version: 2.5.2
  • Development Env: Arduino IDE
  • Operating System: Windows

Settings in IDE

  • Module: Wemos D1 R2 & mini
  • Flash Size: 4MB
  • lwip Variant: v2 IPv6 Higher Bandwidth
  • Reset Method: ck
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 921600

Problem Description

As per #5136, IPv6 is supported on the recent versions of ESP8266. However, I observed that WiFiClient.connect() is not able to connect to an IPv6 link-local IP address (fe80::/10) on the same network with the ESP8266.

MCVE Sketch

#include <ESP8266WiFi.h>

#define STA_SSID "your-ssid"
#define STA_PSWD "your-wifi-password"
#define SERVER_IP "fe80::aaaa:bbff:fecc:dddd"

IPAddress server;
WiFiClient client;

void setup() {
  Serial.begin(115200);

  WiFi.mode(WIFI_STA);
  WiFi.setAutoConnect(true);
  WiFi.setAutoReconnect(true);
  WiFi.begin(STA_SSID, STA_PSWD);
}

void loop() {
    Serial.println("\nStarting connection...");
    // if you get a connection, report back via serial:
    server.fromString(SERVER_IP);
    if (client.connect(server, 8000)) {
      Serial.println("connected");
      // Make a HTTP request:
      client.println("GET / HTTP/1.0");
      client.println();
    } else {
      Serial.println("Failed to connect");
    }
    delay(500);
}

Debug Messages

Sketch output:

Starting connection...
Failed to connect

I've done a packet capture on the server and can see NO packets from ESP8266.

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