PCZONE 討論區

PCZONE 討論區 (https://www.pczone.com.tw/vbb3/)
-   -- FreeBSD & Linux 討 論 版 (https://www.pczone.com.tw/vbb3/forum/41/)
-   -   FreeBSD NAT (https://www.pczone.com.tw/vbb3/thread/41/28243/)

repsol 2002-01-13 10:43 PM

FreeBSD NAT
 
1.modify kernel


加入

options IPFIREWALL
options IPDIVERT


重新編譯新的kernel


save and config and make depend all install


2.modify /etc/rc.conf


firewall_enable="YES" # Set to YES to enable firewall functionality
firewall_script="/etc/rc.firewall" # Which script to run to set up the firewall
firewall_type="OPEN" # Firewall type (see /etc/rc.firewall)
firewall_quiet="YES" # Set to YES to suppress rule display
natd_program="/sbin/natd" # path to natd, if you want a different one.
natd_enable="YES" # Enable natd (if firewall_enable == YES).
natd_interface="vr0" #設成對外的那張網卡裝置


3.Modify /etc/services
natd 8668/divert


4.Modify /etc/rc.firewall


/sbin/ipfw add 60000 divert 8668 all from any to any via vr0


詳細的用法可以man ipfw


ps : rc.conf 或是rc.firewall 都是script file..
詳細的用法可以man rc


5.reboot


6.將client的gateway設向nat主機的內部ip...就可以了



[COLOR=red] WARNING!!WARNING!!WARNING!!WARNING!!WARNING!!WARNING!!WARNING!![/COLOR]

This program can put your computer in rather unusable state. When using
it for the first time, work on the console of the computer, and do NOT do
anything you don't understand.


所有時間均為 +8。現在的時間是 09:42 PM



 XML   RSS 2.0   RSS 
本站使用 vBulletin 合法版權程式
站務信箱 : [email protected]

本論壇所有文章僅代表留言者個人意見,並不代表本站之立場,討論區以「即時留言」方式運作,故無法完全監察所有即時留言,若您發現文章可能有異議,請 email :[email protected] 處理。