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

推荐订阅源

S
Secure Thoughts
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Securelist
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
K
Kaspersky official blog
WordPress大学
WordPress大学
I
Intezer
L
Lohrmann on Cybersecurity
V
Vulnerabilities – Threatpost
C
Check Point Blog
A
About on SuperTechFans
AWS News Blog
AWS News Blog
Latest news
Latest news
宝玉的分享
宝玉的分享
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cyber Attacks, Cyber Crime and Cyber Security
SecWiki News
SecWiki News
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
A
Arctic Wolf
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
V
V2EX
Scott Helme
Scott Helme
I
InfoQ
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
Recent Announcements
Recent Announcements
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
大猫的无限游戏
大猫的无限游戏
Webroot Blog
Webroot Blog
N
News and Events Feed by Topic
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
NISL@THU
NISL@THU
L
LangChain Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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