Use rinetd to do port forwarding under CentOS

Source: Internet
Author: User
Tags pkill

Port forwarding under Windows is generally used with its own NAT and Porttunnel, Portmap

Linux Lower port forwarding mapping program called RINETD, Startup method Rinetd-c/etc/rinetd.conf, Pkill rinetd shutdown process

Tools Home: http://www.boutell.com/rinetd/

Software download, decompression and installation


    1. wget http://www.boutell.com/rinetd/http/rinetd.tar.gz

    2. Tar zxvf rinetd.tar.gz

    3. Make

    4. Make install

Map the 1.1.1.1 11 port to the 2.2.2.2 3389 port and the configuration file is as follows

[[email protected] ISO] #cat/etc/rinetd.conf

    1. 1.1.1.1 11 2.2.2.1 3389

    2. 1.1.1.1 12 2.2.2.2 3389

    3. 1.1.1.1 13 2.2.2.3 22

    4. 1.1.1.1 14 2.2.2.4 80

    5. Allow *.*.*.*

    6. Logfile/var/log/rinetd.log

Start the program
Pkill rinetd # #关闭进程
Rinetd-c/etc/rinetd.conf # #启动转发
Add this command to the/etc/rc.local and you can start the operation automatically.

View status
Netstat-antup


This article is from the Linux commune website (www.linuxidc.com) Source Link: http://www.linuxidc.com/Linux/2011-01/31287.htm

If you want to implement with iptables, you can use the command.

    1. Wan_ip= "202.106.0.20″

    2. Iptables-t nat-a prerouting-i eth0-p tcp–dport 2533-j dnat–to 192.168.1.88:80

    3. Iptables-t nat-a postrouting-o eth0-s 192.168.1.88-p tcp–sport 80-j snat–to $WAN _ip:2533


The first sentence defines a variable
The second sentence implements a 80 port that forwards a request to port 2533 to 192.168.1.88
The third sentence modifies the source address of the output from Etho to 192.168.1.88, the source address of the packet with port 80 is the native 2533 port so that the other party receives
The packet is returned correctly after the packet.

Use rinetd to do port forwarding under CentOS

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.