RINETD Port Forwarding

Source: Internet
Author: User


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

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.