[GH-ISSUE #3372] 没有IPv6的情况下怎么使用frp #2699

Closed
opened 2026-05-05 13:44:21 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @pengbohua on GitHub (Mar 28, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3372

Bug Description

Screenshot 2023-03-28 at 00 59 29 如图,公网PC和内网server均没有IPv6地址的情况下怎么实现内网穿透?

frpc Version

0.48.0

frps Version

0.48.0

System Architecture

linux/amd64

Configurations

frpc.ini

[common]
server_addr = x.x.x.x
server_port = 7000
tls_enable = true
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

Logs

connection
检查后发现根本没有IPv6地址怎么办?

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @pengbohua on GitHub (Mar 28, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3372 ### Bug Description <img width="1263" alt="Screenshot 2023-03-28 at 00 59 29" src="https://user-images.githubusercontent.com/35765640/228093122-f111861f-617b-4b8d-b09e-e8da8dad9a4c.png"> 如图,公网PC和内网server均没有IPv6地址的情况下怎么实现内网穿透? ### frpc Version 0.48.0 ### frps Version 0.48.0 ### System Architecture linux/amd64 ### Configurations # frpc.ini [common] server_addr = x.x.x.x server_port = 7000 tls_enable = true [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 ### Logs connection 检查后发现根本没有IPv6地址怎么办? ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [X] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [X] Others
gitea-mirror 2026-05-05 13:44:21 -06:00
Author
Owner

@superzjg commented on GitHub (Mar 28, 2023):

虽然frp本身支持ipv6,但大部分人使用ipv4进行内网穿透,为了兼容不同的网络环境。

使用ipv6时,服务端地址开启ipv6,然后客户端server_addr参数设为ipv6地址即可。如果像你图上那样没有ipv6,自然不能用。

<!-- gh-comment-id:1486394949 --> @superzjg commented on GitHub (Mar 28, 2023): 虽然frp本身支持ipv6,但大部分人使用ipv4进行内网穿透,为了兼容不同的网络环境。 使用ipv6时,服务端地址开启ipv6,然后客户端server_addr参数设为ipv6地址即可。如果像你图上那样没有ipv6,自然不能用。
Author
Owner

@pengbohua commented on GitHub (Mar 28, 2023):

那这种情况下怎么只用ipv4做内网穿透呢?我按教程配置frps, 7000默认是ipv6的端口。我进一步尝试打开udp 8008,但是看不到端口。请问该怎么做?谢谢
./frps -c frps.ini
2023/03/28 10:41:33 [I] [root.go:206] frps uses config file: frps.ini
2023/03/28 10:41:33 [I] [service.go:200] frps tcp listen on 0.0.0.0:7000
2023/03/28 10:41:33 [I] [service.go:302] nat hole udp service listen on 0.0.0.0:8008
2023/03/28 10:41:33 [I] [root.go:215] frps started successfully

公网服务器端口信息如下:
netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp6 0 0 :::7000 :::* LISTEN 11664/./frps

<!-- gh-comment-id:1486633690 --> @pengbohua commented on GitHub (Mar 28, 2023): 那这种情况下怎么只用ipv4做内网穿透呢?我按教程配置frps, 7000默认是ipv6的端口。我进一步尝试打开udp 8008,但是看不到端口。请问该怎么做?谢谢 ./frps -c frps.ini 2023/03/28 10:41:33 [I] [root.go:206] frps uses config file: frps.ini 2023/03/28 10:41:33 [I] [service.go:200] frps tcp listen on 0.0.0.0:7000 2023/03/28 10:41:33 [I] [service.go:302] nat hole udp service listen on 0.0.0.0:8008 2023/03/28 10:41:33 [I] [root.go:215] frps started successfully 公网服务器端口信息如下: netstat -nltp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN - tcp6 0 0 :::7000 :::* LISTEN 11664/./frps
Author
Owner

@superzjg commented on GitHub (Mar 29, 2023):

那这种情况下怎么只用ipv4做内网穿透呢?我按教程配置frps, 7000默认是ipv6的端口。我进一步尝试打开udp 8008,但是看不到端口。请问该怎么做?谢谢 ./frps -c frps.ini 2023/03/28 10:41:33 [I] [root.go:206] frps uses config file: frps.ini 2023/03/28 10:41:33 [I] [service.go:200] frps tcp listen on 0.0.0.0:7000 2023/03/28 10:41:33 [I] [service.go:302] nat hole udp service listen on 0.0.0.0:8008 2023/03/28 10:41:33 [I] [root.go:215] frps started successfully

公网服务器端口信息如下: netstat -nltp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN - tcp6 0 0 :::7000 :::* LISTEN 11664/./frps

不用管,可能是因为go语言,netstat 不准,实际上已经在监听ipv4

<!-- gh-comment-id:1487783728 --> @superzjg commented on GitHub (Mar 29, 2023): > 那这种情况下怎么只用ipv4做内网穿透呢?我按教程配置frps, 7000默认是ipv6的端口。我进一步尝试打开udp 8008,但是看不到端口。请问该怎么做?谢谢 ./frps -c frps.ini 2023/03/28 10:41:33 [I] [root.go:206] frps uses config file: frps.ini 2023/03/28 10:41:33 [I] [service.go:200] frps tcp listen on 0.0.0.0:7000 2023/03/28 10:41:33 [I] [service.go:302] nat hole udp service listen on 0.0.0.0:8008 2023/03/28 10:41:33 [I] [root.go:215] frps started successfully > > 公网服务器端口信息如下: netstat -nltp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN - tcp6 0 0 :::7000 :::* LISTEN 11664/./frps 不用管,可能是因为go语言,netstat 不准,实际上已经在监听ipv4
Author
Owner

@github-actions[bot] commented on GitHub (Apr 29, 2023):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1528312911 --> @github-actions[bot] commented on GitHub (Apr 29, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2699
No description provided.