FreeBSD


Udah beberapa hari ini otak atik trial and error untuk mencari settingan terbaik untuk squid proxy server ku di dalam Box FreeBSD dengan jumlah user dibelakangnya… em… mungkin ratusan client :D

Begenilah namanya juga orang yang belajar selalu harus banyak trial and error untuk meng-uji hasil oprekannya… :p untuk dokumentasi menginstall squid di FreeBSD kayaknya gak ada aku buat coz tau sendirilah FreeBSD cantiknya gimana… bila bersanding dengan Ports-nya…

Sebenarnya ini jauh dari sempurna… butuh waktu dan referensi lagi untuk meng-explore-nya lagi agar lebih bisa dikatakan high performance. Aku seh udah cukup dengan settingan apa yang aku dapatkan sekarang… mungkin kedepanya sejalan dengan waktu dapat dikembangkan lagi agar kinerjanya lebih baik lagi tentunya…

Inilah yang aku gunakan untuk Box Proxy BSD-ku :

# ============================================== #
# NETWORK OPTIONS
# ============================================== #
http_port 3128 transparent
icp_port 3130
snmp_port 3401
# ============================================== #
# OPTIONS WHICH AFFECT THE NEIGHBOUR SELECTION ALGORITHM
# ============================================== #
dead_peer_timeout 30 seconds
mcast_icp_query_timeout 10
log_icp_queries on
connect_timeout 2 minutes
peer_connect_timeout 30 seconds
request_timeout 30 seconds
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
# ============================================== #
# OPTIONS WHICH AFFECT THE CACHE SIZE
# ============================================== #
cache_mem 8 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
maximum_object_size_in_memory 8 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
fqdncache_size 1024
cache_replacement_policy heap GDSF
memory_replacement_policy heap GDSF
# =============================================== #
# LOGFILE PATHNAMES AND CACHE DIRECTORIES
# =============================================== #
cache_dir diskd /cache1 12600 29 256 Q1=64 Q2=72
cache_dir diskd /cache2 12600 29 256 Q1=64 Q2=72
cache_dir diskd /cache3 12600 29 256  Q1=64 Q2=72
cache_dir diskd /cache4 12600 29 256 Q1=64 Q2=72
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /dev/null
mime_table /usr/local/etc/squid/mime.conf
# =============================================== #
# HTTPD-ACCELERATOR OPTIONS
# =============================================== #
log_ip_on_direct on
dns_nameservers 202.134.0.155 202.134.1.10 203.130.209.242 202.134.2.5
# =============================================== #
# MISCELLANEOUS
# =============================================== #
logfile_rotate 7
digest_generation on
digest_bits_per_entry 10
digest_rebuild_period 30 minute
digest_rewrite_period 30 minute
digest_swapout_chunk_size 6000 bytes
client_persistent_connections on
server_persistent_connections on
pipeline_prefetch on
store_dir_select_algorithm round-robin
nonhierarchical_direct off
prefer_direct off
# =============================================== #
# ADMINISTRATIVE PARAMETERS
# =============================================== #
cache_mgr admin_waluh@dodol.net
cachemgr_passwd 123456 all
cache_effective_user nobody
cache_effective_group nobody
visible_hostname proxy.dodol.net
# =============================================== #
# OPTIONS FOR EXTERNAL SUPPORT PROGRAMS
# ============================================== #
unlinkd_program /usr/local/libexec/squid/unlinkd
pinger_program /usr/local/libexec/squid/pinger
# ============================================== #
# ACCESS CONTROLS
# ============================================== #
acl all src 0/0
acl localnet src 192.168.1.0/24
acl localhost src 127.0.0.0/8
# ============================================== #
# ACL Different access
# ============================================== #
acl SSL_ports port 443 563
acl Safe_ports port 21 80 280 448 591 777 443 563 808 70 210 4190-65535
acl CONNECT method CONNECT
acl purgemethod method purge
acl snmp snmp_community snmpcomunity
acl manager proto cache_object
# ============================================== #
# BLOCKING CONTENTS
# ============================================== #
acl bad url_regex “/usr/local/etc/squid/blocker/bad.acl”
acl mikocok urlpath_regex msdownload/update/v3-19990518/cabpool
http_access deny bad
http_access deny mikocok
# ============================================== #
# Access Denied
# ============================================== #
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
# ============================================== #
# Internet Access
# ============================================== #
http_access allow manager !localhost
http_access allow purgemethod localhost
http_access allow localnet
http_access deny all
# ============================================== #
# htttp access user
# SNMP – MRTG Setting
# ============================================== #
snmp_access allow snmp localhost
snmp_access deny all
# ============================================== #
# TRAFFIC SHAPPING
# ============================================== #
acl lokal url_regex -i 192.168.1.
acl lambat url_regex -i “/usr/local/etc/squid/blocker/limit.txt”
## Delay Pool
# -1/-1 >> no limits untuk local traffic.
delay_pools 2
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_access 1 allow lokal
delay_access 1 deny all
# Bandwidth 2,8 Mbps >> (((2,8*1024)*1024)/8) >> 367001.6 B/s
# Alokasi 367 KB/s >> network, 3 KB/s >> download lambat
delay_class 2 2
delay_parameters 2 367000/367000 3000/367000
delay_access 2 allow lambat
delay_access 2 deny all
# Dilarang Download file lebih dari 700 MB
reply_body_max_size 700000000 allow all
# Dilarang Upload file lebih dari 5 MB
request_body_max_size 5 MB
# =============================================== #

Aku sendiri cukup sampai situ aza konfigurasi untuk squid proxy server ku… Alhamdulillah Traffic udah bisa dikendalikan dengan normal… :)

Untuk Isi file-file bad.acl dan file limit.txt dapat di edit dan disesuaikan dengan kondisi dan situasi…
Disini Aku sendiri membuat file bad.acl yang berisi site content yang akan aku block disisi user/client, ambil contoh seperti site-site porno, content/extensi tertentu, banner-banner, … pokoknya apa lah yang dikira terlarang atau tidak boleh di akses oleh user/client.

Contoh isi file bad.acl bisa seperti ini :

^http://www\.submit-it.*
^http://ads01.*
^http://www\.eads.*
^http://ads\.
^http://ad\.
^http://ads02\.
^http://adaver.*\.
^http://adforce\.
/images/[Aa][Dd]/
/reklame/
/[Bb]anners/
17tahun
miyabi
sex
\.3[Gg][Pp]$

Dan lain-lain lah… disesuaikan saja…

Dan untuk file kedua, :) maksutnya file limit.txt adalah file yang berisi daftar extensi untuk file-file yang dibatasi downloadnya. Jadi, apabila user/client mendownload file yang extensinya masuk dalam daftar didalam file limit.txt makan speed atau kecepatan download user akan dibatasi dengan menggunakan delay pool. :D

Contoh isi dari file limit.txt :

\.[Gg][Zz]$
\.[Rr][Pp][Mm]$
\.[Zz][Ii][Pp]$
\.[Rr][Aa][Rr]$
\.[Mm][Pp][Ee]$
\.[Qq][Tt]$
\.[Rr][Aa][Mm]$
\.[Ii][Ss][Oo]$
\.[Rr][Aa][Ww]$
\.[Ww][Aa[Vv]$
\.[Dd][Ee][Bb]$
\.[Cc][Aa][Bb]$
\.[Rr][Mm]$
\.[Mm][Pp]$
\.[Mm][Pp][Gg]$
\.[Mm][Pp][Ee][Gg]$
\.[Ww][Mm][Vv]$
\.[Ww][Mm][Aa]$
\.[Mm][Oo][Vv]$
\.[Aa][Vv][Ii]$
\.[Mm][Pp][Gg]$
\.[Mm][Pp][Ee][Gg]$
\.[Ee][Xx][Ee]$
\.[Mm][Pp]3$
\.[Mm][Pp]4$
\.[Vv][Qq][Ff]$
\.[Ee][Xx][Ee]$
\.[Tt][Aa][Rr].[Gg][Zz]$
\.[Bb][Zz]2$

Selebihnya silahkan disesuaikan ! :D

Kenapa dibatasi ? Ini terkait dengan stabilitas dan normalisasi penggunaan bandwidth… agar user/client tidak se-enaknya menggunaakn bandwidth secara penuh yang akan berakibar tergangunya interkoneksi internet user yang lain.

Sebenarnya ini bertujuan untuk mendidik user/client untuk dapat menggunakan bandwidth mereka dengan bijak. Maklumlah di Indonesia bandwidth masih merupakan barang mahal… dan tidak semua orang dapat menikmatinya…

source : http://adityaperdana.web.id

Installasi squid di FreeBSD

Perangkat yang digunakan untuk ngoprek

Pentium III 300MHz, RAM 128, HD 20GB dengan partisi sebagai berikut :
/swap : 256MB
/cache : 16000MB
/ : Sisanya

Langkah Kerja

Instal Squid

sarangku# tar -zxvf squid-2.5.STABLE5.tar.gz
sarangku# cd squid-2.5.STABLE5
./configure –enable-delay-pools –enable-ipf-transparent –enable-storeio=diskd,ufs –enable-storeio=diskd,ufs –disable-ident-lookups –enable-snmp –enable-removal-policies
sarangku# make
sarangku# make install
sarangku# pw useradd squid
sarangku# pw addgroup squid
sarangku# cd /
sarangku# chown squid:squid cache
sarangku# cd /usr/local/squid/var/logs
sarangku# touch access.log
sarangku# touch cache.log
sarangku# chown squid:squid *
sarangku# mkdir /usr/local/squid/cache
sarangku# cd /usr/local/squid/
sarangku# chown nobody:nogroup cache
sarangku# cd /usr/local/squid/etc/
sarangku# cp squid.conf squid.conf.old
sarangku# rm -rf squid.conf
sarangku# touch squid.conf
sarangku# ee /usr/local/squid/etc/squid.conf

Contoh Konfigurasi squid.conf

http_port 192.168.0.14:8080
icp_port 3130
icp_query_timeout 0
maximum_icp_query_timeout 5000
mcast_icp_query_timeout 2000
dead_peer_timeout 10 seconds
hierarchy_stoplist cgi-bin ? js
acl QUERY urlpath_regex cgi-bin ?
no_cache deny QUERY
cache_mem 64 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 8 KB
ipcache_size 1024
ipcache_low 90
ipcache_high 95
cache_replacement_policy lru
memory_replacement_policy lru
cache_dir diskd /cache 16000 16 256 Q1=72 Q2=64
cache_access_log /usr/local/squid/var/logs/access.log
cache_log /usr/local/squid/var/logs/cache.log
cache_store_log none
emulate_httpd_log off
log_ip_on_direct on
ftp_user support@pdg.asiamaya.net
wais_relay_port 0
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
quick_abort_min 16 KB
quick_abort_max 16 KB
quick_abort_pct 95
negative_ttl 5 minute
positive_dns_ttl 6 hour
negative_dns_ttl 5 minute
range_offset_limit 0 KB
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl IIX dst_as 7713 4622 4795 7597 4787 4795 4800
acl sarangku src 192.168.0.0/24
acl SSL_ports port 443 563
acl irc_ports port 6667
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443 563
acl Safe_ports port 70
acl Safe_ports port 210
acl Safe_ports port 1025-65535
acl Safe_ports port 280
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 777
acl CONNECT method CONNECT
http_access allow manager localhost
http_access allow sarangku
http_access allow IIX
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow CONNECT !irc_ports
http_access deny all
icp_access allow all
connect_timeout 2 minute
peer_connect_timeout 30 seconds
read_timeout 15 minute
request_timeout 30 second
client_lifetime 5 day
pconn_timeout 120 second
shutdown_lifetime 30 second
cache_mgr support@pdg.asiamaya.net
cache_effective_user squid
cache_effective_group squid
visible_hostname proxy.pdg.asiamaya.net
logfile_rotate 10
forwarded_for on
log_icp_queries off
icp_hit_stale off
minimum_direct_hops 4
minimum_direct_rtt 400
store_avg_object_size 13 KB
store_objects_per_bucket 20
client_db off
netdb_low 900
netdb_high 1000
netdb_ping_period 5 minutes
query_icmp on
test_reachability on
nonhierarchical_direct off
prefer_direct on
ignore_unknown_nameservers on
high_memory_warning 0
store_dir_select_algorithm round-robin
ie_refresh on
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

Backup Kernel Anda

sarangku# cd /usr/src/sys/i386/conf
sarangku# cp GENERIC SARANGKU
sarangku# ee SARANGKU
Ganti ident GENERIC menjadi SARANGKU
ident SARANGKU
maxusers 0

#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols

#Mengaktifkan NatD dan IPFW

options IPFIREWALL
options IPDIVERT
options IPFIREWALL_DEFAULT_TO_ACCEPT

#DiskD
options SYSVMSG
options MSGMNB=8192 # max # of bytes in a queue
options MSGMNI=40 # number of message queue identifiers
options MSGSEG=512 # number of message segments per queue
options MSGSSZ=64 # size of a message segment
options MSGTQL=2048 # max messages in system

options SYSVSHM
options SHMSEG=16 # max shared mem id’s per process
options SHMMNI=32 # max shared mem id’s per system
options SHMMAX=2097152 # max shared memory segment size (bytes)
options SHMALL=4096 # max amount of shared memory (pages)

#Transparent Proxy
options IPFIREWALL_VERBOSE #print information about

# Dropped Packets
options IPFIREWALL_FORWARD #enable transparent proxy support
options IPFIREWALL_VERBOSE_LIMIT=100 #limit verbosity

Kompile Kernel Anda

sarangku# config SARANGKU
sarangku# cd ../../compile/SARANGKU
sarangku# make depend && make && make install && reboot

Buat Startup Script

sarangku# touch /usr/local/etc/rc.d/squid.sh
sarangku# chmod +x /usr/local/etc/rc.d/squid.sh
sarangku# ee /usr/local/etc/rc.d/squid.sh

#!/bin/sh

echo -n ‘Proxy Server’

case “$1″ in
start)
/usr/local/squid/sbin/squid -D
;;
stop)
/usr/local/squid/sbin/squid -k shutdown
;;
restart)
/usr/local/squid/sbin/squid -k reconfigure
;;
*)
echo “Usage: `basename $0` {start|stop|restart}”
;;
esac

Jalankan Squid

sarangku# /usr/local/squid/sbin/squid -z
ini akan membuat swap direktori
sarangku# /usr/local/etc/rc.d/squid.sh start atau
sarangku# /usr/local/squid/sbin/squid -D

Mengecek Squid di Background

sarangku# ps ax | grep squid
15 ?? Is 0:00.01 /usr/local/squid/sbin/squid -D
162 ?? S 1:57.06 (squid) -D (squid)
567 p0 S+ 0:00.00 grep squid

Bila sudah muncul seperti tampilan diatas sewaktu menjalankan squid -D, berarti Squid Anda sudah berjalan

Mengecek Access Log-nya

sarangku# tail -f /usr/local/squid/var/logs/access.log

1082023675.284 9457 192.168.1.7 TCP_MISS/200 1528 GET http://www.jpegworld.com/index2.shtml – DIRECT/64.237.52.26 text/html
1082023676.844 8242 192.168.1.9 TCP_MISS/403 1488 GET http://xxxfantasy.cheapbw.com/pg1/asian.jpg – DIRECT/69.90.63.91 text/html
1082023678.712 12044 192.168.1.7 TCP_MISS/200 4372 GET http://66.111.39.232/julove/2240f53u.jpg – DIRECT/66.111.39.232 image/jpeg

Pastikan bahwa tulisan seperti diatas selalu bergerak bila usernya sedang membuka situs. Supaya script diatas selalu tersimpan waktu mesin di reboot, bisa dimasukkan dalam file startup

sarangku# touch /etc/rc.local
sarangku# ee /etc/rc.local

#Running Proxy Server
/usr/local/etc/rc.d/squid.sh start
#Forwarding
/sbin/ipfw add 350 fwd 192.168.0.14,8080 tcp from 192.168.0.0/24 to any www
/usr/local/snmp/sbin/snmpd

Selamat Mencoba, Semoga Berhasil

Install Web Server

: Yang dibutuhkan adalah source-source berikut :

1. mysql-3.22.32.tar.gz
2. apache_1.3.26.tar.gz
3. php-4.1.2.tar.gz
4. openssl-0.9.6d.tar.gz
5. mod_ssl-2.8.10-1.3.26.tar.gz

: Kita Download dulu Source Codenya :

server# pwd
/usr/local/src
server# wget http://sunsite.bilkent.edu.tr/pub/mysql/Downloads/MySQL-3.22/mysql-3.22.32.tar.gz
server# wget http://ftp.inet.ufop.br/adm/SO/freebsd/ports/apache_1.3.26.tar.gz
server# wget http://museum.php.net/php4/php-4.1.2.tar.gz
server# wget http://ftp.inet.ufop.br/adm/SO/freebsd/ports/openssl-0.9.6d.tar.gz
server# wget http://ftp.inet.ufop.br/adm/SO/freebsd/ports/mod_ssl-2.8.10-1.3.26.tar.gz
: Install MySQL-nya Dulu :

unpack source nya, compile dan Install :

server# tar -xzvf mysql-3.22.32.tar.gz
server# cd mysql-3.22.32/
server# ./configure –prefix=/usr/local/src/mysql
server# make
server# make install
server# ./scripts/mysql_install_db

Creating db table
Creating host table
Creating user table
Creating func table
Creating tables_priv table
Creating columns_priv table

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/local/src/mysql/bin/mysqladmin -u root password ‘new-password’
See the manual for more instructions.

Please report any problems with the /usr/local/src/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at http://www.mysql.com
Support MySQL by buying support/licenses at http://www.tcx.se/license.htmy.

: Menjalankan MySQL :

server# cd /usr/local/mysql/bin
server# ./safe_mysqld &
[1] 24269
server# Starting mysqld daemon with databases from /usr/local/mysql/var

: Unpack Apachenya Dulu :

server# cd /usr/local/src/
server# tar -xzvf apache_1.3.26.tar.gz
server# cd apache_1.3.26/
server# ./configure –prefix=/usr/local/src/apache

Configuring for Apache, Version 1.3.26
+ using installation path layout: Apache (config.layout)
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
+ configured for FreeBSD 4.4 platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
+ using builtin Expat
+ checking sizeof various data types
+ doing sanity check on compiler and options
Creating Makefile in src/support
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/lib/expat-lite
Creating Makefile in src/modules/standard

: Install PHP :

server# cd ..
server# tar -xzvf php-4.1.2.tar.gz
server# cd php-4.1.2/
server# ./configure –with-mysql=/usr/local/src/mysql
? –with-xml
? –with-apache=/usr/local/src/apache_1.3.26
? –enable-track-vars
+——————————————————————–+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+——————————————————————–+
Thank you for using PHP.

server# make
server# make install
server# cp php.ini-dist /usr/local/lib/php.ini
server# cd ..

: Instal opensslnya dulu :

server# tar -zxvf openssl-0.9.6d.tar.gz
server# cd openssl-0.9.6d/
server# ./config –prefix=/usr/local/src/ssl
server# make
server# make test
server# make install

: Instal mod_ssl :

server# cd ..
server# tar -zxvf mod_ssl-2.8.10-1.3.26.tar.gz
server# cd mod_ssl-2.8.10-1.3.26
server# ./configure –with-apache=/usr/local/src/apache_1.3.26

Done: source extension and patches successfully applied.

Now proceed with the following commands (Bourne-Shell syntax):
$ cd /usr/local/src/apache_1.3.26
$ SSL_BASE=/path/to/openssl ./configure … –enable-module=ssl
$ make
$ make certificate
$ make install

server# cd ..

: Install Apache :

server# cd apache_1.3.26/
server# ./configure
server# –enable-module=ssl
–activate-module=src/modules/php4/libphp4.a
–enable-module=php4
–prefix=/usr/local/src/httpd
–enable-shared=ssl

Creating Makefile in src/support
Creating Makefile in src/os/unix
Creating Makefile in src/ap
Creating Makefile in src/main
Creating Makefile in src/lib/expat-lite
Creating Makefile in src/modules/standard
Creating Makefile in src/modules/ssl
Creating Makefile in src/modules/php4

server# make
server# make certificate TYPE=custom
server# make install
+——————————————————–+
| You now have successfully built and installed the |
| Apache 1.3 HTTP server. To verify that Apache actually |
| works correctly you now should first check the |
| (initially created or preserved) configuration files |
| |
| /usr/local/src/httpd/conf/httpd.conf
| |
| and then you should be able to immediately fire up |
| Apache the first time by running: |
| |
| /usr/local/src/httpd/bin/apachectl start
| |
| Or when you want to run it with SSL enabled use: |
| |
| /usr/local/src/httpd/bin/apachectl startssl
| |
| Thanks for using Apache. The Apache Group |
| http://www.apache.org/ |
+——————————————————–+

: Selesai :

: Konfigurasi Apache :

Edit httpd.conf yang berada di /usr/local/src/httpd/conf/httpd.conf,

server# ee /usr/local/src/httpd/conf/httpd.conf

dan tambahkan baris berikut :

AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

: Mari kita Jalankan apache :

# /usr/local/src/httpd/bin/apachectl start

: Untuk menjalankan apache dengan mode SSL :

# /usr/local/src/httpd/bin/apachectl startssl

Menjalankan dengan mode SSL, kita akan diminta memasukkan pass-phrase nya.
apabila kita tidak ingin memasukkan pass-phrase setiap kali apache di jalankan, lakukan langkah-langkah berikut :

1. Hilangkan enkripsi dari RSA private key ( dan kita backup file aslinya ) :

# cd /usr/local/apache/conf/ssl.key/
# cp server.key server.key.org
# openssl rsa -in server.key.org -out server.key

2. Pastikan file server.key hanya terbaca oleh root:

# chmod 400 server.key

Selamat Mencoba, Semoga Berhasil

: Referensi :

Untuk ambil source codenya, silahkan rujuk site berikut ini :
- http://ftp.inet.ufop.br/adm/SO/freebsd/ports/
- http://museum.php.net/php4/
- http://www.freebsd-docs.netfirms.com/

Contoh Config Router Warnet dengan FreeBSD

login as: areksitiung
Using keyboard-interactive authentication.
Password:
Last login: Mon Nov 24 17:51:25 2008 from 203.130.207.181
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.

FreeBSD 5.3-RELEASE (NOVERNET) #0: Thu Feb 28 23:59:06 UTC 2008

Welcome to Proxy+Router NoverNet Jati GP

+++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++
+++ +++
+++ ATTENTION! +++
+++ You’re now on strict area of +++
+++ Proxy NoverNet Network, +++
+++ all your activity are being logged. +++
+++ +++
+++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++
Regard’s – areksitiung@yahoo.com

> su
router# cat /etc/rc.conf

# — sysinstall generated deltas — # Thu Feb 28 23:19:45 2008
# Created: Thu Feb 28 23:19:45 2008
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.

sshd_enable=”YES”
fsck_y_enable=”YES”
gateway_enable=”YES”

ppp_enable=”YES”
ppp_mode=”ddial”
ppp_profile=”speedy”
ppp_nat=”YES”

pf_enable=”YES”
pf_rules=”/etc/pf.conf”
pf_flags=””
pflog_enable=”YES”
pflog_logfile=”/var/log/pflog”
pflog_flags=””

ifconfig_rl0=”up”
ifconfig_rl0=”inet 192.168.2.2 netmask 255.255.255.0″
ifconfig_rl1=”inet 192.168.1.1 netmask 255.255.255.0″
hostname=”router.nover.net.id”

router# cat /etc/rc.local
/usr/local/bin/portsentry -tcp
/usr/local/bin/portsentry -udp
/usr/sbin/squid -D
/sbin/ipfw add 350 fwd 192.168.1.1,3128 tcp from 192.168.1.0/24 to any www
/sbin/ipfw add 350 fwd 192.168.1.1,3128 tcp from 192.168.1.0/24 to any 3128
/sbin/ipfw add 350 fwd 192.168.1.1,3128 tcp from 192.168.1.0/24 to any 8080
/sbin/ipfw add 350 fwd 192.168.1.1,3128 tcp from 192.168.1.0/24 to any 9000
/sbin/ipfw add 350 fwd 192.168.1.1,3128 tcp from 192.168.1.0/24 to any 10000
/sbin/ipfw add deny tcp from any to any 135-137
/sbin/ipfw add deny udp from any to any 135-137
/sbin/ipfw add deny tcp from any to any 6257
/sbin/ipfw add deny udp from any to any 6257
/sbin/ipfw add deny tcp from any to any 6699
/sbin/ipfw add deny udp from any to any 6699
/sbin/ipfw add deny tcp from any to any 2754
/sbin/ipfw add deny udp from any to any 2754
/sbin/ipfw add deny tcp from any to any 2535
/sbin/ipfw add deny udp from any to any 2535
/sbin/ipfw add deny tcp from any to any 4661-4672
/sbin/ipfw add deny udp from any to any 4661-4672
/sbin/ipfw add deny tcp from any to any 1214
/sbin/ipfw add deny udp from any to any 1214
/sbin/ipfw add deny tcp from any to any 1024
/sbin/ipfw add deny udp from any to any 1024
/sbin/ipfw add deny tcp from any to any 6881-6889
/sbin/ipfw add deny udp from any to any 6881-6889
/sbin/ipfw add deny tcp from any to any 6346
/sbin/ipfw add deny udp from any to any 6346
/sbin/ipfw add deny tcp from any to any 8000
/sbin/ipfw add deny udp from any to any 8000
/sbin/ipfw add deny tcp from any to any 8372
/sbin/ipfw add deny udp from any to any 8372
/sbin/ipfw add deny tcp from any to any 8360
/sbin/ipfw add deny udp from any to any 8360

router# ifconfig
rl0: flags=8843 mtu 1500
options=8
inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::21c:f0ff:fe5b:9838%rl0 prefixlen 64 scopeid 0×1
ether 00:1c:f0:5b:98:38
media: Ethernet autoselect (100baseTX )
status: active
rl1: flags=8843 mtu 1500
options=8
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe80::21c:f0ff:fe5b:96ce%rl1 prefixlen 64 scopeid 0×2
ether 00:1c:f0:5b:96:ce
media: Ethernet autoselect (100baseTX )
status: active
vr0: flags=8802 mtu 1500
ether 00:1b:b9:d3:01:77
media: Ethernet autoselect (none)
status: no carrier
plip0: flags=108810 mtu 1500
lo0: flags=8049 mtu 16384
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0×5
pfsync0: flags=0<> mtu 2020
pflog0: flags=0<> mtu 33208
tun0: flags=8051 mtu 1492
inet 125.xxx.xx.xx –> 125.162.82.1 netmask 0xffffffff
Opened by PID 241

# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.413.2.6.2.2 2004/10/24 18:02:52 scottl Exp $

machine i386
cpu I486_CPU
cpu I586_CPU
cpu I686_CPU
ident NOVERNET

# To statically compile in device wiring instead of /boot/device.hints
#hints “GENERIC.hints” # Default places to look for devices.

options IPDIVERT
options IPFIREWALL
options IPFIREWALL_DEFAULT_TO_ACCEPT
options IPFIREWALL_FORWARD
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options HZ=1000

options SYSVMSG
options MSGMNB=8192
options MSGMNI=40
options MSGSEG=512
options MSGSSZ=64
options MSGTQL=2048
options SYSVSHM
options SHMSEG=16
options SHMMNI=32
options SHMMAX=2097152
options SHMALL=4096

device pf
device pflog
device pfsync

options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_CDNR
options ALTQ_PRIQ

options NETGRAPH
options NETGRAPH_ETHER
options NETGRAPH_PPPOE
options NETGRAPH_SOCKET

options IPFILTER
options IPFILTER_LOG

router# /usr/sbin/squid -v
Squid Cache: Version 2.6.STABLE18
configure options: ‘–prefix=/usr’ ‘–sysconfdir=/etc/squid’ ‘–enable-async-io=24′ ‘–with-aufs-threads=24′ ‘–with-pthreads’ ‘–with-aio’ ‘–with-dl’ ‘–enable-storeio=aufs,diskd’ ‘–enable-removal-policies=heap’ ‘–enable-icmp’ ‘–enable-delay-pools’ ‘–enable-snmp’ ‘–enable-cache-digests’ ‘–enable-ipf-transparent’ ‘–enable-pf-transparent’ ‘–disable-ident-lookups’ ‘–disable-hostname-checks’ ‘–enable-underscores’ ‘–enable-ssl’ ‘–disable-wccp’ ‘–disable-wccpv2′
router# df -kh
Filesystem Size Used Avail Capacity Mounted on
/dev/ad4s1a 19G 1.3G 16G 8% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/ad4s1d 10G 3.3G 6.2G 35% /cache1
/dev/ad4s1e 10G 3.3G 6.2G 35% /cache2
/dev/ad4s1f 10G 3.4G 6.2G 36% /cache3
/dev/ad4s1g 10G 3.5G 6.0G 37% /cache4
/dev/ad4s1h 9.5G 1.6G 7.1G 19% /cache5

http_port 3128 transparent
icp_port 3130

hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin ?
#no_cache deny QUERY

cache deny QUERY
cache_mem 8 MB
cache_swap_low 98
cache_swap_high 99

ipcache_size 4096
ipcache_low 98
ipcache_high 99

fqdncache_size 4096
maximum_object_size 32 MB
maximum_object_size_in_memory 16 KB
cache_replacement_policy heap LFUDA
memory_replacement_policy heap GDSF

cache_dir diskd /cache1 6000 20 256 Q1=72 Q2=88
cache_dir diskd /cache2 6000 20 256 Q1=72 Q2=88
cache_dir diskd /cache3 6000 20 256 Q1=72 Q2=88
cache_dir diskd /cache4 6000 20 256 Q1=72 Q2=88
cache_dir diskd /cache5 6000 20 256 Q1=72 Q2=88

access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
access_log none
cache_log none
allow_underscore on
pid_filename /var/run/squid/squid.pid
cache_store_log none

##REFRESH PATTERN
refresh_pattern yahoo 0 20% 4320
refresh_pattern -i .(class|css|js|gif|jpg)$ 10080 100% 43200 override-expire
refresh_pattern -i .(jpe|jpeg|png|bmp|tif)$ 10080 100% 43200 override-expire
refresh_pattern -i .(tiff|mov|avi|qt|mpeg)$ 10080 100% 43200 override-expire
refresh_pattern -i .(mpg|mpe|wav|au|mid)$ 10080 100% 43200 override-expire
refresh_pattern -i .(zip|gz|arj|lha|lzh)$ 10080 100% 43200 override-expire
refresh_pattern -i .(rar|tgz|tar|exe|bin)$ 10080 100% 43200 override-expire
refresh_pattern -i .(hqx|pdf|rtf|doc|swf)$ 10080 100% 43200 override-expire
refresh_pattern -i .(inc|cab|ad|txt|dll)$ 10080 100% 43200 override-expire
refresh_pattern -i .(asp|acgi|pl|shtml|php3|php)$ 2 20% 4320 reload-into-ims
refresh_pattern -i ? 2 20% 4320 reload-into-ims
refresh_pattern -i cgi-bin 2 20% 4320 reload-into-ims
refresh_pattern http://.*login.yahoo.com/ 10080 20% 4320
refresh_pattern http://.*338a.com/ 3600 20% 4320
refresh_pattern http://*.ibcbet.com/ 0 20% 4320
refresh_pattern . 960 90% 43200 reload-into-ims

quick_abort_min 0
quick_abort_max 0
quick_abort_pct 100

client_lifetime 3 hours
shutdown_lifetime 10 seconds
half_closed_clients off
high_memory_warning 400 mb
high_response_time_warning 0
high_page_fault_warning 2
strip_query_terms off
log_fqdn off
memory_pools off

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl lan src 192.168.1.0/24

#acl porn url_regex “/etc/squid/bokep.txt”
#acl noporn url_regex “/etc/squid/nobokep.txt”

acl TIME time SMTWHFA 10:00-20:00
acl download url_regex -i ftp .exe$ .mp3$ .mp4$ .tar.gz$ .gz$ .tar.bz2$ .rpm$ .zip$ .rar$
acl download url_regex -i .avi$ .mpg$ .mpeg$ .rm$ .iso$ .wav$ .mov$ .dat$ .mpe$ .mid$ .mp4$
acl download url_regex -i .midi$ .rmi$ .wma$ .wmv$ .ogg$ .ogm$ .m1v$ .mp2$ .mpa$ .wax$ .msi$
acl download url_regex -i .m3u$ .asx$ .wpl$ .wmx$ .dvr-ms$ .snd$ .au$ .aif$ .asf$ .m2v$ .rfx$
acl download url_regex -i .m2p$ .ts$ .tp$ .trp$ .div$ .divx$ .mod$ .vob$ .aob$ .dts$ .3g2$
acl download url_regex -i .ac3$ .cda$ .vro$ .deb$ .cab$ .qt$ .flv$ .swf$ .3gp$ .vqf$ .asf$

acl manager proto cache_object
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 81
acl Safe_ports port 84
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl BADPORTS port 7 9 11 19 22 23 25 110 119 513 514 445 213 137 138 32768
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#http_access deny VIRUS
#http_access deny porn !noporn
http_access deny BADPORTS
http_access allow lan
http_access allow localhost
http_access deny all
icp_access allow lan
icp_access deny all
miss_access allow lan
miss_access deny all
extension_methods register-http-method
ftp_user areksitiung@yahoo.com
ftp_list_width 32
ftp_passive on

forwarded_for off
store_objects_per_bucket 15
store_avg_object_size 13 kb
debug_options ALL,1 98,2
max_open_disk_fds 100
store_dir_select_algorithm round-robin

cache_mgr areksitiung@yahoo.com
cache_effective_user squid
cache_effective_group squid
visible_hostname proxy.nover.net.id
logfile_rotate 1
pipeline_prefetch on
vary_ignore_expire on
cachemgr_passwd cimpronet
buffered_logs on
ignore_unknown_nameservers off
ie_refresh off

delay_pools 3
delay_class 1 1
delay_parameters 1 10000/15000
delay_access 1 allow download TIME
delay_access 1 deny all

ext_if =’tun0′
all_if =’{ tun0 rl1 }’
int_if =’rl1 ‘
noacc =’{ 67 68 69 135 136 137 138 139 213 445 552 554 1034 1080
1433 1434 4000 4444 4661 4662 6257 6346 6347 6699
7070 }’
dfltport=’{ 20 21 80 443 6660:6670 5001 5010 5050 5100 }’
p2p=’{1214 3000:4900 4661:4672 6257 6699 6346 6881:6889 4662 4672}’
prioport=’{ 22 161 162 1740:1900 2075 2212 3000:3200 3700:3999
4001:4900 5000 6900 7000 8000 8360:8364 8352 8372
10011 10021 10031 10041 10051 10061 10071 10102 13412
13413 13450 20000 20201 20202 }’
gameport=’{ 1740:1900 2075 3000:3200 3700:3999 4001:4900 5000 5121 6121 6900
7000 8000 8360:8364 8352 8372 10011 10021 10031 10041 10051 10061
10071 10102 13412 13413 13450 20000 20201 20202 64113 64381 }’
cached =’{ 80 3128 8080 8081 }’
ssh1port=’{ 22 2212 1680 1870 }’
snmpport=’{ 161 162 }’

bio =’block in on’
boo =’block out on’
biqo =’block in quick on’
bdiqo =’block drop in quick on’
bilqo =’block in log quick on’
boqo =’block out quick on’
bdqo =’block drop quick on’
bdoqo =’block drop out quick on’
bdqlo =’block drop quick on’
bqo =’block quick on’
bolqo =’block out log quick on’
poqo =’pass out quick on’
piqo =’pass in quick on’
polqo =’pass out log quick on’
pilqo =’pass in log quick on’
prio =’priority’
pif =’proto tcp from’
pqo =’pass quick on’
puifa =’proto { udp icmp } from any’
puif =’proto { udp icmp } from’
ptufa =’proto { tcp udp } from any’
ptuif =’proto { tcp udp icmp } from’
ptuifa =’proto { tcp udp icmp } from any’
ptuf =’proto { tcp udp } from’
puf =’proto udp from’
ptfa =’proto tcp from any’
pufatap =’proto udp from any to any port’
pufap =’proto udp from any port’
pif =’proto icmp from’
ptf =’proto tcp from’
pifa =’proto icmp from any’
ptufap =’proto { tcp udp } from any port’
fata =’from any to any’
priq0 =’{ q_def0, q_pri0 }’
priq1 =’{ q_def1, q_pri1 }’
apriq0 =’(q_def0, q_pri0)’
apriq1 =’(q_def1, q_pri1)’
fat =’from any to’
poo =’pass out on’
pio =’pass in on’
pef =’persist file’
pst =’persist’
tbl =’table’
crd =’cbq(red default)’
crb =’cbq(red borrow)’
ptt =’proto tcp to’
ks =’keep state’
ms =’modulate state’
st =’set timeout’
bw =’bandwidth’
fa =’from any’
cd =’cbq(default)’
cr =’cbq(red)’
cq =’cbq queue’
hq =’hfsc queue’
fs =’flags S/SA’
qu =’queue’
ql =’qlimit’
rt =’realtime’
ls =’linkshare’
ul =’upperlimit’
pt =’proto tcp’

$st { interval 30, frag 10 }
$st { tcp.first 120, tcp.opening 30, tcp.established 86400 }
$st { tcp.closing 500, tcp.finwait 45, tcp.closed 40 }
$st { udp.first 60, udp.single 30, udp.multiple 60 }
$st { icmp.first 20, icmp.error 10 }
$st { other.first 60, other.single 30, other.multiple 60 }

set limit { states 20000, frags 20000 }
set optimization normal
set block-policy return
set state-policy if-bound
set loginterface $int_if
set loginterface $ext_if

$tbl $pst
$tbl $pst

scrub in
scrub out no-df random-id

#nat on $ext_if from 192.168.1.0/28 -> 202.152.58.197
##nat on xl0 from 192.168.10.0/24 -> 172.16.10.3
nat on tun0 from 192.168.1.0/24 -> 125.162.xx.xxx

#nat on ethernet public from network local -> ip public

rdr on rl1 proto tcp from 192.168.1.0/24 to any port www -> 192.168.1.1 port 3128
rdr on rl1 proto tcp from 192.168.1.0/24 to any port 8080 -> 192.168.1.1 port 3128
rdr on rl1 proto tcp from 192.168.1.0/24 to any port 3128 -> 192.168.1.1 port 3128
rdr on rl1 proto tcp from 192.168.1.0/24 to any port 9000 -> 192.168.1.1 port 3128
rdr on rl1 proto tcp from 192.168.1.0/24 to any port 10000 -> 192.168.1.1 port 3128

$biqo $all_if proto { tcp udp } to port $noacc
$biqo $all_if proto { tcp udp } from port $noacc

$boqo $ext_if to 255.255.255.255
$biqo $ext_if from 255.255.255.255
$boqo $int_if to 255.255.255.255
$biqo $int_if from 255.255.255.255

pass quick on lo0

$bdiqo $all_if from
$bdoqo $all_if to

block in quick on $all_if proto icmp to 69.46.28.205
block in quick on $all_if proto icmp from 69.46.28.205
block in quick on $all_if proto icmp to 70.87.51.179
block in quick on $all_if proto icmp from 70.87.51.179

pass quick proto { tcp udp } to port $snmpport
pass quick proto { tcp udp } from port $snmpport

pass quick inet proto { tcp udp } to port { 123 }
pass quick inet proto { tcp udp } from port { 123 }

pass out proto tcp to port 21 keep state

pass quick inet proto icmp

router# cat /etc/ppp/ppp.conf
#################################################################
# PPP Sample Configuration File
# Originally written by Toshiharu OHNO
# Simplified 5/14/1999 by wself@cdrom.com
#
# See /usr/share/examples/ppp/ for some examples
#
# $FreeBSD: src/etc/ppp/ppp.conf,v 1.8 2001/06/21 15:42:26 brian Exp $
#################################################################

default:
set device PPPoE:rl0
set speed sync
set mru 1492
set mtu 1492
set ctsrts off
enable lqr
set log phase tun
add default HISADDR
enable dns
speedy:
set authname 11140xxxxx@telkom.net
set authkey xxxxx

A. Pendahuluan

Unix dirancang agar dapat digunakan secara simultan oleh banyak orang (multi user), dan memiliki desain TCP/IP built-in. Unix merupakan sistem operasi pertama yang dikembangkan sebagai sistem operasi yang portabel, dan lebih umum digunakan untuk mendukung workstation dan server-server internet. Pertama kali dirancang oleh Ken Thompson dan Dennis Ritchie, peneliti AT&T Bell Laboratories pada tahun 1996, diilhami oleh desain sistem MULTICS yang dikembangkan oleh MIT.

Dibawah pengembangan institusi-institusi riset dan para mahasiswa dari berbagai belahan dunia, dalam waktu relatif singkat Unix tumbuh dengan pesat dan menjadi kompetitor utama Microsoft Windows yang selama ini mendominasi pasar server dan sistem operasi komputer. Saat ini telah lahir puluhan varian atau “flavor” Unix seperti Sun Solaris, IBM AIX, Hewlett-Packard HP/UX, Linux, FreeBSD, NetBSD, OpenBSD, dan lain-lain. Sistem-sistem tersebut umumnya telah teruji dengan baik sehingga bisa diaplikasikan pada platform PC, Macintosh, Sun, bahkan IBM mainframe.

Unix BSD (BSD Unix) adalah implementasi sistem operasi Unix (beserta utilitinya) yang dikembangkan dan didistribusikan oleh University of Californa at Berkeley. Unix BSD (Berkeley Software Distribution) biasanya disebut sebagai BSD Operating System.

FreeBSD adalah UNIX−like operating system (sistem operasi seperti UNIX), tersedia gratis di internet, sangat banyak digunakan dalam dunia ISP (Internet service provider), embedded devices, serta bidang lain yang membutuhkan reliability tinggi. FreeBSD dibuat dari source code UNIX original yang diproduksi oleh AT&T tahun 1970.

Bertahun-tahun yang lalu, AT&T membutuhkan banyak komputer untuk menjalankan bisnis mereka. Saat itu, AT&T dilarang untuk ikut dalam bisnis komputer. Sehingga akhirnya mereka menjual lisensi software mereka beserta source codenya ke universitas dengan harga yang murah. Mahasiswa universitas yang dapat mengakses teknologi ini dapat membaca source code dan belajar bagaimana software tersebut bekerja. Sebagai imbalan, AT&T mendapat programmer gratis, patch gratis, serta para scientist yang meningkatkan kualitas software AT&T. semua orang senang.

Software AT&T yang sangat terkenal dalam lisensi ini adalah UNIX. kenapa disebut UNIX−like? Kata UNIX” adalah sebuah nama trademark (merk dagang) yang dimiliki oleh The Open Group. Jadi, jika Anda mempunyai produk operating system dan ingin diberi nama UNIX, produk Anda harus di-certified oleh The Open Group dan Anda harus membayar uang yang cukup banyak ke mereka. Karena FreeBSD dibuat bukan untuk profit, maka namanya menjadi UNIX-like.

Di Indonesia para pemakai komputer lebih mengenal sistem operasi alternatif Linux daripada varian Unix BSD (FreeBSD, NetBSD, dan OpenBSD).

B. Sejarah Unix BSD

Perjalanan panjang Varian Unix BSD dimulai pada
tahun 1973, dimana pada waktu itu Prof. Bob Fabry dari Universitas California Berkeley menyatakan minat untuk mendapatkan sistem operasi Unix kepada Ken Thompson dan Dennis Ritchie pada kegiatan ”Symposium on Operating Systems Principles” di Universitas Purdue. Prof. Bob Fabry bermaksud mendapatkan Unix untuk eksperimen pada sebuah mainframe milik Universitas Berkeley. Pada tahun 1974 sebuah tape yang berisi Unix versi 4 datang ke Berkeley dan di-install-kan oleh mahasiswa pasca sarjana Keith Standiford pada komputer PDP-11/45.

Meskipun komputer PDP-11/45 pada saat itu diklaim komputer yang cukup mudah untuk menginstall Unix, namun pada kenyataannya berbagai macam masalah dihadapi oleh Keith Standiford dalam menjalankan Unix pada PDP-11/45, karena itu Ken Thompson di Bell Labs AT&T New Jersey melakukan remote debugging pada mesin PDP-11/45 milik Universitas Berkeley di California, karena Universitas Berkeley hanya memiliki 300-baud acoustic-coupled modem, maka Ken Thompson melakukan panggilan terlebih dahulu kepada Keith Standiford diruangan komputer PDP-11/45 tersebut untuk selanjutnya meminta Keith Standiford memasukkan sambungan telepon tersebut ke modem. Dengan demikian Ken Thompson dari New Jersey di pantai timur Amerika Serikat dapat melakukan remote debugging ke Universitas California Berkeley di pantai barat Amerika Serikat.

Masalah yang lain muncul yaitu karena status komputer PDP-11 adalah milik bersama Departemen Matematika dan Statistika juga, departemen tersebut ingin menjalakan RSTS dari DEC, sedangkan Departemen Ilmu Komputer ingin menjalan Unix. Akhirnya kata sepakat dicapai dengan menjalankan masing-masing sistem secara bergantian.

Pada tahun 1975, Departemen Ilmu Komputer Universitas California Berkeley membeli komputer baru sebuah DEC 11/70. Pada tahun yang sama Ken Thompson menjadi Profesor Tamu pada almamaternya yaitu Universitas California Berkeley, Ken Thompson datang dengan membawa sistem operasi Unix versi 6. Dua orang mahasiswa pasca sarjana yaitu Bill Joy dan Chuck Haley membantu Ken Thompson untuk meng-hacked Unix versi 6 tsb pada komputer DEC 11/70. 1

Pada akhir musim panas 1976, Ken Thompson kembali ke Bell Labs New Jersey, seiring dengan kepergian Ken Thompson, Bill Joy dan Chuck Haley mulai mengoprek kernel sistem operasi Unix versi 6 tersebut, berbekal dengan pengalaman satu tahun terakhir mengoprek Unix bersama Ken Thompson sebelumnya.

Akhirnya pada awal tahun 1977, Bill Joy mengeluarkan ”Berkeley Software Distribution”, pada distribusi pertama mencakup pula compiler Pascal dan editor Ex. Pada tahun 1978 Bill Joy memutuskan software yang ada pada distribusi harus diperbaharui seiring dengan banyaknya feedback dari komunitas, hasilnya pada tahun 1978 tersebut keluar ”Second Berkeley Software Distribution” atau disingkat 2BSD, termasuk didalamnya compiler Pascal, editor vi dan termcap.

Pada tahun 1978, Departemen Ilmu Komputer Universitas Berkeley, membeli sebuah komputer VAX-11/780 dari DEC, meskipun komputer tersebut sudah memiliki sistem operasi sendiri yang dikenal dengan nama VMS, namun Departemen Ilmu Komputer menginginkan Unix 32/v (Seventh Edition) dapat berjalan diatas komputer VAX-11/780 tersebut. Lagi-lagi Bill Joy diminta membantu melakukan porting Unix 32/V tersebut untuk mesin VAX-11/780, pada awal Januari 1979, akhirnya Unix 32/V (Seventh Edition) dapat berjalan dengan mulus pada komputer VAX tersebut, pada saat itu juga Bill Joy, memutuskan untuk melakukan porting 2BSD untuk komputer VAX dengan pertimbangan komputer VAX tersebut jauh lebih canggih (berarsitektur 32 bit) daripada PDP-11 yang hanya 16 bit. Pada bulan Januari 1979 distribusi lengkap telah diselesaikan hasilnya 3BSD sebagai distribusi sistem VAX pertama dari Berkeley.

Pada musim gugur 1979, Prof Bob Fabry, merepson keinginan DARPA (Defense Advanced Research Projects Agency ) untuk memperbaiki 3BSD untuk kepentingan komunitas DARPA, dimana pada waktu itu untuk keperluan mengkoneksikan semua komputer pada pusat-pusat riset. Untuk lebih memantapkan pekerjaan dari DARPA tersebut, Prof Bob Fabry, membentuk CSRG (Computer System Research Group).

Pada Oktober 1980 lahir 4BSD, selama 9 bulan kedepan sejak kelahirannya sebanyak 150 kopi telah dikirimkan. Lisensi dibuat berdasarkan institusi bukan per komputer. Karena sudah tersebar luas 4BSD banyak menuai kritik terutama masalah kinerja yang dinilai masih lamban daripada VMS. Untuk itu pada Juni 1981, 4.1BSD lahir dengan berbagai macam perbaikan. Pada awalnya distribusi tersebut akan diberi nama 5BSD, namun pihak AT&T keberatan karena akan membingungkan pelanggan, karena pada saat itu terdapat juga sistem operasi Unix system V, untuk itu Berkeley mengalah dan memberi nama distribusi tersebut 4.1BSD. DARPA cukup puas dengan hasil yang diperoleh dan berminat untuk memperpanjang kontrak dengan CSRG. DARPA berharap hasil kerja berikutnya adalah: fast file system untuk mendukup teknologi disk yang ada pada saat itu, fasilitas komunikasi interproses agar para peneliti DARPA dapat bekerja dalam lingkungan distributed computing, dan fasilitas networking yang terintegrasi sehingga dapat berpartisipasi dalam ARPAnet. Sebagai pendahuluan release pada April 1982, dikeluarkan 4.1aBSD untuk keperluan lokal saja (Berkeley dan DARPA), pada saat itu banyak kritik dan saran perbaikan untuk 4.1aBSD, untuk itu pada Juni 1982 dikeluarkan 4.1bBSD. Release 4.1b BSD ini cukup stabil dan baik maka pada April 1983 dikeluarkan 4.1c BSD. Dengan sedikit perbaikan pada 4.1c BSD, pada Agustus 2003 dikeluarkan 4.2BSD. 4.2BSD pada saat itu sangat populer, lebih dari 1000 institusi mempunyai lisensi 4.2BSD tersebut, para vendor pun pada saat itu lebih suka menawarkan 4.2BSD ketimbang Unix system V karena 4.2BSD mempunyai fasilitas Networking dan Fast File System.

Dengan berbagai macam kritik dan feedback, maka pada tengah 1986 di-release 4.3BSD, selanjutnya pada Juni 1988 di-release 4.3BSD Tahoe dan pada Juni 1990 di-release 4.3BSD Reno. Selain release tsb ada pula release networking yaitu: 4.3BSD Net1 pada Maret 1989 dan 4.3BSD Net2 pada Juni 1991. Release ini tidak tidak memiliki source code yang bersifat proprietary sehingga dapat secara bebas didistribusikan dalam bentuk source code maupun binary.

Release terakhir dari CSRG adalah 4.4BSD, pada saat yang bersamaan juga CSRG me-release 4.4BSD-Lite yang berisi source code non-proprietary dan users tidak perlu memiliki lisensi Unix, namun 4.4BSD-Lite ini mendapat aksi legal dari USL (Unix System Laboratories) yang mengklaim 4.4BSD-Lite mengandung source code asli Unix dari AT&T, hal ini berlanjut hingga ke pengadilan. Setelah 1 tahun proses pengadilan berlangsung akhirnya USL dan BSD mencapai kata sepakat (damai), sisa uang yang ada pada CSRG dipakai untuk me-release 4.4BSD-Lite release 2 pada Juni 1995.

C. Sejarah dan Perkembangan FreeBSD

Proyek FreeBSD dimulai pada awal 1993, sebagian sebagai perkembangan dari “Unofficial 386BSD Patchkit” dari 3 koordinator “patchkit” ini, yaitu: Nate Williams, Rod Grimes dan Jordan Hubberd.

Versi resmi pertama yang dirilis adalah FreeBSD 1.0 pada Desember 1993, yang dikoordinasikan oleh Kordan Hubbard, Nate Williams dan Rod Grimes dengan nama yang diajukan oleh David Greenman. Walnut Greek CDOM yang kemudian menyetujui untuk mendistribusikan FreeBSD dalam CD dan memberikan sebuah mesin untuk bekerja dalam proyek tersebut, dalam koneksi internet yang cepat, yang kemudian dikatakan oleh HUbbard sangat membantu perkembangan cepat FreeBSD. Pada bulan Mei 1994 FreeBSD 1.1 yang sukses dirilis. Akan tetapi, terdapat beberapa perhatian tentang legalitas ‘BSD Net/2 release source code’ yang digunakan pada 386BSD. Setelah sebuah perkara hukum antara UNIX yang mempunyai copyright, Uniix System Laboratories dengan University of California, Berkeley, proyek FreeBSD kembali membangun kebanyakan sistem dengan menggunakan 4.4 BSD-Lite yang dirilis Berkeley, yang membuat perkara hukum ini tidak mempunyai satupun AT&T source code yang dimiliki BSD yang pertama, yang membuatnya tidak dapat digunakan. Dengan usaha yang besar kemudian dirilis sebagai FreeBSD 2.0 pada Januari 1995.

FreeBSD 2.0 memberi fitur yang merubah fitur original memori sistem virtual Carnegie Mellon University Mach, yang dioptimasi untuk performa dalam beban yang tinggi. Rilis-an ini juga mengenalkan sistem FreeBSD Ports, yang membuat instalasi, pen-download-an dan pembentukan software pihak ketiga menjadi sangat mudah. Pada tahun 1996 FreeBSD telah menjadi populer di kalangan komersil dan pengguna ISP, yang digunakan pada situs-situs sukses seperti Walnut Creek CDROM, Yahoo! dan Hotmail. Versi terakhir dari versi 2 FreeBSD, yaitu versi 2.2.8 dirilis pada November 1998.

FreeBSD 3.0 membawa banyak perubahan, berganti format ke format ELF binary. Sistem SMP dan platform 64bit ALpha juga didukung pada versi ini. Versi stabil-3 diakhiri dengan versi 3.5.1 pada Juni 2000.

Rilis terakhir yang stabil dari FreeBSD adalah versi 7.0 yang dirilis pada Februari 2008.

D. Hardware Requirements

§ Minimum configuration:

ü 386 based PC

ü RAM 5 MB

ü HD 60 MB

ü MDA (VGA or better run X)

§ Comfortable configuration:

ü Low end Pentium (P90)

ü 16 MB RAM

ü 400 MB Hard disk

ü Cheap S3 video card

E. Varian BSD

Asal muasal varian BSD berasal dari hasil kerja keras Bill Jolitz yang memporting 4.3BSD Net2 kedalam arsitektur 386, hasilnya disebut 386/BSD. Sebagian orang-orang yang menggunakan 386/BSD kemudian membentuk grup yang dikenal dengan nama NetBSD karena Bill Jolitz pada saat itu sudah sangat sibuk dengan pekerjaan utamanya, sehingga tidak sempat untuk melakukan perbaikan terhadap 386/BSD. Grup NetBSD ini yang kemudian memelihara dan memperbaiki 386/BSD. Kelompok NetBSD ini memilih tujuan untuk mendukung sebanyak mungkin platform/arsitektur. Kelompok FreeBSD terbentuk beberapa bulan setelah NetBSD terbentuk dengan tujuan mendukung arsitektur PC i386 saja pada awalnya. Kelompok OpenBSD terbentuk belakangan ini berpisah dari kelompok NetBSD, dengan fokus pada aspek keamanan.

Secara umum ada dua turunan dari 4.4BSD ini yaitu:

  1. Komersial

Yang termasuk kedalam varian BSD komersial adalah :

a. BSD/OS (http://www.bsdi.com)

BSD/OS dipasarkan oleh BSD, Inc.

b. DarwinOS (http://developer.apple.com/darwin/)

Darwin merupakan bagian penting dari sistem operasi MacOS X. Darwin menggabungkan beberapa teknologi dari Mach dengan sistem operasi 4.4BSD.

  1. Bebas (menggunakan lisensi BSD)

Yang termasuk kedalam varian BSD bebas (menggunakan lisensi BSD)

a. NetBSD (http://www.netbsd.org)

NetBSD fokus pada penyediaan sistem operasi NetBSD pada berbagai macam arsitektur komputer, saat ini sudah mendukung lebih dari 40 arsitektur, mulai dari 64 bit Alpha Server dan desktop system hingga handheld dan embeded system.

Ketika Jolitz dan rekan-rekan lain memfokuskan diri dalam proyek 386BSD, mereka menemui kendala dalam pengerjaannya dan karena itu mulai mengembangkan usaha paralel. Rekan-rekan di Virginia Tech selanjutnya mulai mem-porting BSD ke Macintosh. Usaha terus dikembangkan ke arsitektur lainnya seperti Atari ST, Amiga, dan berbagai platform PC.

Fokus pengembangan NetBSD adalah berusaha memberikan sitem operasi yang stabil, multiplatform, dan berorientasi-riset. Pada Januari 2001, portabilitas NetBSD dikabarkan sudah mencapai 33 Platform.

Lebih menakjubkan lagi, NetBSD mendukung segudang hardware dan perlengkapan modern maupun tradisional, termasuk perlengkapan berbasis PC Intel, Compaq’s Alpha, atau arsitektur Sun Microsystem SPARC. Server tua dan hardware kelas workstation seperti Digital Equipment Corporation (DEC) VAX, komputer Apple Macintosh berbasis prosesor Motorola 68000 juga didukung.

Dedikasi NetBSD atas portabilitasnya telah memimpin sistem-sistem operasi lain. Pada saat grup FreeBSD mulai mem-porting sistemnya ke platform Alpha, pekerjaan pada proyek NetBSD dijadikan landasan. Demikian juga Linux telah mengambil keuntungan dari pengalaman NetBSD. Utiliti boot-loader spesial yang digunakan NetBSD untuk komputer-komputer Macintosh seri 68000 dimodifikasi sedemikian rupa dan menjadi boot-loader Penguin yang digunakan untuk me-launch Linux dalam mesin-mesin tersebut.

Akhirnya, kontribusi besar NetBSD lainnya adalah sebagai ‘batu loncatan’ atas lahirnya sistem operasi OpenBSD.

The NetBSD Project bercita-cita melahirkan sistem operasi riset kelas dunia yang andal. Oleh karena portabilitas NetBSD terhadap beragam hardware sangat terbuka, sekolah dan institusi-institusi riset dapat mewujudkan riset nyata melalui perlengkapan-perlengkapan yang tersedia.

Proyek mayor lainnya yang dikembangkan oleh NetBSD adalah KAME. KAME membantu memperkenalkan IPv6, IPsec (baik untuk IPv4 dan IPv6), dan peningkatan-peningkatan TCP/IP secara umum dalam dunia Unix.

NetBSD merupakan sistem yang cerdas. Datang dengan komplemen lengkap atas tool-tool Unix, dan banyak situs menggunakan NetBSD sebagai server DNS atau server jaringan mereka, terutama karena portabilitasnya yang luas terhadap beragam hardware dan perlengkapan.

b. FreeBSD (http://www.freebsd.org)

FreeBSD fokus pada optimalisasi PC i386 dan Alpha, sekarang ini juga sudah mendukung IA-64, PC-98, dan UltraSparc. FreeBSD dikenal dengan fitur networking yang cukup handal sehingga digunakan pada web server yahoo (http://www.yahoo.com) dan pada ftp server CDROM,Inc (ftp://ftp.cdrom.com)

Perawatan patchkit dirasa menemui jalan buntu sehingga suatu mekanisme baru dibutuhkan. Ketiga author akhirnya memulai proyek baru yang dinamakan “386BSD 0.5″, didalamnya termuat berbagai utiliti perbaikan (fixes) dan fungsi-fungsi lainnya sebagaimana layaknya sebuah sistem operasi riil. Sayangnya tak lama kemudian proyek tersebut terhenti.

David Greenman, yang kemudian bekerja pada Walnut Creek, selanjutnya mengusulkan sistem operasi baru berbasiskan kepada patchkit yang telah ada dengan nama FreeBSD.

Segera setelah itu, Hubbard dikontrak Walnut Creek untuk mempersiapkan channel distribusi CDROM. Walnut Creek memberikan dukungan dengan menawarkan server dan hardware ber-bandwidth tinggi untuk mengembangkannya. CDROM pertama dari FreeBSD adalah versi 1.0, dirilis pada bulan Desember 1993.

FreeBSD 2.0 dirilis bulan November 1994. Selanjutnya sebagai upgrade dan peningkatan dilakukan secara berkesinambungan dan signifikan. Dewasa ini FreeBSD telah melahirkan rilis-rilis yang sangat stabil dan luas digunakan oleh masyarakat dunia. Yahoo!, direktori internet terbesar saat ini, mempercayakan jutaan halamannya untuk dilayani oleh sistem FreeBSD, begitu pula organisasi dan vendor-vendor besar lainnya.

Berdasarkan penuturan Hubbard, sasaran utama FreeBSD Project adalah memberikan software yang dapat digunakan untuk beragam tujuan.

Barangkali apa yang menarik dari FreeBSD adalah sisi teknisnya yang simpel. Diakui bahwa program instalasi FreeBSD termasuk dalam tool instalasi Unix yang paling sederhana di antara yang lainnya. Di samping itu, sistem software third-party yang datang bersamanya (Port Collections) telah diadopsi NetBSD dan OpenBSD. Fitur tersebut memberikan kemudahan yang berarti bagi para user untuk menambah atau menghapus aplikasi-aplikasi sebagaimana yang mereka kehendaki. Para user cukup mengeksekusi satu baris perintah dan aplikasi-aplikasi dengan sendirinya di-download, dicek integritasnya, di-build, dan diinstall secara otomatis. Tugas-tugas administrasi sistem menjadi sangat praktis dan mudah.

Model pengembangan FreeBSD nyaris serupa dengan NetBSD maupun OpenBSD, tetapi memiliki perbedaan yang signifikan dengan development Linux. Model pengembangan FreeBSD dikelola secara profesional oleh ratusan programmer individual yang dipanggil dengan Committers. Commiters berwenang melakukan perubahan-perubahan yang dibutuhkan terhadap source official FreeBSD kapan pun juga. Penyeleksian tim Commiters diputuskan oleh FreeBSD Core Team, yang merupakan papan direksi FreeBSD.

Model pengembangan FreeBSD diarahkan untuk menciptakan produk yang stabil dan mudah digunakan. Sebagai salah satu sistem Unix yang reliabel untuk platform x86, FreeBSD harus menjaga kompatibilitas program-program sebaik mungkin di antara sistem.

c. OpenBSD (http://www.openbsd.org)

OpenBSD fokus pada aspek keamanan (security) dan kriptografi (cryptography). OpenBSD merupakan proyek yang terpisah dari NetBSD pada tengah 1995.

Pada awal tahun 1990-an, Theo de Raadt memegang tanggung jawab terhadap porting SPARC dalam NetBSD dan bagian-bagian lainnya. Akan tetapi, karena adanya kesalahpahaman antara Theo dan tim inti NetBSD berkaitan dengan arah pengembangan NetBSD, Theo mengundurkan diri dan selanjutnya merilis OpenBSD.

OpenBSD sedikit ‘menyimpang’ dari NetBSD sekitar rilis NetBSD 1.1 pada November 1995. Rilis pertama OpenBSD datang setahun kemudian, berikutnya OpenBSD 2.0 dirilis bulan Oktober 1996.

Apabila NetBSD memiliki keunikan dengan portabilitas yang luas, OpenBSD memfokuskan diri pada ketangguhan sistem dan keamanan. ‘Mantera’ OpenBSD yang berbunyi “Secure-by-default” telah menghasilkan produk sistem operasi yang paling sempurna saat ini. OpenBSD mengklaim bahwa tiga tahun tanpa exploitasi remote root memungkinkan administrator-administrator sistem dapat tidur nyenyak sepanjang malam.

Mengambil keuntungan dari domisilinya di Kanada, misi de Raadt tidak terhambat oleh hukum Amerika, dimana penerapan algoritma kriptografi yang kuat (strong cryptography) sangat dimungkinkan, seperti RSA, Blowfish, dan sejumlah algoritma lainnya. Lebih dari itu, versi modifikasi algoritma Blowfish sekarang digunakan untuk mengenkripsi password user.

Developer OpenBSD tidak hanya berhenti disitu, satu sumbangsih lain dari kerja keras mereka adalah OpenSSH, yakni clone multiplatform protokol terpopuler untuk mewujudkan komunikasi-komunikasi yang aman.

Fitur lain dari OpenBSD adalah auditing pengkodean yang teliti, hati-hati, dan apik. Itu semua untuk menjamin keamanan sistem yang bisa dipercaya. Dimulai sejak 1996, tim OpenBSD melakukan analisis baris-demi-baris pada keseluruhan konstruksi sistem operasi dengan mencari peluang atas berbagai hole security dan bug potensial.

Sistem-sistem Unix cukup terganggu dengan apa yang disebut fixed-sized buffers. Disamping tidak familier bagi para programmer, mereka juga mengaeah pada lahirnya hole security, seperti apa yang terjaadi pada eksploitasi fingerd dalam 4.2BSD.

Keseriusannya dalam pengawasan keamanan menyebabkan tim OpenBSD kerap menemukan kelemahan-kelemahan yang berhubungan dengan keamanan pada berbagai sistem operasi lain atau aplikasi-aplikasi third-party, termasuk pada sistem FreeBSD, NetBSD, atau yang lainnya.

Kebanyakan jaminan keamanan diwujudkan dengan audit code secara berkesinambungan dan OpenBSD tidak mentolerir berbagai port jaringan terbuka dalam instalasi default-nya. Seandainya sebuah situs memerlukan akses ke protokol finger, lpd, atau protokol-protokol lainnya, mereka terlebih dahulu harus di aktifkan. Lazimnya, protokol-protokol harus nonaktif saat tidak digunakan, dan instalasi OpenBSD mempertimbangkan hal itu dengan seksama.

OpenBSD termasuk sistem operasi yang portabel. Mungkin itu terpengaruh oleh karakteristik NetBSD sebagai ‘garis keturunannya’. OpenBSD cukup stabil dalam lusinan arsitektur, termasuk platform PC berbasis Intel, Motorola 68k-based Macintosh, dan lain-lain.


F. Model Pengembangan

Pada varian BSD (NetBSD, FreeBSD, dan OpenBSD) model pengembangan sistem operasi tersebut terbuka namun mempunyai hirarki tertentu, yaitu :

  1. Contributor, adalah developer yang menulis code, patch, atau dokumentasi namun tidak memiliki hak untuk menulis atau membuat sebuah file dalam source tree. Jika pekerjaan yang mereka lakukan ingin dimasukkan, maka harus diperiksa terlebih dahulu oleh seorang commiter atau dengan persetujuan beberapa orang commiter.
  2. Commiter adalah developer yang memiliki hak menulis dan mengakses source tree, dalam lingkup CVS, memiliki hak commit. Secara tipikal, seorang commiter bekerja hanya pada bagian-bagian terpilih dari keseluruhan project.
  3. Core Team, membimbing secara keseluruhan arah dan tujuan proyek, dan membuat keputusan akhir dalam kasus perselisihpahaman antar developer mengenai source code atau hal-hal lainnya. (OpenBSD tidak mempunyai core team secara formal, namun Theo de Raadt betugas sebagai pemimpin proyek.).

Setiap orang dapat menjadi contributor, dengan mengirimkan patch, atau membenarkan kesalahan-penulisan dalam sebuah halaman manual. Orang-orang yang mengkontribusikan banyak hal, atau berkompeten dalam sebuah area proyek akan dipromosikan menjadi commiter, hal ini ditujukan untuk menjaga commiter yang lain memeriksa terlalu banyak hal pada waktu yang sama.

G. Feature FreeBSD

§ Binary compatible with others UNIX

ü BSD/OS

ü SCO Unix

ü Linux

ü

§ Runs on x86, DEC Alpha, IA-64, PC-98, and UltraSPARC architectures

§ Networking, performance, security, and compatibility, stability

§ Xfree86 sebagai standard GUI

ü Networking : TCP/IP dari BSD

ü Performance : lebih baik dari sistem operasi komersial!!

ü Stable : 50 server internet ter-stable menurutwww.netcraft.com terdiri atas BSD/OS dan FreeBSD

H. Advanced Features

§ A merged virtual memory and filesystem buffer cache

§ Compatibility modules

§ Kernel Queues

§ Accept Filters

§ Soft Updates

§ Support for IPsec and IPv6

I. Software-Software di BSD

Sebagai implementasi kelengkapan sebuah distribusi, terdapat sebuah aturan dalam memfasilitasi installasi sebuah software kedalam distribusi BSD. BSD memiliki ports dan packages yang diperkenalkan pertama kali di FreeBSD, yang kemudian diadaptasi oleh NetBSD dan OpenBSD. (NetBSD mencoba menghindari kerancuan istilah “port” karena dalam system NetBSD, porting adalah pekerjaan membuat atau memodifikasi system terhadap suatu arsitektur atau platform tertentu, NetBSD menyebutnya sebagai “packages” dan “pre-compiled packages”).

Sebuah package adalah software yang telah dicompile dan siap dijalankan, kira-kira sepadan dengan package yang digunakan oleh distribusi Linux (sebagai contoh RPM). Secara teknis, package tersebut dibundel manjadi sebuah kompresi tarball (.tgz), yang menyertakan file-file yang akan diinstall, ditambah dengan beberapa informasi penting lainnya berkenaan dengan software yang diinstall tersebut. Sebagai contoh packages FreeBSD unzip-5.50.tgz berisi :

+CONTENTS
+COMMENT
+DESC
+MTREE_DIRS
man/man1/funzip.1.gz
man/man1/unzip.1.gz
man/man1/unzipsfx.1.gz
man/man1/zipgrep.1.gz
man/man1/zipinfo.1.gz
bin/unzip
bin/funzip
bin/unzipsfx
bin/zipgrep
share/doc/unzip/README
share/doc/unzip/WHERE

Package diinstall kedalam ${PREFIX} yang sudah terkonfigurasikan, dan secara default adalah /usr/local,/usr/X11R6, atau pada system NetBSD /usr/pkg. Installasi didaftarkan pada sebuah direktori database /var/db/pkg/nama_packages. Pengaturan packages dilakukan dengan berbagai tools pkg_*, seperti pkg_add (1), pkg_delete(1), dan pkg_info(1).

Sebuah port adalah kerangka kerja untuk menginstall software. Secara fungsional, sebuah port sama dengan SPRM, namun bagaimanapun, port tidak menyertakan source tarball dari software.

Biasanya kumpulan port disimpan pada direktory /usr/port/kategori, atau pada NetBSD disimpan pada /usr/pkgsrc. Sebuah port terdiri dari sebuah directory tree dengan beberapa file.

BSD tidak membuat sebuah tool seperti rpm(1) untuk membangun sebuah port, melainkan dengan sebuah infrastuktur berbasis make(1). Sebuah Makefile adalah kunci utama sebuah port, ada sangat banyak variable dalam sebuah makefile yang memungkinkan melakukan tindakan build dengan lebih cermat dan pada umumnya terdapat 2000 sampai 3000 baris dalam sebuah makefile, oleh karena itu dalam lingkungan BSD, makefile tersebut disertakan dalam file bsd.port.mk, sedangkan Makefile yang ada pada port hanya berisi variable yang ingin disertakan menjadi sebuah package. Contoh Makefile pada /usr/ports/net/tcpillust milik FreeBSD :

# new ports collection makefile for: tcpillust

# date created: 14 April 2000

# whom: nishida@csl.sony.co.jp

#
# $FreeBSD: ports/net/tcpillust/Makefile,v 1.4 2003/02/21 13:15:03 knu Exp $

#
PORTNAME= tcpillust

PORTVERSION= 1.0a

CATEGORIES= net tk82 tcl82

MASTER_SITES= ftp://ftp.csl.sony.co.jp/CSL/nishida/

MAINTAINER= nishida@csl.sony.co.jp

COMMENT= A graphical TCP connection analysis tool

LIB_DEPENDS= tk82.1:${PORTSDIR}/x11-toolkits/tk82 ¥

tcl82.1:${PORTSDIR}/lang/tcl82
USE_IMAKE= yes

GNU_CONFIGURE= yes

CONFIGURE_ARGS=
USE_MOTIF= yes

MAN1= tcpillust.1

DOCS= README

SAMPLES= tcpclient.log tcpserver.log

post-install:
.if !defined(NOPORTDOCS)

${MKDIR} ${PREFIX}/share/doc/tcpillust

for i in $(DOCS); do ¥

${INSTALL_DATA} ${WRKSRC}/$$i ${PREFIX}/share/doc/tcpillust; ¥

done

${MKDIR} ${PREFIX}/share/doc/tcpillust/sample

for i in $(SAMPLES); do ¥

${INSTALL_DATA} ${WRKSRC}/sample/$$i

${PREFIX}/share/doc/tcpillust/sample; ¥

done

.endif
.include

Proses build dan installasi sebuah port biasanya adalah:

# cd /usr/ports/net/tcpillust

# make install clean

Perintah tersebut akan melakukan proses :

§ Memeriksa apakah distribusi source berupa tarball tersedia dalam system, dan jika tidak diketemukan akan mengambil dari Internet.

§ Memeriksa checksum file source tersebut.

§ Mengekstrak source kedalam sebuah direktory kerja.

§ Melakukan patch jika tersedia.

§ Memeriksa dependencies software yang bersangkutan, bila dependencies sudah terinstall maka akan melanjutkan proses installasi bila tidak maka akan melakukan installasi terhadap software dependencies tersebut.

§ Melakukan patch yang dibutuhkan untuk mengadaptasikan software ke BSD

§ Menjalankan proses configure.

§ Meng-compile program.

§ Menginstall program.

§ Membersihkan direktory kerja.

J. System Administrasi

Seperti operating system lainnya, BSD memiliki gaya/style tersendiri. BSD tidak menyediakan sebuah tool administrasi seperti SMIT pada AIX, SAM pada HP-UX, atau YaST pada SuSE. Konfigurasi dari system ditanggani dengan mengedit file teks dalam direktori /etc, dan ada banyak konfigurasi pada saat startup dikumpulkan pada sebuah file /etc/rc.conf seperti:

§ Console : font, keymap, screensaver

§ Network : interface, firewall, NAT

§ Daemon : sendmail, lpd, ntp

Walaupun BSD system menyertakan sebuah kernel default, namun sangat disarankan untuk membuat sebuah custom kernel dengan tujuan membuat perampingan pada system, menggunakan hanya driver yang benar-benar dibutuhkan, mempercepat waktu loading, dan menghemat memory. Berikut adalah cara untuk membuat kernel custom :

§ Membuat atau mengedit konfigurasi kernel berdasarkan kernel GENERIC di /sys/arch/`arch`/conf/NAMA_KERNEL (FreeBSD: /sys/`arch`/conf)

§ Jalankan config(8) dan make(1).

BSD menyediakan sebuah cara professional untuk melakukan report dan melacak permasalahan yang ada, serta mengumpulkan feedback dari pengguna. Dengan menggunakan send-pr(1) (OpenBSD: sendbug) yang akan memberikan penjelasan detail permasalahan yang dihadapi, dan mengisi formulir yang dapat dikirimkan via e-mail pada GNATS bug tracking system, mengumpulkannya dalam sebuah database, dan kemudian akan ada developer yang menangani masalah yang dihadapi.

K. File System

BSD memiliki format partisi tersendiri, dan BSD tidak menggunakan partisi IBM/Microsoft, sehingga harddisk harus diset dengan format BSD. FreeBSD menyebut bagian ini dengan “slice”, dan dalam slice tersebut partisi BSD dibuat. Secara umum, a adalah partisi boot, b adalah partisi swap, dan c adalah partisi bayangan yang memuat sebuah bagian dari disk.

BSD memilih partisi asli untuk disk adalah FFS (Berkeley Fast File System) sedangkan on-disk data layout didefinisikan oleh UFS. FFS diperkenalkan sebagai implementasi modern UNIX file system, yang lebih memberikan banyak pilihan dimana setting sebuah file dapat dihapus, tidak dapat diedit, dan lain-lain.

L. Lain-Lain

Dalam banyak FAQ (frequently asked questions) terdapat pertanyaan yang sering diutarakan yaitu, dimana dokumentasi mengenai BSD dapat ditemukan. Pertanyaan ini sangat mudah ditemukan jawabannya dan berikut menjawab pertanyaan tersebut.

§ BSD menyertakan halaman-halaman manual dalam setiap distribusinya.

§ Setiap distribusi BSD mempunyai sebuah FAQ atau beberapa, dalam website resminya.

§ FreeBSD documentation project telah menghasilkan FreeBSD Handbook, sebuah tutorial dan referensi yang juga dapat diterapkan pada NetBSD dan OpenBSD.

§ Sebuah tulisan. The Design and Implementation of the 4.4BSD Operating System, karangan Marshall Kirk McKusick, dapat dijadikan patokan untuk melakukan pengembangan atau pemahaman mengenai system BSD secara lebih lanjut.

§ Sebuah tulisan lain mengenai BSD, The Complete FreeBSD, karangan Greg Lehey, juga mengangkat masalah serupa.

§ Search engine juga dapat membantu mencari jawaban setiap pertanyaan yang berkaitan dengan BSD.

§ Arsip mailing-list yang berkaitan dengan distribusi BSD secara lebih spesifik yang dapat dicari pada website resminya.

M. Perbedaan BSD (FreeBSD) dengan Linux

§ Perbedaan antara FreeBSD dengan Linux lebih kepada aspek filosofi daripada konsep.

§ FreeBSD turunan langsung dari UNIX, meskipun sekarang sudah tidak mengandung source code AT&T.

§ Linux adalah clone dan tidak pernah mengandung source code AT&T
FreeBSD adalah sistem operasi yang komplit/lengkap, dipelihara oleh sebuah kelompok developers yang tersentralisasi dibawah Concurent Versions System (CVS) yang memelihara secara lengkap sejarah pengembangan. Hanya ada satu distribusi FreeBSD.

§ Linux adalah kernel yang secara personal dipelihara oleh Linus Torvalds dan beberapa kawan dekat Linus. Program yang non-kernel disupply bersama Linux adalah bagian dari distribusi, dimana distribusi itu sendiri ada beberapa macam. Tiap distribusi sering kali tidak kompatibel.

§ Gaya pengembangan FreeBSD menekankan pada akuntanbilitas dan dokumentasi pada perubahan.

§ Kernel Linux dipelihara oleh beberapa orang yang tetap mengikuti tiap perubahan. Patches yang ada adalah bersifat unofficial dan banyak tersebar di internet oleh komunitas.

§ Kernel yang disediakan oleh FreeBSD pada tiap release dideskripsikan dengan jelas.

§ Distribusi linux kadang menyediakan kernel yang berbeda. Dan perbedaan tersebut sering tidak terdokumentasi dengan baik.

§ Sebagai hasil pengembangan yang tersentralisasi, FreeBSD bersifat Straightforward dan mudah di install.

§ Installasi Linux bergantung pada distribusi yang digunakan.

§ FreeBSD relatif tidak dikenal karena sebelumnya memang sempat terrestriksi oleh kasus hukum dengan source code UNIX AT&T.

§ Linux tidak mempunyai kasus hukum sehingga mejadi satu-satunya clone UNIX yang bebas/free.

§ Sebagai hasil kurang dikenalnya FreeBSD, maka relatif sedikit dukungan software komersial yang dapat berjalan diatas FreeBSD.

§ Semakin banyak dukungan software komersial untuk Linux.

§ Sebagai hasil sedikitnya pengguna, FreeBSD mempunyai dukungan yang sedikit terhadap driver hardware daripada Linux.

§ Besarnya komunitas Linux, membuat dukungan hardware dari vendor juga semakin banyak.

§ Sebagai hasil sedikitnya aplikasi komersial dan driver untuk FreeBSD, maka FreeBSD dapat menjalankan program yang ada pada Linux baik komersial maupun non komersial.

§ Linux tidak perlu menjalankan program yang ada pada FreeBSD
Lisensi FreeBSD adalah lisensi BSD.

§ Lisensi Linux adalah GNU GPL. Bila dibandingan dengan lisensi BSD lisensi GNU GPL mempunyai beberapa restriksi terhadap source code dengan kata lain lisensi BSD lebih bebas daripada lisensi GNU GPL. 7

N. FreeBSD’s Users

§ 2181 registered commercial organizations :

ü Yahoo!

ü Walnut Creek CDROM

ü Sony Corporation

ü Internet Movie Database

ü Manchester Computing

§ 949 registered non-profit organizations

§ 701 registered personal user

§ Thousands of unregistered users

O. Sumber

Berbagai Sumber di Internet.

disini adalah contoh yang saya terapkan dimesin FreeBSD 7 dimana juga sebagai NAT dengan menggunakan 2 ethernet card yaitu fxp0 dan rl0,

Pertama tama aktifkan dulu tcp forwarding di FreeBSD anda dengan perintah

yunand# sysctl -w net.inet.ip.forwarding=1

agar bisa dijalankan saat mesin hidup edit di /etc/sysctl.conf

masukkan di sysctl.conf net.inet.ip.forwarding=1

Setelah itu bikin file config ppp seperti dibawah ini :

yunand# cat ppp.conf
#
# ppp.conf: PPPoE configuration
#

default:
# PPP over Ethernet
set device PPPoE:fxp0 (tergantung landcard yang dipasang modem adsl)
set speed sync
set mru 1492
set mtu 1492
set ctsrts off

# monitor line quality
enable lqr

# log just a bit
set log phase tun

# insert default route upon connection
add default HISADDR

# download /etc/resolv.conf
enable dns

speedy:
set authname user speedy
set authkey password speedy

untuk dialnya menggunakan perintah

yunand# ppp -ddial papchap

Loading /lib/libalias_cuseeme.so
Loading /lib/libalias_ftp.so
Loading /lib/libalias_irc.so
Loading /lib/libalias_nbt.so
Loading /lib/libalias_pptp.so
Loading /lib/libalias_skinny.so
Loading /lib/libalias_smedia.so
Working in ddial mode
Using interface: tun0

jika berhasil cek ip

yunand # ifconfig

tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1492
inet 125.163.*.* –> 125.163.*.* netmask 0xffffffff
Opened by PID 994


jika keluar seperti itu berarti koneksi berhasil

setelah itu coba tes ping ke google

yunand# ping www.google.com

PING google.com (72.14.207.99): 56 data bytes
64 bytes from 72.14.207.99: icmp_seq=0 ttl=242 time=593.632 ms
64 bytes from 72.14.207.99: icmp_seq=1 ttl=242 time=624.894 ms
64 bytes from 72.14.207.99: icmp_seq=2 ttl=242 time=617.091 ms
64 bytes from 72.14.207.99: icmp_seq=3 ttl=242 time=619.140 ms

kalau reply seperti diatas berarti koneksi berjalan lancar

kalau ingin mematikan koneksi adslnya pake perintah

yunand# killall ppp

untuk sharing internetnya saya menggunakan packet filter openbsd, aktifkan packet filternya agar bisa

dijalankan setiap boot

yunand#pico /etc/rc.conf

pf=”YES”

sedangkan script pf.conf nya saya pakai seperti ini

yunand# cat pf.conf
lan_net  = “192.168.2.0/24″ #ip client
int_if1  = “fxp0″ #lancard yg ke modem adsl
int_if2  = “rl0″ #lancard yg ke akses point/client
ext_if   = “tun0″

# nat outgoing connections on each internet interface
nat on $ext_if from $lan_net to any -> ($ext_if)
nat on $int_if1 from $lan_net to any -> ($int_if1)

lalu jalankan pf nya

yunand# pfctl -f /etc/pf.conf

setelah itu cek clientnya apakah bisa konek keinternet

source : http://www.yunand.info

This tutorial will cover firewall principles and implementation of a firewall in FreeBSD with IPFW.

Firewall (networking), a logical barrier designed to prevent unauthorized or unwanted communications between sections of a computer network”  Wikipedia.org
Well this is a general description. In order to make a successfull firewall a good understanding of firewalling principles and security measures to prevent different kinds of attacks is needed.

1. Type of attacks

a. Unauthorized access
People who succeed to access your servers/network from inside or outside  (for example by finding weak passwords with bruteforce programs). Preventing unauthorized access can be done by automaticaly force users from time to time to change their passwords, by enforcing them to choose strong passwords (not word from dictionary, letters and numbers, 8-10 characters minimum), by deleting accounts of people that do not work anymore for respective organization/company. A good policy of preventing unauthorized access does not refer only to server accounts but also to implement a security policy for network resources (file servers and print servers).  

b. Exploits of bugs in programs
Some of the applications within operating system or userland applications installed on the server might have bugs/vulnerabilities. Those vulnerabilities might be exploited to gain access. To prevent that kind of security problems a good advice is to disable all services you do not need. Run only minimum/necessary services. Also be informed about security vulnerabilities of your installed applications (there are a lot of internet resources regarding security vulnerabilities) and when a version of your installed application is vulnerable, patch it. Also from time to time audit your server security.

c. Spoofing
This techinique is used to fake a host, in order to comunicate to victim host, creating the idea that victim communicate to a real/known host. To protect against this type of attacks it is recommended to setup the firewall to  verify datagrams’s authenticity, block datagram routing with invalid source address. Also can be introduced into firewall a system for connection control mechanism to introduce unpredictibility (generating random ports for every connection, TCP sequence numbers and allocation of dynamic port address.

d. DoS and DDoS attacks
DoS attacs (Denial of Service) are done at network layer or applicaton layer by causing a service (or application) to cease functioning, or blocking others from making use of the service. On application layer due to a DoS attack that application wil cease functioning. DoS attacs could consume a lot of resources from the server (cpu, bandwidth for example). To protect against those kind of attacs is good to configure firewall to drop suspicious network traffic that reach your host. Some configurations of applications, firewall and different sysctl variables will help to prevent a DoS attack, or at least to add a certain degree of protection. DDoS attacks are harder to stop since are distributed, for some is almost impossible to protect, a help from ISP will help add filters to your IP.

e. Eavesdropping
This type of attack is about configuring a host to capture data that does not belong to it. Ethernet networks are vulnerable to this kind of attack because are based on broadcasts. Some measures to protect against eavesdropping are  avoiding use of broadcast networks and enforce the usage of data encryption.

2. Firewalls
Firewall is an important part of network/server security. Firewalls are located between local network and internet network. Firewall consist in a set of rules that determines which packets should pass and which shoud be dropped.

There are two types of policy involved in designing a firewall: Deny all and accept some, or accept all and deny some. First is a better, more secure aproach.

Firewalls will filter:
- TCP, UDP, ICMP protocols
- socket numbers (TCP/UDP)
- datagrams: data, SYN/ACK, ICMP Echo Request and more
- datagram source address
- datagram destination address

Firewall is implemented under FreeBSD in 3 variants: IPFILTER, IPFW and PF (OpenBSD Packet Filter, ported under FreeBSD). We will detail here IPFW firewall. The other firewalls will be described in a future tutorial.

3. Firewall design
There are different implementations of firewalls. The most simple setup is presented in Diagram 1.

Typical Firewall Setup
Diagram 1
Starting from typical firewall a version with 2 LANS can be implemented. Distinct two LANs will be on different subnets, and will not see each other. This setup can also be implemented with a managed switch and virtual LANs. Typical firewall with 2 lans is presented in Diagram 2.
Typical Firewall with two LANs
Diagram 2
If we have a Web Server, Mail server, Database Server and we want to separete is from internal LAN, we can use DMZ setup (DMZ = Demilitarized Zone). Servers located on DMZ will not be seen from LAN and viceversa. (will be on different subnets).
Firewall with DMZ
Diagram 3
Another interesting firewall setup is to achieve High Availability. That means we will use two Internet lines, with two firewalls. If one firewall or Internet connection fail, Internet conectivity will not be lost, the traffic will go trough firewall which is up. High Availability is implemented in Diagram 4.
High Availability Firewall
Diagram 4


4. How firewall filter works
IP datagram processing steps:
a) The IP datagram is received by firewall.
 The IP datagram is analysed to determine if its destination is this machine.
b) If the datagram is for this machine, then it is processed localy
c) If the datagram is not for this machine, a search is made into routing table, then according to routing table the datagram is forwarded to the appropriate interface or dropped if no route is found
d) Datagrams from local processes are sent do the routing software for forwarding to the appropriate interface.
The outgoing IP datagram is analysed to determine if is a valid route for it to follow, and if isn’t, the datagram is dropped.
e) The IP datagram is transmitted.

5. IP Packet Filtering
There are three different types of packet that we need to filter: TCP, UDP and ICMP

TCP (Transmission Control Protocol)

UDP (User Datagram Protocol)

ICMP (Internet Control Message Protocol)

6. IPFW Firewall
In order to activate ipfw firewall, ipfw must be supported in Kernel or a module must be loaded. To load ipfw:
#kldload ipfw

If you do not have configured ipfw mode default to accept, then after loading ipfw module the only rule in firewall will be deny ip from any to any, that means all traffic will be blocked. So you will have to add some rules in order to access internet.

6.1 Kernel configuration for IPFW
The best way is to recompile kernel with support for ipfw. Adding support in kernel is preffered because of performance and security. It works well as module too but if you want to build a dedicated router/firewall is better to modify kernel configuration file, remove all drivers you do not need and add support in kernel for ipfw.

Following options need to be present in Kernel:

options IPFIREWALL
This option enable ipfw in Kernel.

options IPFIREWALL_VERBOSE
Enable logging with ipfw. If this option is set in kernel,  net.inet.ip.fw.verbose sysctl variable is set to 1, allowing to log ipfw (log keyword in ipfw).

options IPFIREWALL_VERBOSE_LIMIT=value
This option controls how many matching packets will be logged per rule, before logging is disabled. This option acts as a hard limit for firewalls that have not set logamount variable. This variable can be changed with sysctl variable: net.inet.ip.fw.verbose_limit.

 

options IPFIREWALL_DEFAULT_TO_ACCEPT
By default if ipfw is enabled in kernel (or loaded as module) it will add a rule to block everything. This option will reverse this, allowing all traffic through the firewall. This option is not recommended for production firewalls, and is sometimes used for testing purposes.

options IPFIREWALL_FORWARD
This option allows you to use fwd keyword in your ipfw rule, to direct traffic to hosts or ports you want. For example you want to redirect all traffic that has destination port 80 (www) to a server from your LAN.

options IPSTEALTH
This option is used for by firewall not to decrement time to live (TTL) value. This is used to hide presence of your firewall for outside world (your firewall will not be seen with traceroute command).

6.2 IPFW Rules
6.2.1 Overview of IPFW Rules

IPFW use a set of rules control firewall functionality. Rules can be numbered and order in which packets will be compared to firewall rules is from first rule, to last. Each rules has an associated action (allow or deny) and when a rule is matched, processing is stoped (the action for the first matching rule determine how the packet is processed.

Creating a simple firewall:

#ipfw add allow ip from me to any                                            # (a)
#ipfw add allow ip from any to me established                     # (b)
#ipfw add allow tcp from any to me port 25 setup                # (c)
#ipfw add allow tcp from any to me port 80 setup                # (d)
#ipfw add deny ip from any to any                                            # (e)

Rules explained:
a.  Allow traffic from me to any other host (on local network or Internet)
b. Allow incoming traffic for all host as long as is a part of already established connection (no rules have been specified to permit connections to be established)
c. Allow tcp connections from outside world to connect to this host

6.2.1 Examples of IPFW Rules

Block computer with a specific MAC
——————————————–
# ipfw add 10 deny MAC any 00:0a:e4:a1:b0:9b

(in order this rule to work you shoud change the following sysctl variable to 1:
sysctl -w net.link.ether.ipfw=1)

Block PING to the server
——————————
# ipfw add deny icmp from any to me icmptypes 8 in recv fxp0

source : /www.unixreport.org

Configure a router with FreeBSD

1. Install FreeBSD
2. Compile kernel with aditional options for ipfw router:

3. execute at prompt:
#cd /usr/src/sys/i386/conf
#cp GENERIC ROUTER
#edit ROUTER

4. —- add in file ROUTER, at the end the following lines ———-
options IPDIVERT
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_FORWARD
options DUMMYNET
options HZ=1000
—- end of file router

5. execute at prompt:
# config ROUTER
# cd ../compile/ROUTER
#make depend
#make
#make install

6. —- edit /etc/rc.conf —————————————————-
defaultrouter=”86.124.80.1″
gateway_enable=”YES”
hostname=”router”
ifconfig_fxp0=”inet 83.123.213.23 netmask 255.255.255.252″
ifconfig_fxp1=”inet 10.0.0.1 netmask 255.255.255.0″
sshd_enable=”YES”
natd_enable=”YES”
natd_flags=”"
named_enable=”YES”
natd_interface=”fxp0″
firewall_enable=”YES”
firewall_quiet=”NO”
firewall_script=”/etc/router.firewall”
firewall_logging=”YES”
inetd_enable=”YES”
kern_securelevel_enable=”NO”
—- end of rc.conf

7. —- edit /etc/resolv.conf ————————————————
nameserver ip_of_your_dns
—- end of resolv.conf ———————————————

8. —- edit /etc/router.firewall———————————————-
fwcmd=/sbin/ipfw                                      
$fwcmd add 00010 divert 8668 ip from any to any via fxp0
$fwcmd add 00020 allow ip from any to any via lo0    
$fwcmd add 00030 deny ip from any to 127.0.0.0/8
$fwcmd add 00040 deny ip from 127.0.0.0/8 to any

$fwcmd add 50 allow ip from 10.0.0.2 to any
$fwcmd add 60 allow ip from any to 10.0.0.2

$fwcmd add 70 allow ip from 10.0.0.3 to any
$fwcmd add 80 allow ip from any to 10.0.0.3

$fwcmd add 90 allow ip from 10.0.0.4 to any
$fwcmd add 100 allow ip from any to 10.0.0.4

$fwcmd add 110 allow ip from 10.0.0.5 to any
$fwcmd add 120 allow ip from any to 10.0.0.5

$fwcmd add 35000 allow ip from me to any
$fwcmd add 35001 allow ip from any to me
—- end of router.firewall——————————————–

Comments:
fpx0 is external interface, you should assign your public ip here
fxp1 is internal interface

fxp0 and fxp1 are intel network cards, you should use your own devices here, if you have other types of cards then your nic device will not be fxp.
To check the name of your devices type ifconfig or  dmesg | more.

The file /etc/router.firewall is the firewall rule file, in this example I’ve allowed only ips 10.0.0.2-10.0.0.5 to use the router.

In the file /etc/resolv.conf you must put your dns servers, so instead of ip_of_your_dns here in example you should have the ip of your dns :D

After compiling the kernel don’t forget to reboot.

source : www.unixreport.org

Teori Singkat
Portsentry merupakan salah satu program aplikasi firewall, yang bisa melakukan pemblokiran
terhadap user yang mencoba melakukan scanning port sistem atau mencoba melakukan aktivitas yang
“tidak terpuji”, antara lain melakukan penyusupan melalui alamat port yang ada. Dengan adanya
portsentry, semua alamat IP yang melakukan aktivitas yang dianggap “mencurigakan”, baik yang
melalui port TCP maupun UDP akan segera diblokir. Sehingga semua user yang menggunakan alamat IP
yang sama seperti warnet, perkantoran, dan anggota ISP, tidak akan bisa mengakses server kita
lagi.

Langkah-langkah install portsentry

router# whereis portsentry
portsentry: /usr/ports/security/portsentry
router# cd /usr/ports/security/portsentry
router# make install clean
===> Vulnerability check disabled, database not found
>> portsentry-1.1.tar.gz doesn’t seem to exist in /usr/ports/distfiles/.
>> Attempting to fetch from http://packetstormsecurity.nl/UNIX/IDS/.
portsentry-1.1.tar.gz 100% of 44 kB 13 kBps
===> Extracting for portsentry-1.1
>> Checksum OK for portsentry-1.1.tar.gz.
===> Patching for portsentry-1.1
===> Applying FreeBSD patches for portsentry-1.1
===> Configuring for portsentry-1.1
===> Building for portsentry-1.1
SYSTYPE=freebsd
Making
cc -O -pipe -DPREFIX=\”/usr/local\” -DBSD44 -o ./portsentry ./portsentry.c ./portsentry_io.c

./portsentry_util.c
===> Installing for portsentry-1.1
===> Generating temporary packing list
===> Checking if security/portsentry already installed
install -o root -g wheel -m 444

/usr/ports/security/portsentry/work/portsentry-1.1/portsentry.conf
/usr/local/etc/portsentry.conf.default
install -o root -g wheel -m 444
/usr/ports/security/portsentry/work/portsentry-1.1/portsentry.ignore /usr/local/etc
install -s -o root -g wheel -m 555
/usr/ports/security/portsentry/work/portsentry-1.1/portsentry /usr/local/bin
/bin/mkdir -p /usr/local/share/doc/portsentry
install -o root -g wheel -m 444
/usr/ports/security/portsentry/work/portsentry-1.1/README.install
/usr/ports/security/portsentry/work/portsentry-1.1/README.methods
/usr/ports/security/portsentry/work/portsentry-1.1/README.stealth
/usr/local/share/doc/portsentry
Edit ${PREFIX}/etc/portsentry.conf and change
your settings if you haven’t already. (route, etc)
***************************************************
* IGNORE stealth mode. It is for Linux only. *
* The author hopes to have a platform independent *
* version at some time. So don’t even bother *
* trying it now. *
***************************************************
===> Registering installation for portsentry-1.1
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/bin/portsentry

If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type ‘make deinstall’
to deinstall the port if this is a concern.
===> Cleaning for portsentry-1.1

router# cd /usr/local/etc/
router# cp portsentry.conf.default portsentry.conf
router# touch portsentry.blocked
router# touch portsentry.history
router# touch portsentry.ignore

edit portsentry.ignore,tambahkan ip address yang ingin di allow

# If you don’t supply a netmask it is assumed to be 32 bits.
#
#
192.168.1.0/24
125.162.89.32/32
127.0.0.1/32
0.0.0.0

edit portsentry.conf, tambahkan setingan

# FreeBSD
KILL_ROUTE=”route add -net $TARGET$ -netmask 255.255.255.255 127.0.0.1 -blackhole”

Jalankan Portsentry
router# /usr/local/bin/portsentry -tcp
router# /usr/local/bin/portsentry -udp

cek di background

router# tail -f /var/log/messages
Mar 13 18:43:40 router portsentry[1577]: adminalert: Going into listen mode on UDP port: 34555
Mar 13 18:43:40 router portsentry[1577]: adminalert: Going into listen mode on UDP port: 31335
Mar 13 18:43:40 router portsentry[1577]: adminalert: PortSentry is now active and listening.

router# tail -f /var/log/messages
Mar 12 22:15:26 router kernel: /cache3: optimization changed from SPACE to TIME
Mar 12 22:51:32 router portsentry[367]: attackalert: Connect from host: 92.62.43.77/92.62.43.77
to TCP port: 1080
Mar 12 22:51:32 router portsentry[367]: attackalert: Host 92.62.43.77 has been blocked via
wrappers with string: “ALL: 92.62.43.77″
Mar 12 22:51:32 router portsentry[367]: attackalert: Host 92.62.43.77 has been blocked via
dropped route using command: “route add -net 92.62.43.77 -netmask 255.255.255.255 127.0.0.1
-blackhole”
Mar 13 14:20:01 router portsentry[367]: attackalert: Connect from host:
118-160-210-61.dynamic.hinet.net/118.160.210.61 to TCP port: 1080
Mar 13 14:20:01 router portsentry[367]: attackalert: Host 118.160.210.61 has been blocked via
wrappers with string: “ALL: 118.160.210.61″
Mar 13 14:20:01 router portsentry[367]: attackalert: Host 118.160.210.61 has been blocked via
dropped route using command: “route add -net 118.160.210.61 -netmask 255.255.255.255 127.0.0.1
-blackhole”

contoh ip yang sudah kena blok oleh portsentry

router# cat /etc/hosts.deny
ALL: 194.14.236.50
ALL: 208.99.203.190
ALL: 149.9.1.16
ALL: 194.14.236.50
ALL: 118.136.65.80

Berhubung saya mau mainan Router dengan FreeBSD jadi ada baiknya kenel saya konfigurasika dulu untuk mendukung semua keperluan saya.

Yang perlu saya konfigurasi adalah membuat kernel agar support PF (PF miliknya OpenBSD nech :p;) trus support ALTQ CBQ trus untuk optimasi SQUID supaya bisa dukung diskd dan meng-unload konfigurasi-konfigurasi yang tidak saya gunakan pada kernel seperti dukungan terhadapa Slot ISA, RAID dan SCSI, USB, Wireless de eL eL -lah.

Untuk mengkonfigurasi kernel FreeBSD silahkan lakukan langkah-langkah berikut ini :

# cd /usr/src/sys/i386/conf
# cp GENERIC ROUTER
# ee ROUTER

Sebenarnya cara konfigurasi kernel ini dapat dilihat pada ebook-nya om 1smail pada tulisan saya terdahulu. Disini saya hanya menambahkan beberapa parameter untuk mengaktifkan fiture-fiture yang akan saya gunakan seperti yang saya sebutkan sebelumnya diatas :p .

kembali ke ee ROUTER pada bagian-bagian seperti

machine i386
#cpu I486_CPU
#cpu I586_CPU
cpu I686_CPU
ident Router

#options MSDOSFS

#options SCSI_DELAY=5000

# SCSI Controllers — commend semunya untuk menonaktifkan dukungan

#device ahb
#device ahc
#device ahd
#device amd
#device isp
#device ispfw
#device mpt
#device ncr
#device sym
#device trm

#device adv

#device adw
#device aha
#device aic
#device bt

#device ncv
#device nsp
#device stg

# SCSI peripherals
#device scbus
#device ch
#device da
#device sa
#device cd
#device pass
#device ses

# RAID controllers interfaced to the SCSI subsystem
#device amr
#device arcmsr
#device asr
#device ciss
#device dpt
#device hptmv
#device rr232x
#device iir
#device ips
#device mly
#device twa

# RAID controllers
#device aac
#device aacp
#device ida
#device mfi
#device mlx
#device pst
#device twe

# PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
#device cbb
#device pccard
#device cardbus

## cape nilisnya selanjutnya perkategori aza yach :) ) ati-ati salah oke !

# ISA Ethernet NICs –> comment semua dibawahnya
# Wireless NIC cards –> comment semua dibawahnya
#USB Support –> comment semua dibawahnya
# FireWire support –> comment semua dibawahnya

Apa yang saya lakukan diatas adalah untuk menonaktifkan dukungan hardware terhadap perangkat-pernangkat yang tidak saya gunakan… ini berguna untuk meng-efisiensikan kernel terhadap sistem saya nantinya… dan yang paling penting adalah saya menambahkan ini pada bagian akhir konfigurasi file ROUTER untuk mengaktifkan beberapa parameter :

###—untuk support PF—-###
device pf
device pflog
device pfsync

###—untuk support altq cbq—###
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_PRIQ
options ALTQ_NOPCC

###—untuk optimasi squid untuk dukungan diskd—###
options SYSVMSG
options MSGMNB=32768
options MSGMNI=164
options MSGSEG=8196
options MSGSSZ=512
options MSGTQL=2048

###—optional—###
device carp
options HZ=1000

Setelah selesai save dan keluar dari editor dengan menekan [Esc] dan [Enter] 2x !

Selanjitnya tinggal meng-compile kernel yang baru saya dikonfigurasi :

# config ROUTER
# cd .. ../compile/ROUTER
# make cleandepend
# make depend
# make all
# make install

Selanjutnya tinggal di reboot dech… :D

sumber: http://adityaperdana.web.id

Next Page »