
我有一台 OS X 10.6 機器,有兩個網路卡:
1 - 10.1.10.2
2 - 192.168.1.2
我想將連接埠 192.168.1.2:4096 上的所有流量轉送到 10.* 子網路 (10.1.10.42) 上的另一台電腦。我已經打開防火牆(ipfw)並添加了基本規則:
00100 divert 8668 ip from any to any via en1 (en1 is the interface with the 192* addr)
00200 allow ip from any to any
65535 allow ip from any to an
然後運行 natd:
sudo natd -v -l -a 192.168.1.2 en1 -dynamic -redirect_port tcp 10.1.10.42:3333 192.168.1.2:4096
在詳細模式下運作會給出:
In [TCP] [TCP] my_remote_ip:50116 -> 192.168.1.2:4096 aliased to
[TCP] my_remote_ip:50116 -> 10.1.10.42:3333
因此 natd 看到該連接,並認為它是別名,但嘗試的連接(在遠端電腦上)總是掛起並超時。
我已啟用 IP 轉送 ( sysctl -w net.inet.ip.forwarding=1
),但想不出任何其他原因導致此功能不起作用。
任何幫助,將不勝感激。