Editor's note
Recently, as the company opened a customized project planning, for each project will open a test server, the implementation will use the test server SSH port, MySQL port, web port, in order to save resources (public IP, server resource reuse), based on the rinted tool to build a port forwarding server. The flowchart below will be a better way to express the functionality that this article is about to achieve!
1, source installation rinted:
Download and decompress the source package:
CD/USR/LOCAL/SRC && wget && tar XF rinetd.tar.gz && CD rinetd
To modify the compilation configuration:
Sed-i ' s/65536/65535/g ' rinetd.c# modify the port range, otherwise it will be an error
Compile and install:
Mkdir-p/usr/man/man8 && make && make install
Edit Profile:/etc/rinetd.conf
#自定义mysql端口: 3001/3100# custom SSH port: 2001/2500# custom Web port: 801/899# port forwarding: [Source Address] [source port] [Destination address] [Destination port]0.0.0.0 8080 10.124.162.114 80800.0.0.0 443 10.124.162.114 80800.0.0.0 3001 10.124.162.114 33080# port mapping: Bindaddress Bindport connectaddress Connectportlogfile/var/log/rinetd.log
Start and close:
#启动/usr/sbin/rinetd-c/etc/rinetd.conf #关闭pkill rinetd
Linux Port forwarding-rinted tool deployment, configuration, use