精華區beta FreeBSD 關於我們 聯絡資訊
※ 引述《[email protected] (緣起甚深、緣起不滅)》之銘言: : 想要解決的問題算蠻常見也蠻單純的... : 就只是想要從外部網路(internet)能夠藉由 port 轉送到內部網路(internal) : 的 server 而已... 不過看了一堆資料@@ 設定也換了n遍了, : 還是沒辦法從外部網路成功連結到內部的 server. : 以下是我的設定, 勞煩各位有經驗的網友們能指教一下, 謝謝. : (目前環境是 dhcpd+natd 都能夠正確運作) : 使用 adsl 撥號上網, : #rc.conf : (對內) : ifconfig_fxp1="inet 192.168.0.1 netmask 255.255.255.0" : (對外) : ifconfig_fxp0="inet 192.168.1.2 netmask 255.255.255.0" : gateway_enable="YES" : firewall_enable="YES" : firewall_type="OPEN" : natd_interface="fxp0" ^^^^ natd_interface 不可以是內部IP ,要對外有效的 /etc/defaults/rc.conf 中 natd_interface 後面有註解 # Public interface or IPaddress to use. : natd_enable="YES" : natd_flags="-f /etc/natd.conf" : #rc.firewall : ${ipfw} -f flush : ${ipfw} add divert natd all from any to any via ${outif} : ${ipfw} add pass all from any to any : #natd.conf : dynamic yes : interface fxp0 : use_sockets yes : redirect_port tcp 192.168.0.166:5631 5631 (pcanywhere) : redirect_port udp 192.168.0.166:5632 5632 (pcanywhere) : redirect_port tcp 192.168.0.166:80 80 (www) : (192.168.0.166 的這些服務都是已經建立好的) : 拜託大家了... 謝謝. -- ※ Origin: 雲的故鄉 <mocsa.twbbs.org> ☆ From: 210-85-68-13.cm.apol.com.tw