Skip to content

virtual_net: vnet read from tun error: too many segments #4756

@synclab-srl

Description

@synclab-srl

Bug Description

Hi @fatedier

I started the client (100.86.0.1) and the vistors (100.86.0.2).
When on the visitors machine I try to access in ssh to the machine (ssh ubuntu@100.86.0.1) through the virtual network I get the following error:

FRPC CLIENT LOG:

2025-04-16 22:14:43.417 [I] [sub/root.go:149] start frpc service for config file [/proxy.toml]
2025-04-16 22:14:43.423 [I] [client/service.go:314] try to connect to server...
2025-04-16 22:14:43.423 [I] [client/service.go:184] virtual network controller start...
2025-04-16 22:14:43.485 [I] [client/service.go:306] [62e6a47ba63bd603] login to server success, get run id [62e6a47ba63bd603]
2025-04-16 22:14:43.486 [I] [proxy/proxy_manager.go:177] [62e6a47ba63bd603] proxy added: [138-virtual-net]
2025-04-16 22:14:43.510 [I] [client/control.go:172] [62e6a47ba63bd603] [138-virtual-net] start proxy success
2025-04-16 22:24:47.417 [W] [vnet/controller.go:189] [62e6a47ba63bd603] [138-virtual-net] server read error: read message length error: EOF

FRPC VISISTORS LOG:

2025-04-16 22:16:02.916 [I] [sub/root.go:149] start frpc service for config file [/proxy.toml]
2025-04-16 22:16:02.923 [I] [client/service.go:314] try to connect to server...
2025-04-16 22:16:02.923 [I] [client/service.go:184] virtual network controller start...
2025-04-16 22:16:03.036 [I] [client/service.go:306] [c2458c215c32e2a0] login to server success, get run id [c2458c215c32e2a0]
2025-04-16 22:16:03.037 [I] [visitor/virtual_net.go:94] [c2458c215c32e2a0] [vnet-138-visitor] Starting VirtualNetPlugin for visitor [vnet-138-visitor], attempting to register routes for 100.86.0.1/32
2025-04-16 22:16:03.037 [I] [visitor/visitor_manager.go:128] [c2458c215c32e2a0] start visitor success
2025-04-16 22:16:03.037 [I] [visitor/visitor_manager.go:179] [c2458c215c32e2a0] visitor added: [vnet-138-visitor]
2025-04-16 22:16:03.037 [I] [visitor/virtual_net.go:133] [c2458c215c32e2a0] [vnet-138-visitor] Attempting to register client route for visitor [vnet-138-visitor]
2025-04-16 22:16:03.037 [I] [visitor/virtual_net.go:149] [c2458c215c32e2a0] [vnet-138-visitor] Successfully registered client route for visitor [vnet-138-visitor]. Starting connection handler with CloseNotifyConn.
2025-04-16 22:16:13.328 [W] [vnet/controller.go:72] vnet read from tun error: too many segments
2025-04-16 22:16:13.328 [W] [client/service.go:186] virtual network controller exit with error: too many segments

frpc Version

0.62.0

frps Version

0.62.0

System Architecture

linux/amd64

Configurations

frpc client:

serverPort = 7835

auth.method = "token"
auth.token = "zzzzz"

transport.protocol = "tcp"

transport.tls.enable = false

featureGates = { VirtualNet = true }
virtualNet.address = "100.86.0.1/24"

[[proxies]]
name = "138-virtual-net"
type = "stcp"
secretKey = "zzzzz"
allowUsers = ["*"]
[proxies.plugin]
type = "virtual_net"

frpd visitors:

serverAddr = "mydomain.net"

serverPort = 7835

auth.method = "token"
auth.token = "zzzzz"

transport.protocol = "tcp"
transport.tls.enable = false

featureGates = { VirtualNet = true }
virtualNet.address = "100.86.0.2/24"

[[visitors]]
name = "vnet-138-visitor"
type = "stcp"
serverName = "138-virtual-net"
secretKey = "zzzzz"
bindPort = -1
[visitors.plugin]
type = "virtual_net"
destinationIP = "100.86.0.1"

Logs

client:

2025-04-16 22:14:43.417 [I] [sub/root.go:149] start frpc service for config file [/proxy.toml]
2025-04-16 22:14:43.423 [I] [client/service.go:314] try to connect to server...
2025-04-16 22:14:43.423 [I] [client/service.go:184] virtual network controller start...
2025-04-16 22:14:43.485 [I] [client/service.go:306] [62e6a47ba63bd603] login to server success, get run id [62e6a47ba63bd603]
2025-04-16 22:14:43.486 [I] [proxy/proxy_manager.go:177] [62e6a47ba63bd603] proxy added: [138-virtual-net]
2025-04-16 22:14:43.510 [I] [client/control.go:172] [62e6a47ba63bd603] [138-virtual-net] start proxy success
2025-04-16 22:24:47.417 [W] [vnet/controller.go:189] [62e6a47ba63bd603] [138-virtual-net] server read error: read message length error: EOF

visitors:

2025-04-16 22:16:02.916 [I] [sub/root.go:149] start frpc service for config file [/proxy.toml]
2025-04-16 22:16:02.923 [I] [client/service.go:314] try to connect to server...
2025-04-16 22:16:02.923 [I] [client/service.go:184] virtual network controller start...
2025-04-16 22:16:03.036 [I] [client/service.go:306] [c2458c215c32e2a0] login to server success, get run id [c2458c215c32e2a0]
2025-04-16 22:16:03.037 [I] [visitor/virtual_net.go:94] [c2458c215c32e2a0] [vnet-138-visitor] Starting VirtualNetPlugin for visitor [vnet-138-visitor], attempting to register routes for 100.86.0.1/32
2025-04-16 22:16:03.037 [I] [visitor/visitor_manager.go:128] [c2458c215c32e2a0] start visitor success
2025-04-16 22:16:03.037 [I] [visitor/visitor_manager.go:179] [c2458c215c32e2a0] visitor added: [vnet-138-visitor]
2025-04-16 22:16:03.037 [I] [visitor/virtual_net.go:133] [c2458c215c32e2a0] [vnet-138-visitor] Attempting to register client route for visitor [vnet-138-visitor]
2025-04-16 22:16:03.037 [I] [visitor/virtual_net.go:149] [c2458c215c32e2a0] [vnet-138-visitor] Successfully registered client route for visitor [vnet-138-visitor]. Starting connection handler with CloseNotifyConn.
2025-04-16 22:16:13.328 [W] [vnet/controller.go:72] vnet read from tun error: too many segments
2025-04-16 22:16:13.328 [W] [client/service.go:186] virtual network controller exit with error: too many segments

Steps to reproduce

  1. start client
  2. start visitor
  3. connect to client with virtual_net
    ...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions