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

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

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,可以在文章下面评论留言。