惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
博客园_首页
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
D
Docker
博客园 - 司徒正美
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
U
Unit 42
J
Java Code Geeks
A
About on SuperTechFans
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security Affairs
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
T
Threatpost
H
Hacker News: Front Page
G
Google Developers Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
S
Secure Thoughts
GbyAI
GbyAI
NISL@THU
NISL@THU
S
Security @ Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
O
OpenAI News
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog

Rat's Blog - 端口转发

Socat一键安装脚本,可转发TCP和UDP流量 - Rat's Blog 使用socat进行单个端口的转发,同时支持tcp和udp - Rat's Blog 使用iptables进行端口转发 - Rat's Blog Haproxy安装及端口转发配置 - Rat's Blog
Linux安装rinetd实现TCP端口转发,可加速网站 - Rat's Blog
博主: Rat's · 2018-04-04 · via Rat's Blog - 端口转发

说明:网站服务器在国外的如果延迟很高,网络爆炸,会造成国内访问放慢,可以使用CDN加速,自建教程查看:使用Nginx反向代理,自建CDN加速节点,不过设置方法对于新手很不友好,这里再说个方法,可以使用rinetd转发端口来加速网站。当然也可以用来加速一些55rDaiL

安装

1、安装依赖

#CentOS系统
yum -y install gcc make

#Debian/Ubuntu系统
apt update
apt install gcc make -y

2、安装rinetd

#下载rinetd
wget https://boutell.com/rinetd/http/rinetd.tar.gz
#解压
tar -zxvf rinetd.tar.gz
#创建手册目录
mkdir -p /usr/man/man8
#进入目录
cd rinetd
#编译安装
make && make install

设置

接下来设置TCP端口转发。

1、新建rinetd配置文件

vi /etc/rinetd.conf

2、添加转发配置

#源IP一般填0.0.0.0
源IP 源端口 目标IP 目标端口

如果是转发https网站,则填入下面参数,自行修改。

0.0.0.0 80 100.61.126.101 80
0.0.0.0 443 100.61.126.101 443

意思是将本地80/443端口转发到100.61.126.10180/443端口。

3、启动rinetd

rinetd -c /etc/rinetd.conf

启动后可以输入netstat -apn|grep 'rinetd'查看是否运行正常。

注意还需要在自己服务器防火墙放行对应的源端口,否则无法正常使用用。

#防火墙关闭
service iptables stop

#CentOS 7
systemctl stop firewalld.service
systemctl disable firewalld.service

这时候可以修改本地host文件,位置C:\Windows\System32\drivers\etc\hosts,添加:

源IP 转发的网站
#如
100.600.100.101 moerats.com

打开网站测试下速度。如果没问题,效果不错,就可以更改网站的DNS解析了,指向源IP地址即可。

说明:如果加速网站,请使用延迟低的服务器转发,建议ping下本地到源IP延迟,和源IP到目标IP延迟,如果加起来延迟过高,效果不好,就别转了,浪费时间。如果效果好,建议2个服务器都安装魔改BBR

文章参考:Linux安装rinetd实现TCP端口转发


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/576/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。