RINETD forwarding to intranet RDS via ECS port

Source: Internet
Author: User

Front-facing conditions

To achieve the purpose: to develop the local computer needs to connect with no network address of the RDS, through the ECS forwarding connection to the RDS database

Client PC terminal can SSH login to the ECS server with public network.

ECS servers with a public network can access other intranet ECS servers through the intranet.

ECS Server with public network can access RDS via intranet (ECS's intranet IP is in RDS Whitelist)

1.1 If it is an Ubuntu system, you can install it directly using the following instructions:
Apt-get Install Rinetd–y
1.2 The 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.GZTAR-XVF RINETD.TAR.GZCD 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 installmake 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 connectport0.0.0.0 3665 xxxxx.mysql.rds.aliyuncs.com 3306    #这就是RDS的内网地址和端口号, viewing logfile/var/log/rinetd.log in the console                       #存放日志的地方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

1.3 Navicat for MySQL uses an ECS server to connect to the RDS database 1.3.1:

https://pan.baidu.com/s/1o7owjfg?errno=0&errmsg=auth%20login%20sucess&&bduss=&ssnerror=0& Traceid= #list/path=%2f

Registration code: NAVH-WK6A-DMVK-DKW3

1.3.2 Installation using Navicat

Find the downloaded file open Navicat.exe

To register

Just enter the secret key.

1.4 Using the tool to connect the online RDS database

RINETD forwarding to intranet RDS via ECS port

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.