windows下的端口轉發通常用的是自帶的nat和porttunnel、portmap linux
linux下端口轉發映射的程序叫rinetd,啓動方法rinetd -c /etc/rinetd.conf ,pkill rinetd 關閉進程 windows
工具主頁: http://www.boutell.com/rinetd/ 工具
軟件下載,解壓安裝 .net
wget http://www.boutell.com/rinetd/http/rinetd.tar.gz
tar zxvf rinetd.tar.gz
make
make install
把1.1.1.1的11端口映射到2.2.2.2的3389端口,配置文件以下
[root@localhost iso]# cat /etc/rinetd.conf
1.1.1.1 11 2.2.2.1 3389
1.1.1.1 12 2.2.2.2 3389
1.1.1.1 13 2.2.2.3 22
1.1.1.1 14 2.2.2.4 80
allow *.*.*.*
logfile /var/log/rinetd.log
啓動程序
pkill rinetd ##關閉進程
rinetd -c /etc/rinetd.conf ##啓動轉發
把這條命令加到/etc/rc.local裏面就能夠開機自動運行
查看狀態
netstat -antup 進程