Dear 版上的先進,
我現在始用RouterOS做為家中的NAT
可是在做Port Forward時碰到下列的問題
當我在NAT規則中設定
/ip firewall nat
add action=masquerade chain=srcnat comment=Masquerade disabled=no
add action=dst-nat chain=dstnat comment=WWW disabled=no dst-port=80 in-interface=ether1 protocol=tcp to-addresses=10.10.10.199 to-ports=80
內部Server收到的是RouterIP而不是Visitor的Public IP
有沒有辦法可以在內部的Server知道Visitor的Public IP呢?
謝謝
shiori wrote:
Dear 版上的先進...(恕刪)
我猜測RouterOS是接在Visitor LAN後面.
假如Visitor Gateway是192.168.0.1
RouterOS ether1 分配的IP是192.168.0.2
RouterOS Gateway為10.10.10.1
伺服器A接在RouterOS上,IP為10.10.10.199
若要從網外連接伺服器A ,設定應該是:
/ip firewall nat
add action=scr-nat chain=srcnat comment=Visitor disabled=no out-interface=ether1 to-addresses=192.168.0.2
add action=dst-nat chain=dstnat comment=WWW disabled=no dst-port=80 in-interface=ether1 protocol=tcp to-addresses=10.10.10.199
不過Visitor也要對192.168.0.2 TCP:80設置PortForwading,光只針對RouterOS是沒意義的.
gfx wrote:
我猜測RouterO...(恕刪)
抱歉,
可能我描述的不夠清楚
在這邊的Visitor是指外部IP(Public)的訪客
目前我在RouterOS上使用一個PPPoE的介面(pppoe-1)對外連線
直接接到ATU-R上
而內部透過這個介面NAT上網
現在的問題是我透過兩條規則
/ip firewall nat
add action=masquerade chain=srcnat comment=Masquerade disabled=no <-此條做NAT
add action=dst-nat chain=dstnat comment=WWW disabled=no dst-port=80 in-interface=pppoe-1protocol=tcp to-addresses=10.10.10.199 to-ports=80 <-此條將port80連入倒到.199的機器
但在.199的機器log中
外部連線進來的IP Address都被換成RouterOS這台IP了, 非連入的Public IP.
想請教有沒有辦法可以正常使.199抓到正確的連入IP?
魚說:你看不見我的淚水,因為我在水中.....
水說:我能感覺到你的淚水,因為妳在我的心中...
內文搜尋

X