Skip to content

[Feature] support auto interface-name detection for proxies when dialing over vpn #1881

@wenerme

Description

@wenerme

验证步骤

  • 我已经阅读了 文档,确认了该功能没有实现
  • 我已在 Issue Tracker 中寻找过我要提出的功能请求,并且没有找到
  • 我是中文用户,而非其他语言用户

描述

I have multi interface, the proxy use private ip like 10.1.1.1, I have an tun interface 10.1.1.0/24, the interface name is dynamic (macOS can not set tun name), when I use 10.1.1.1 for mihomo proxy upsteam, mihomo will use dialer.DefaultInterface, this is the default interface like en0, but this interface can not handle 10.1.1.1.

I hope maybe there is a preprocess for proxies, which use NetworkUpdateMonitor to choose the right interface-name. e.g.

# this is the work around for onetime config update
.interface-name: &interface-name utun6
.server: &server 10.1.1.1

proxies:
- name: socks
  server: *server
  # interface-name: *interface-name
  interface-name: auto
  port: 1080
  <<: *socks

when interface-name: auto, the preprocessor will replace the interface name which match server, e.g. utun6 in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions