請問如何做 port mapping? - Linux

Table of Contents

※ 引述《in3 (in3)》之銘言:
: 請問一下如何做 port mapping?
: 我目前有二台主機
: A主機 192.168.0.1
: B主機 192.168.0.2
: 如果我想用ssh連時 把192.168.0.1的port 1234
: 轉到 192.168.0.2:22。
: 請問有人知道怎麼做嗎?^^
: 或是提示我一些key word ,讓我google一下
: 謝謝 ^^
: ----

不知你的系統是什麼?

[root@appleboy-dorm][~][20:20:32]# apt-cache search ^redir
redir - Redirect TCP connections

apt-get install redir

裝好之後 就可以使用了

redir --lport=1234 --cport=22 --caddr=192.168.0.2 &

這樣就可以達到你要的功能 iptables 也可以

也可以用 tarball 安裝 http://sammy.net/~sammy/hacks/

安裝方式很容易~ 下載軟體 解壓縮 make 之後 就會產生執行檔

然後在把執行檔 複製到 /usr/sbin/底下 就好

--
********************************************************
* Appleboy Blog *
* http://blog.Wu-Boy.com/ *
* Appleboy Album *
* http://www.wretch.cc/album/appleboy *
********************************************************

--

All Comments

Thomas avatarThomas2006-12-02
謝謝appleboy46 ^^