1th ChapterCloud ServerECS Linuxaccess to intranet services via port forwarding
Front-facing conditions
Customer PC terminal can ssh login to the ECS server with public network .
There's a public network. ECS servers can access other intranet ECS servers via intranet .
There's a public network. ECS Server can access RDS via intranet (ECS 's intranet IP is in RDS Whitelist)
RINETD Configuration Method
1.1if it isUbuntusystem can be installed directly using the following instructions:
Apt-get Install Rinetd–y
1.2The following describes the source code installation configuration method (Centos,Redhat, etc.)
1. Download the extract rinetd package
wget http://www.boutell.com/rinetd/http/rinetd.tar.gz
TAR-XVF rinetd.tar.gz
CD rinetd
2. Modify the compilation configuration
Sed-i ' s/65536/65535/g ' rinetd.c# modify the port range, otherwise it will be an error
3. compiling the installation
Mkdir/usr/man #需要手动创建这个目录
Make #在rinetd目录下make和make Install
Make install #成功后会提示文件路径install-M rinetd/usr/sbin, where the program is placed
4. Create a configuration file
Cat >>/etc/rinetd.conf <<end
# Allow 192.168.2.*
# Deny 192.168.1.*
# bindadress Bindport connectaddress Connectport
0.0.0.0 3665 xxxxx.mysql.rds.aliyuncs.com 3306
Logfile/var/log/rinetd.log
End
5. put the boot on from
ECHO/USR/SBIN/RINETD >>/etc/rc.local
6. Start
/usr/sbin/rinetd-c/etc/rinetd.conf
7. Check if there is a port that you added
Netstat-lntup|grep rinetd
8. Stop program (used when closed)
Pkill rinetd
Precautions
1. the native port bound in the rinetd.conf must not be occupied by another program
2. the system firewall running rinetd should open the bound native port
RINETD Port Forwarding