需求:通过连接速率良好的服务器将80端口映射到连接速率不佳的源服务器的80端口,实现对WEB服务器的加速,类似反向代理,但所有解析到此IP的域名都可通过映射访问到源服务器。这里记录下centos7下通过firewall来实现的方法。
首先要开启转发功能:
vi /etc/sysctl.conf
添加一行:
net.ipv4.ip_forward = 1
让修改生效:
sysctl -p
输入命令,如果源服务器IP为a.a.a.a:
firewall-cmd --add-forward-port=port=80:proto=tcp:toaddr=a.a.a.a:toport=80
开启伪装IP:
firewall-cmd --add-masquerade --permanent
重启firewall使生效:
firewall-cmd --reload
到此CENTOS7下利用firewall进行端口映射加速WEB服务的设置就完成了。
Louise want to play with you! Start Play: https://sklbx.com/ny3g0ufO?tk7 [hs=cfeff217c0b79d15fb03dd11d824f247] 2022/05/17 03:11
8010p6
Have you ever tried this sex game before? GIVE IT A TRY: https://letsg0dancing.page.link/go?hs=cfeff217c0b79d15fb03dd11d824f247& 2022/08/23 22:56
5n235o