In windows, port forwarding generally uses built-in nat, porttunnel, and portmap.
The port forwarding ing program in linux is rinetd. The start method is rinetd-c/etc/rinetd. conf, and pkillrinetd is used to close the process.
Tools home: http://www.boutell.com/rinetd/
Download, decompress, and install the software
wgethttp://www.boutell.com/rinetd/http/rinetd.tar.gz
tarzxvfrinetd.tar.gz
make
makeinstall
Map port 11 of 1.1.1.1 to port 3389 of 2.2.2.2. The configuration file is as follows:
[Root @ localhostiso] # cat/etc/rinetd. conf
1.1.1.1112.2.2.13389
1.1.1.1122.2.2.23389
1.1.1.1132.2.2.322
1.1.1.1142.2.2.480
allow*.*.*.*
logfile/var/log/rinetd.log
Start the program
Pkillrinetd # Shut down the process
Rinetd-c/etc/rinetd. conf # start forwarding
Add this command to/etc/rc. local to run automatically upon startup.
View status
Netstat-antup
This article from the Linux community website (www.linuxidc.com) original link: http://www.linuxidc.com/Linux/2011-01/31287.htm
If you want to use iptables, you can use the following command.
WAN_IP=”202.106.0.20″
iptables-tnat-APREROUTING-ieth0-ptcp–dport2533-jDNAT–to192.168.1.88:80
iptables-tnat-APOSTROUTING-oeth0-s192.168.1.88-ptcp–sport80-jSNAT–to$WAN_IP:2533
The first sentence defines a variable.
The second sentence is to forward requests with port 2533 to port 80 of 192.168.1.88.
Third, modify the source address output from etho to 192.168.1.88, and the source address of the packet with port 80 to port 2533 of the local machine so that the recipient can receive
The data packet can be returned correctly.