Rabu, 21 November 2007

Router pc on freebsd with pf

- Membuat Router pc dengan freebsd kita asumsikan
ip public = 202.91.11.229
ip ke lokal = 192.168.0.1
network LAN = 192.168.0.0/24

langkah-langkah :
1. karena dalam default kernel yang baru kita install tidak ada opsi ini jadi kita masukkan opsi2 yang di butuhkan
- setting kernel cd /usr/src/sys/i386/conf cp GENERIC ROUTER ee ROUTER
- masukkan ident ROUTER # harus sesuai dengan nama kernel
options IPDIVERT # untuk nat
device pf
device pflog
device pfsync
kemudian simpan konfigurasi

- Kompile kernel
pada konsole ketikkan : config ROUTER
cd ../compile/ROUTER # akan ditunjukan setelah ketik config ROUTER
make depend && make && make install

- IPforward ee /etc/sysctl.conf
net.inet.ip.forwarding = 1
save konfigurasi
- ee /etc/rc.conf
gateway_enable="YES"
pf_enable="YES" # Enable PF (load module if required)
pf_rules="/etc/pf.conf" # rules definition file for pf
pf_flags="" # additional flags for pfctl startup
pflog_enable="YES" # start pflogd(8)
pflog_logfile="/var/log/pflog" # where pflogd should store the logfile
pflog_flags=""
natd_enable = "YES"
natd_flags = "-s -u -m"
router_enable = "YES"

- ee /etc/pf.conf
aktifkan ext_if = "rl0" --> public
int_if = "rl1" --> local
nat on $ext_if from 192.168.0.0/24 to any -> 202.91.11.229
keluar dan save konfigurasi
ketikkan -pfctl -Fa -f /etc/pf.conf

jadi deh konfigurasi tuk router pc tuk ngetes langsung aja colook ke client tuk lan lokal nya terus ping ke google

0 komentar:

  © Free Blogger Templates Blogger Theme II by Ourblogtemplates.com 2008

Back to TOP