-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
添加 interface 指定出口网卡名称 #1494
添加 interface 指定出口网卡名称 #1494
Conversation
add Interface Name
add Interface Name
add Interface Name
transport/internet/config.pb.go
Outdated
@@ -425,6 +425,7 @@ type SocketConfig struct { | |||
TcpKeepAliveInterval int32 `protobuf:"varint,10,opt,name=tcp_keep_alive_interval,json=tcpKeepAliveInterval,proto3" json:"tcp_keep_alive_interval,omitempty"` | |||
TcpKeepAliveIdle int32 `protobuf:"varint,11,opt,name=tcp_keep_alive_idle,json=tcpKeepAliveIdle,proto3" json:"tcp_keep_alive_idle,omitempty"` | |||
TcpCongestion string `protobuf:"bytes,12,opt,name=tcp_congestion,json=tcpCongestion,proto3" json:"tcp_congestion,omitempty"` | |||
Interface string `protobuf:"bytes,12,opt,name=interface,json=interface,proto3" json:"interface,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work! Can you try update transport/internet/config.proto and then generate this file from protoc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I'll try.
再次感谢! |
这个配置参数与已有的 send_through (发送IP地址) 有什么样的不同意义呢? |
(@yuhan6665 麻烦把 commit message 改成英文) |
…vice like "eth0" (XTLS#1494) * Update sockopt_linux.go add Interface Name * Update config.pb.go add Interface Name * Update transport_internet.go add Interface Name * Update config.pb.go * update config.proto add interface * Update config.pb.go
那我只好强推了。。 |
Add new uTLS fingerprints && Refine the logic of security type AUTO && Make sure that 0 <= b.start <= b.end && Add sockopt interface setting for binding outbound to a particular device like "eth0" (XTLS#1494)
@aeeq @yuhan6665 似乎无法识别虚拟网卡,我用eht1:1、eth1:2这种命名的虚拟网卡会提示无法识别设备,但使用sendThrough这个参数指定虚拟网卡的ip是有用的 |
我是参考gost的代码改的,这个涉及系统底层api,估计很难改动了。我试了 curl --interface 也是不认虚拟网卡,应该是同样的道理。 |
这个出站流量重定向功能我有参考官方教程https://xtls.github.io/document/level-2/redirect.html#_3%E3%80%81%E5%90%AF%E7%94%A8-wireguard-%E7%BD%91%E7%BB%9C%E6%8E%A5%E5%8F%A3 xray三种的配置分别如下: ip -4 rule add from "192.168.244.1" lookup 2222 fwmark方式: ip -4 rule add fwmark 51820 lookup 51820 interface方式: {
// "sendThrough": "172.16.0.2", // Settings of the protocol. Varies based on protocol. "streamSettings": { |
我是个小白不懂,不过dns部分找v2ray白话文:https://guide.v2fly.org/basics/dns.html 解决了,实现上面的 socks2tun 功能 v2ray配置还需要使用 内置dns ,而且应注意freedom的 outbound 应配置了"domainStrategy"为"UseIP" | "UseIPv4" | "UseIPv6"几种的时候才会使用内置 DNS |
"outbounds": [
{
// Protocol name of the outbound proxy.
"protocol": "freedom",
// "sendThrough": "172.16.0.2",
"tag": "direct"
}]