Skip to content

Mirrored networking: Wrong source address selection for multi-IP interfaces #13505

@fkdyufu

Description

@fkdyufu

Windows Version

Microsoft Windows [Version 10.0.26100.6584]

WSL Version

2.6.0.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

6.6.87.2-1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  1. Configure Windows interface with IPs: 192.168.9.147/24 and 192.168.101.147/24
  2. Add Windows route: 192.168.102.0/24 via 192.168.101.238
  3. In WSL2: ping 192.168.101.238
  4. Observe: Source address is incorrectly 192.168.9.147 instead of 192.168.101.147

Expected Behavior

WSL2 should select source address from the same subnet as the next-hop.

Actual Behavior

WSL2 creates route without source hint:
192.168.101.238 dev eth3 scope link
Should be:
192.168.101.238 dev eth3 src 192.168.101.147 scope link

Diagnostic Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions