[GH-ISSUE #3230] [Feature Request] 是否有来源IP控制 #2591

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

Originally created by @Guation on GitHub (Dec 29, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3230

Describe the feature request

最近在检查frps日志的时候发现映射的ssh端口存在大量来自境外IP的连接请求 已经把sshd配置成了仅证书登录 但是这些爆破扫描一点没少 还是在锲而不舍的尝试连接 能不能在frps配置一个指定IP比如中国大陆IP连接ssh端口的时候就把数据转发到frpc可以尝试进行登录 境外IP连接ssh端口请求直接丢弃掉请求不响应任何数据

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @Guation on GitHub (Dec 29, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/3230 ### Describe the feature request 最近在检查frps日志的时候发现映射的ssh端口存在大量来自境外IP的连接请求 已经把sshd配置成了仅证书登录 但是这些爆破扫描一点没少 还是在锲而不舍的尝试连接 能不能在frps配置一个指定IP比如中国大陆IP连接ssh端口的时候就把数据转发到frpc可以尝试进行登录 境外IP连接ssh端口请求直接丢弃掉请求不响应任何数据 ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [X] Client Plugin - [X] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@Becods commented on GitHub (Dec 29, 2022):

善用iptables

<!-- gh-comment-id:1367291009 --> @Becods commented on GitHub (Dec 29, 2022): 善用iptables
Author
Owner

@Guation commented on GitHub (Dec 29, 2022):

善用iptables

那个加一两个IP还好 如果要过滤整个大陆IP还是太麻烦了

<!-- gh-comment-id:1367310390 --> @Guation commented on GitHub (Dec 29, 2022): > 善用iptables 那个加一两个IP还好 如果要过滤整个大陆IP还是太麻烦了
Author
Owner

@Becods commented on GitHub (Jan 1, 2023):

善用iptables

那个加一两个IP还好 如果要过滤整个大陆IP还是太麻烦了

没有什么是一个bash解决不了的

#!/bin/bash
for i in `curl https://www.ipdeny.com/ipblocks/data/countries/cn.zone|egrep -v "^#|^$"`;do
	/sbin/iptables -A INPUT -s $i -j DROP
done
<!-- gh-comment-id:1368367423 --> @Becods commented on GitHub (Jan 1, 2023): > > 善用iptables > > 那个加一两个IP还好 如果要过滤整个大陆IP还是太麻烦了 没有什么是一个bash解决不了的 ``` #!/bin/bash for i in `curl https://www.ipdeny.com/ipblocks/data/countries/cn.zone|egrep -v "^#|^$"`;do /sbin/iptables -A INPUT -s $i -j DROP done ```
Author
Owner

@Guation commented on GitHub (Jan 1, 2023):

善用iptables

那个加一两个IP还好 如果要过滤整个大陆IP还是太麻烦了

没有什么是一个bash解决不了的

#!/bin/bash
for i in `curl https://www.ipdeny.com/ipblocks/data/countries/cn.zone|egrep -v "^#|^$"`;do
	/sbin/iptables -A INPUT -s $i -j DROP
done

谢谢

<!-- gh-comment-id:1368372357 --> @Guation commented on GitHub (Jan 1, 2023): > > > 善用iptables > > > > > > 那个加一两个IP还好 如果要过滤整个大陆IP还是太麻烦了 > > 没有什么是一个bash解决不了的 > > ``` > #!/bin/bash > for i in `curl https://www.ipdeny.com/ipblocks/data/countries/cn.zone|egrep -v "^#|^$"`;do > /sbin/iptables -A INPUT -s $i -j DROP > done > ``` 谢谢
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#2591
No description provided.