Konfigurasi DHCP pada server freeBSD

DHCP merupakan protokol yang digunakan oleh komputer-komputer dalam sebuah jaringan untuk menentukan parameter seperti default gateway, subnet mask, dan IP address, DNS dari DHCP server. Fungsi umum DHCP server adalah untuk mempermudah pengalokasian IP address (selanjutnya disebut IP) dan juga pengaturan IP yang sangat dinamis untuk membantu memudahkan user agar tidak perlu mensetting IP ketika ada penambahan user baru atau setelah format ulang sebuah PC. Informasi lengkap mengenai DHCP silahkan baca di http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#Introduction.

Setelah anda memahami fungsi dan cara kerja DHCP Server, marilah kita mencoba untuk menginstall sebuah DHCP Server.

Pertama yang harus dilakukan adalah login sebagai root pada server Anda, lalu masuk ke directory ports dhcp server

indofreebsd# cd /usr/ports/net/isc-dhcp3-server/
indofreebsd# make install

Setelah selesai installasi lakukan konfigurasi pada dhcp server tersebut.

Jika belum ada aplikasi dhcp-server, dapat melakukan langkah berikut :

Langkah-langkah berikut bisa dipakai untuk installasi dhcpd dari source-nya.

#wget http://ftp.isc.org/isc/dhcp/dhcp-3.0.6.tar.gz
#tar -zxvf dhcp-3.0.6.tar.gz
#cd dhcp-3.0.6
#./configure
#make
#make install

indofreebsd# pico /usr/local/etc/dhcpd.conf

contoh isi dhcpd.conf-nya

#—-mulai—–#

ddns-update-style none;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.1 192.168.1.100;
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.254;
option domain-name “http://mu2jotex.co.cc”;

default-lease-time 3600;
max-lease-time 86400;
}

#—selesai—-#

Simpan setelah selesai mengedit file konfigurasi di atas.

Lakukan konfigurasi pada rc.conf untuk menentukan jalannya DHCP server dan listen di interface mana DHCP server tersebut.

indofreebsd# ee /etc/rc.conf

tambahkan:

# —-mulai—-#

dhcpdenable=”YES”
dhcpdflags=”-q”
dhcpdconf=”/usr/local/etc/dhcpd.conf”
dhcpdwithumask=”022″
dhcpdwithgroup=”dhcpd”
dhcpd_ifaces=”rl1”

#—-selesai—#

kemudian simpan perubahan.

Jalankan DHCP server

indofreebsd# /usr/local/etc/rc.d/isc-dhcpd start

Starting dhcpd.

Sampai tahap ini selesai sudah proses menginstall dan menjalankan DHCP server. Untuk feature-feature lain silakan bereksprimen sendiri.

Sekarang kita coba DHCP server baru dengan mensetting obtain IP adress automatically pada PC windows atau menjalankan dhcpclient pada PC freebsd. Perhatikan aktivitas DHCP server lease tersebut dengan cara:

indofreebsd# tail -f /var/db/dhcpd.leases
lease 192.168.1.1 {
starts 2 2007/01/30 23:25:05;
ends 3 2007/01/31 00:25:05;
tstp 3 2007/01/31 00:25:05;
binding state active;
next binding state free;
hardware ethernet 00:01:6c:b0:d0:44;
uid “\001\000\001l\260\320D”;
client-hostname “underiez”;
}


Konfigurasi dan Optimasi Kernel pada FreeBSD (Lanjutan)

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


Langkah - langkah Menginstall FreeBSD

Langkah Instalasi FreeBSD 4

–Panduan Singkat

Tulisan ini merupakan sebuah prosedur ringkas cara menginstalasi FreeBSD. Tetapi disini ditambahkan fungsi portupgrade -ai (mengganti semua port, dengan konfirmasi), yang memerlukan beberapa konfigurasi lokal dalam file pkgtools.conf. Tujuan uraian ini adalah memakai cvsup.sh && build-world-kernel.sh, dan terbangunnnya sistem yang dapat memberitahu anda apa yang harus dikerjakan kemudian agar instalasi lengkap dengan sedikit usaha. Bagi pemula, sebaiknya pada waktu praktek mengikuti langkah langkah berikut didampingi rekan yang telah terbiasa dengan instalasi FreeBSD. Penjelasan tentang perintah dalam FreeBSD silahkan lihat FreeBSD Handbook. Setelah anda sukses melakukan instalasi FreeBSD, gantilah kernel anda, dan instalasi beberapa port-nya.

Anda perlu perhatikan perintah instant-server dan instant-workstation meta-ports, yang menyatukan layanan yang diperlukan dan aplikasi dekstop. Terutama jika anda mengetik

cd /usr/ports/misc/instant-workstation && make

sistem anda akan menginstalasi berbagai macam software yang bermanfaat secara otomatis.

Dalam uraian ini tidak dijelaskan bagaimana mengubah script yang ada, anda mungkin harus memutuskan mengedit script dalam sistem anda nantinya dan disesuaikan dengan data teknis jaringan komputer anda. Pengeditan script bisa dilakukan dengan mengetik perintah vi namafilenya, setelah muncul filenya barulah anda edit atau isi dengan data teknis jaringan anda seperti nama host, IP address, netmask dll.

Catatan: Perintah $myself dan $hostname, yang dipakai dibawah ini tidak ditujukan sebagai variabel shell sebenarnya. Ketika anda melihat mereka, langsung masukan saja data yang sesuai dengan jaringan komputer anda. Postfix akan memakai variable yang ada didalam file main.cf, ingat – nama variabel dalam posfix (tidak ditulis italic) dan dapat diakses langsung, jadi Postfix dapat melakukan substitusi variabel secara sendiri.

Catatan: File file yang dipakai dalam prosedur ini ditujukan untuk pemakaian umum, dan meliputi berbagai saran. Namun ini belum tentu sesuai atau optimal bagi kebutuhan sistem anda. Akan tetapi cara berikut ini dapat merupakan awal yang baik bagi instalasi sistem anda. Disarankan untuk mendownload file resource bari uraian ini dari http://www.reppep.com/~pepper/freebsd/install/reppep.tgz, kemudian lihat dan sesuaikan dengan kebutuhan anda lalu copikan ke direktori /root/reppep untuk melanjutkan prosedur berikut nya.

Tip: Reboot after finishing each main heading, to make sure you haven’t broken anything too badly. If you break something and don’t notice quickly, fixing the problem gets much harder.

–>

Dasar Instalasi (sysinstall)

  1. Instalasi semua file distribusinya (”Semua source sistem, binari dan sistem X Window”).
  2. Instalasi koleksi port.
  3. Konfigurasi network.
  4. Tambahkan :
    • bash
    • cvsup
    • ispell
    • kde
    • mozilla-gtk
    • portupgrade
    • rsync
    • samba
    • screen
    • sudo
  5. Catatan: Jika anda ingin setiap user mempunyai group personal-nya (seperti yang ada pada Linux & Panther), buatlah group group baru pertama kali pada saat melakukan sysinstall. pastikan setiap langkah pembuatan account user, tiap user mempunyai group 0 (wheel) member– sebab dengan cara su akan mengalami kurang cocok.

Setup Dasar dan Account

  1. Serial console dibuat enable dengan mengetikan : echo "-hD" > /boot.config tekan enter.
  2. Bila anda tidak melakukan itu pada terminal serial didalam sysinstall, lakukan sekarang dengan cara mengetikan : echo 'ttyd0 "/usr/libexec/getty std.9600" dialup on secure' >> /etc/ttys lalu tekan enter.
  3. Ketikan: visudo # uncomment full access for %wheel lalu tekan enter.
  4. Ketikan: cd /root && ftp http://www.reppep.com/~pepper/freebsd/install/reppep.tgz && tar xzf reppep.tgz && ls -lt reppep kemudian anda tekan tombol enter, ambilah file file tambahan yang disarankan berikut patch-nya, dan bukalah pada untuk direktori /root/reppep — bila anda punya patch local, buka jugalah file file itu untuk patch lokal anda.
  5. Jika anda punya pacth lokal, bukalah file file itu dengan cara mengetikan. tar xzf local.tgz && ls -lt reppep tekan enter.
  6. Ketikan: patch /etc/ssh/sshd_config /root/reppep/sshd_config.diff tekan enter.
  7. Instalasilah file kernel anda dan tetapkan konfigurasinya dalam direktori /usr/src/sys/i386/conf.
  8. Ketikan: cd /etc && cp /root/reppep/make.conf . && cat /root/reppep/rc.conf* >> rc.conf && vi resolv.conf rc.conf make.conf && egrep -v ‘(^$|^#)’ rc.conf | sort | more # tuliskan semua konfigurasi jaringan komputer anda pada file rc.conf.local; pastikan tidak ada variabel yang anda tuliskan dua kali didalam file rc.conf.
  9. Ketikan: mkdir -p /home/ports/distfiles && cd /usr/ports && rmdir distfiles && ln -s /home/ports/distfiles # preserves ports across rebuilds
  10. Ketikan: mkdir -p /usr/sup && cp /root/reppep/cvsupfile /root/reppep/periodic.conf /root/reppep/ntp.conf /etc && cp /root/reppep/refuse /usr/sup && vi /etc/cvsupfile /etc/ntp.conf /usr/sup/refuse
  11. Ketikan: mkdir -p ~root/bin ~root/log
  12. Ketikan: cd /root/reppep && cp build-world-kernel.sh cvsup.sh /root/bin && chmod u+x /root/bin/*.sh && rehash
  13. Ketikan: patch /usr/local/etc/pkgtools.conf /root/reppep/pkgtools.conf.diff

Mengubah Source, Kernel dan World (dengan tipe terbaru, lakukan secara periodik)

Catatan: Rekomendasi dari FreeBSD ada di http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, walau agak susah tetapi secara teori cukup aman. Jika anda masih kurang jelas dg apa yang anda lakukan disini ataupun dengan mengikuti langkah dari situs tadi, bacalah prosedur yang tertulis didalam Handbook FreeBSD.

Peringatan: Langkah ini muda merusak sistem anda, atau mengunci anda sendiri, ketika melakukan perubahan kernel atau world. pastikan anda memiliki akses console (PS/2-style atau serial) sebelum melakukan perubahan.

  1. cvsup.sh # mengubah dasar FreeBSD yaitu source (kernel & world), dan pohon port; tidak akan berpengaruh terhadap port yang telah terinstall
  2. cd /usr/src && mergemaster -p # mergemaster akan membutuhkan banyak waktu, sehinga akan lebih b aik melakukannya sebelum sistem down.
  3. build-world-kernel.sh
  4. make installkernel
  5. shutdown -r now
  6. Pembuatan kernel baru.
  7. shutdown now # single-user
  8. cd /usr/src && make installworld
  9. mergemaster
  10. shutdown -r now
  11. Editlah tiap file konfigurasi tambahan ang ada dalam direktori /etc or /usr/local/etc.
  12. Ujilah sambungan komputer anda ke jaringan dan firewal-nya (mungkin memakai perintah ipfw list).

Catatan: Jika anda memakai bagian ini sebagai panduan dalam pengubahan sistem yang sedang beroperasi, dan bukan sistem yang baru anda buat, jangan lupa lakukan perintah portupgrade -ai pada saat kernel & world yang baru anda buat sudah selesai dikerjakan..

Mengkonfigurasi BIND

  1. cd /etc/namedb && sh make-localhost && mv named.root named.root.old && dig @m.root-servers.net. ns . > named.root && vi named.conf && grep named /etc/rc.conf # konfigurasikan domain promer dan domain slave & instalasilah file file zona; bisa dilihat dengan menyetel opsi named_enable="YES"
  2. Catatan: Konfigurasi BIND disini dioperasikan sebagai root tanpa partisi pengamanan khusus. Situs http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-dns.html memberikan instruksi untuk menjalankan BIND dalam sebuah kondisi chroot, dan BIND mungkin juga dioperasikan dalam kondisi jail. Kedua opsi tersebut cukup melindungi BIND dari serangan, dan bisa anda pertimbangkan, tetapi tidak akan dijelaskan dalam uraian ini.

Instalasi Port

  1. cd /usr/ports/lang/perl5.8 && make install && rehash && use.perl port && perl --version
  2. portupgrade -a && portversion |grep -v = # mencoba mengubah apa saja.
  3. portinstall analog cronolog curl docproj-nojadetex htmldoc lsof lynx-ssl minicom netatalk nmap nut procmail webmin apache2 squirrelmail p5-Mail-SpamAssassin drac imap-uw postfix && rehash # customized or perl-based
  4. cd /usr/local/etc && cp smb.conf.default smb.conf && vi smb.conf # disini pasword enkripsi diset enable, lalu melakukan disable terhadap local master, dan disable printer; Disini juga dituliskan pembatasan akses dari IP seperti yang dituliskan dalam firewall yang ada dalam file smb.conf, sehingga semua program terkontrol melalui file yang sama.
  5. echo "- -noddp -passwdminlen 6 -loginmaxfail 6 -uamlist uams_dhx.so" >> /usr/local/etc/afpd.conf
  6. cd /usr/local/etc/rc.d && patch netatalk.sh /root/reppep/netatalk.sh.diff # disable atalk, pap, & nbp
  7. mkdir -p /var/log/samba && cd /usr/local/etc/rc.d && cp netatalk.sh.sample netatalk.sh && cp samba.sh.sample samba.sh
  8. Konfigurasikan XFree86 (disini tidak akan dijelaskan lebih rinci) lihatlah situs http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html.
  9. Sekali XFree86 bekerja, pasti anda ingin menginstalasi KDE secara otomatis pada saat boot, coba lakukan perintah berikut : echo 'ttyv9 "/usr/local/bin/kdm" xterm on secure' >> /etc/ttys, or use KDE with startx: echo exec startkde > ~/.xinitrc

Mengkonfigurasi Mail

  1. cd /etc/mail && mv mailer.conf mailer.conf.sendmail && cp /root/reppep/mailer.conf .
  2. cd /usr/local/etc && cp /root/reppep/procmailrc . && vi procmailrc
  3. patch /etc/inetd.conf /root/reppep/inetd.conf.diff && patch /etc/pam.conf /root/reppep/pam.conf.diff # for imap-uw
  4. vi /usr/local/etc/mail/spamassassin/local.cf # customize SpamAssassin
  5. echo localhost > /usr/local/etc/dracd.host && /usr/local/etc/rc.d/dracd.sh start
  6. vi /etc/aliases && newaliases # forward for $myself & root
  7. Jika memakai Postfix Virtual Host, editlah dengan cara ketikan: vi /etc/mail/virtual && postmap /etc/mail/virtual
  8. cd /usr/local/etc/postfix && cat /root/reppep/main.cf.* >> main.cf && vi + /usr/local/etc/postfix/main.cf && postfix stop ; killall sendmail ; postfix check && postfix start && sleep 1 && tail /var/log/maillog
  9. cd /usr/ports/mail/imap-uw && make cert && chmod -x /usr/local/certs/imapd.pem # follow prompts
  10. Bila diinginkan port terpasang lakukan: portinstall -f mysql-server # -f to get around the hold in pkgtools.conf

Mengkonfigurasi Apache & SquirrelMail

  1. mkdir -p /var/log/httpd /home/httpd && mv /usr/local/www/data /home/httpd/htdocs && mv /usr/local/www/cgi-bin /home/httpd && cd /usr/local/etc/apache2 && patch httpd.conf /root/reppep/httpd.conf.diff && touch vhost.conf
  2. Either apply a local patch (patch httpd.conf /root/reppep/httpd.conf.diff.local), or vi httpd.conf (set ServerAdmin & ServerName dan lihatlah securitynya)
  3. apachectl configtest && apachectl graceful
  4. mkdir -p ssl.crt ssl.key && cp /usr/local/certs/imapd.pem ssl.key/server.key && cp /usr/local/certs/imapd.pem ssl.crt/server.crt && vi ssl.???/* vhost.conf && apachectl stop && apachectl configtest && apachectl startssl && apachectl fullstatus # remove cert from server.key & key from server.crt
  5. cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini
  6. cd /usr/local/www/squirrelmail && ./configure
  7. Test https://$hostname/mail/.
  8. Menguji Squirell Mail (dg cara mengunencryp IMAP ke localhost) & telnet $hostname imap akan gagal, jika diblok oleh firewall.
  9. Tambahkan plugin tambahan yang anda inginkan untuk SquirrelMail .

webmin

  1. cd /usr/local/lib/webmin/ && ./setup.sh
  2. Visit https://$hostname:10000/
  3. Konfogurasi Webmin: IP Access Control: aturlah “Only allow from listed addresses” to 127.0.0.1 & trusted IPs.
  4. User Webmin: Buanglah semua modul yang tidak diperlukan.
  5. Bila mysql-server terinstalasi didalam server anda, Konfigurasi webmin dilakukan dibawah: Servers.
  6. /usr/local/etc/rc.d/webmin.sh-dist stop # pakailah argumen start nanti, untuk mengoperasikan webmin bila diperlukan.

Cara Konfigurasi Firewall di FreeBSD Memakai IPFW

1. Konfigurasi Kernel

Ada beberapa opsi konfigurasi yang harus ditambahkan pada kernel agar ipfw dapat digunakan, Opsi yang akan di tambahkan pada file kernel antara lain :

options IPFIREWALL #firewall
options IPFIREWALL_VERBOSE #informasi firewallnya
options IPFILTER #dukungan untuk ipfilter
options IPFILTER_LOG #log ipfilter

#options IPFIREWALL_DEFAULT_TO_ACCEPT

Jika anda menginginkan default firewall menjadi terbuka, tambahkan saja opsi tersebut.

2. Kompilasi kernel

# cd /usr/src/sys/i386/conf; config CONFIG_KERNEL_
# cd ../../compile/CONFIG_KERNEL
# make depend; make

3. Instalasi Kernel

Jika proses diatas selesai tanpa ‘error’ maka perintah terakhir

#make install
#init 6

4. Menggunakan ipfw untuk membuat ACL (access control list)
Secara dasar aturan untuk ipfw sebagai berikut :

ipfw action number [allow|deny] [all|tcp|udp|ip] darimana kemana via apa

Ubah user menjadi root, contoh nya :

#su

Membolehkan localhost untuk berkomunikasi dengan dirinya sendiri :

/sbin/ipfw add 100 pass all from any to any via lo0
/sbin/ipfw add 200 deny all from any to 127.0.0.0/8

Membolehkan localhost untuk berkomunikasi ke siapa saja melalui ethernet

/sbin/ipfw add 300 allow all from IP_ANDA to any

Membolehkan koneksi normal yang sudah terhubung dengan baik

/sbin/ipfw add 350 allow tcp from any to any established

Jika anda menjalankan webserver dan mailserver, anda memerlukan port 80 dan 25 agar dapat

di akses oleh host yang lain.

/sbin/ipfw add 400 allow tcp from any to any 80
/sbin/ipfw add 500 allow tcp from any to any 25

Membolehkan data tipe udp untuk dikirimkan dari nameserver sebagai fungsi DNS :

/sbin/ipfw add 600 allow udp from DNS_SERVER 53 to IP_ANDA

Membolehkan seluruh ICMP kecuali ping :

/sbin/ipfw add 700 deny icmp from any to YOUR_IP_HERE icmptypes 8
/sbin/ipfw add 800 allow icmp from any to any

Jika anda ingin host berjalan dengan tipe firewall terbuka, tambahkan di file /etc/rc.conf

firewall_enable=”YES”
firewall_type=”OPEN”



Cara NgeBlock SSH brute force di FreeBSD

I hate ssh bruteforce !!! here i explain to you how to block bruteforce in your ssh port.
#cd /usr/ports/security/sshguard
#make fetch extract
#cd work/sshguard-1.0/src
# ee sshguard.c

change line 153-157 :
###
if (fw_fin() != FWALL_OK) sshguard_log(LOG_ERR, “Cound not
finalize firewall.”);

sshguard_log_fin();

return 0;
###

to

#####
exit(0);
######


now lets install it.
#make install clean
# ee /etc/syslog.conf
find this line
#auth.info;authpriv.info |exec /usr/local/sbin/sshguard

uncomment that line.Then restart syslogd
#/etc/rc.d/syslogd restart


Perintah Dasar FreeBSD

Bagi yang masih pemula, pasti bingung untuk mejalankan FreeBSD pada waktu setelah di innstall. Disini saya akan memberikan perintah dasar FreeBSD sebagai dasar untuk mengoperasikan FreeBSD.

Setelah anda menginstall FreeBSD dan menjalankan FreeBSD, yang akan muncul adalah permintaan login dari mesin. Login yang biasa pertama kali dipakai itu adalah login dengan user : root. Dan passwordnya adalah sesuai dengan yang anda masukkan pada waktu penginstallan. Jika anda mempunyai user/account yang baru anda buat maka anda dapat masuk ke mesin itu lewat account tersebut.

Setelah itu anda dapat mengoperasikan mesin FreeBSD anda dengan perintah-perintah berikut:

  • ‘cd’ = change directory (pindah ke directory …)
  • ‘ls’ = list (me-list semua directory dan file yang ada disuatu directory)
  • ‘rm’ = remove (menghapus suatu file)
  • ‘mkdir’ = make directory (membuat directory/folder)
  • ‘clear’ = menghapus semua layar dari perintah-perintah yang pernah kita buat
  • ‘ps’ = processing status (melihat proses yang sedang bekerja di mesin)
  • ‘kill’ = menghentikan suatu proses
  • ‘cp’ = copy (untuk mengcopy suatu file)
  • ‘whoami’ = untuk mengetahui sebagai apa kita menjalan mesin tersebut
  • ‘pwd’ = untuk mengetahui kalo kita sedang berada di directory …
  • ‘tar’ = untuk mengekstrak file compress (file nya harus bertipe .tar.gz)
  • ‘compress’ = untuk mengkompress suatu file atau directory
  • ‘whereis’ = untuk mengetahui terletak di directory mana suatu file itu berada
  • ‘mv’ = memindahkan suatu file ke directory lain atau merubah nama suatu file
  • ‘passwd’ = untuk merubah password account yang sedang dipakai
  • ‘ee’ = easy editor (suatu program editor text seperti notepad jika di Windows)

  • Lainnya :

    Selain perintah yang bersifat built-in bagi shell, UNIX menyediakan banyak utilitas yang sangat bermanfaat bagi pemakai. Pada bagian ini, beberapa perintah UNIX (built-in maupun utilitas) akan diperkenalkan. Beberapa di antaranya hanya berupa suatu ringkasan.
    Tabel Perintah lingkungan sistem
    Perintah Keterangan
    Exit Keluar dari shell pada Bourne shell dan Korn shell.
    Id Menampilkan nama pemakai beserta nomor identitas dari pemakai serta nama group dan nomor identitas group.
    logname Menampilkan nama pemakai.
    Logout Keluar dari shell pada C shell.
    Man Menampilkan dokumentasi online dari suatu perintah UNIX.
    newgrp Mengubah group efektif.
    passwd Memberikan password atau mengubah password
    Set Menampilkan variabel lingkungan pada shell pemakai.
    Tty Menampilkan nama identitas (port) terminal.
    Uname Menampilkan nama simpul dari sistem UNIX
    Who Menampilkan pemakai yang sedang menggunakan sistem.

    Tabel Perintah manajemen file
    Perintah Keterangan
    Cat Menampilkan isi file.
    Cp Menyalin satu atau beberapa file.
    Find Mencari file-file tertentu pada suatu direktori.
    Ls Menampilkan informasi dari file.
    More Menampilkan isi suatu file teks per layar.
    Mv Memindahkan suatu file ke direktori lain atau mengubah nama file.
    Pg Menampilkan isi suatu file teks per layar.
    Rm Menghapus file.

    Tabel Perintah manajemen direktori
    Perintah Keterangan
    Cd Mengaktifkan suatu direktori sebagai direktori kerja.
    Copy Menyalin seluruh struktur direktori (termasuk file dan subdirektori).
    Mkdir Membuat direktori baru.
    Pwd Menampilkan nama direktori kerja.
    Rmdir Menghapus direktori.
    Mv Mengubah nama direktori.

    Tabel Perintah untuk mengatur akses file
    Perintah Keterangan
    Chgrp Mengubah group dari suatu file atau direktori.
    Chmod Mengubah permisi dari suatu file atau direktori.
    Chown Mengubah pemilik dari suatu file atau direktori.

    Tabel Perintah yang berhubungan dengan proses
    Perintah Keterangan
    Kill Menghentikan suatu proses berdasarkan identitas proses.
    Ps Menampilkan proses-proses yang sedang berjalan.
    Sleep Menunda eksekusi (Proses yang tidak mengerjakan apa-apa selama beberapa detik).

    Tabel Perintah yang berhubungan dengan layar
    Perintah Keterangan
    Banner Menampilkan tulisan berukuran besar
    Clear Menghapus layar
    Echo Menampilkan tulisan ke layar

    Tabel Perintah lain-lain
    Perintah Keterangan
    Bc Utilitas untuk mengatur perhitungan.
    Cal Menampilkan kalender.
    Date Menampilkan tanggal dan jam sistem.
    Grep Mencari file-file yang mengandung kat tertentu.
    Lp Mencetak file ke printer.
    Mail Utilitas untuk menyampaikan pesan tertulis ke pemakai lain.
    Sort Mengurutkan kata.
    Vi Editor teks.
    Wc Menghitung jumlah karakter, kata dan baris suatu file.

    Semoga Bermanfaat !!!!!!!!!!!!!!!!!

    Membuat Mail Server "Sederhana" di Linux

    File yang dibutuhkan antara lain :

    * Arch Linux
    * Postfix 2.1.5
    Secure, fast, easy to administer drop in replacement for Sendmail.
    (MTA) Provides smtp-server.
    (Requires sasl installed and support for sasl compiled into Postfix if
    sending mail through an intermediary as you may need to do if you have
    a domain name pointing to a dynamic IP address.)
    * Cyrus SASL 2.1.21
    SASL authentication daemon.
    * Procmail 3.22
    Highly configurable auto mail processing.
    * Fetchmail 6.25
    A remote-mail retrieval utility.
    * SpamBayes 1.1a1
    a Bayesian anti-spam filter, initially based on the work of Paul Graham.
    The major difference between this and other, similar projects is the
    emphasis on testing newer approaches to scoring messages.
    * Mutt 1.4.2.1
    A small but very powerful text-based mail client
    * Courier-imap 4.0.4
    IMAP / POP3 Server
    * Courier-authlib 0.57
    Authentication library for the courier mailserver.
    * SquirrelMail cvs 1.5.1
    For checking mail via the web.
    (requires imap-server, perl, and php)
    * Pop-before-smtp 1.38
    A simple daemon written in Perl, to allow email relay control based on
    successful POP or IMAP logins.



    Installing Postfix

    A note for those with dynamic IP addresses: Before installing Postfix we must first consider if it will need to make use of Simple Authentication and Security Layer (SASL). If you have a dynamic IP address and are using a service like dyndns.org you will need to have Postfix send your mail through your ISP's mail server (with authentication) making use of SASL for the connection. This is because many domains that you will send email to will recognize your hostname as pointing to a dynamic IP address and send the mail back. Check if your distributions Postfix package was built with SASL support or if you are compiling Postfix from scratch add SASL with a ./configure option.

    If you've determined you do not need SASL support in postfix:
    $ pacman -Sy postfix

    If you do need SASL support we need to install cyrus-sasl and use the Arch Build System (abs) utility for building Postfix. Follow the instructions bellow or follow these Arch Wiki instructions: http://wiki.archlinux.org/index.php/PostFix_Howto_With_SASL
    $ pacman -Sy cyrus-sasl
    $ abs
    $ cd /var/abs
    $ mkdir -p local/postfix
    $ cp -v extra/daemons/postfix/* local/postfix

    Now edit /var/abs/local/postfix/PKGBUILD. Under the build() section change:
    make OPT="${CFLAGS}" || return 1

    to:

    make OPT="${CFLAGS}" \
    CCARGS="-DUSE_SASL_AUTH -I/usr/include/sasl/" \
    AUXLIBS="-L/usr/lib/sasl2 -lsasl2" || return 1

    Now run:
    $ makepkg
    $ pacman -A postfix-*.pkg.tar.gz

    I like to then copy the package into a directory under /var/lib/pacman so I have access to all of my abs built packages later:
    $ mkdir /var/lib/pacman/abs_built
    $ cp postfix-*.pkg.tar.gz /var/lib/pacman/abs_built
    Installing Fetchmail
    $ pacman -S fetchmail
    Installing Procmail
    $ pacman -S procmail
    Installing SpamBayes

    SpamBayes is not yet in the pacman repository. Download it, extract, and install (substitute version numbers with most current):

    $ wget http://dl.sourceforge.net/sourceforge\
    /spambayes/spambayes-1.1a1.tar.gz
    $ tar zxvf spambayes-1.1a1.tar.gz
    $ cd spambayes-1.1a1
    $ python setup.py install

    Installing Mutt
    $ pacman -S mutt
    Installing courier-imap and courier-authlib

    SquirrelMail as well as other mail clients (evolution, outlook, cell phone, etc.) will use this to connect to the mail box. Courier-imap also depends on courier-authlib, so this command will install that as well.
    $ pacman -S courier-imap
    Installing SquirrelMail
    $ pacman -S squirrelmail
    Installing pop-before-smtp

    You are going to want to consider using Postfix/TLS or pop-before-smtp if you are interested in users connected via IMAP being able to send mail (using your mail server as a SMTP relay). I recommend using Postfix/TLS but will not cover how to install/configure it in this document.

    Pop-before-smtp is not in pacman repositories. Substitute version numbers with the most current.
    $ wget http://dl.sourceforge.net/sourceforge/popbsmtp/pop-before-smtp-1.38.tar.gz
    $ tar zxvf pop-before-smtp-*.tar.gz
    $ cd pop-before-smtp-*

    Read the README in this directory and then read README.QUICKSTART in the contrib directory for where to copy the necessary files to.


    Postfix Configuration

    main.cf

    Now change to the '/etc/postfix' directory and open up main.cf for editing.

    The domain name for my machine is through dyndns.org. Set your myhostname and my domain to something like this:
    myhostname = example.com mydomain = example.com

    Next we are going to want to set Postfix up for using qmail-style delivery with Maildir (where each email is stored in its own file). This is for courier-imap which SquirrelMail will be using to access the mail and will have other advantages. Don't forget the ending forward slash.
    home_mailbox = Maildir/

    Set it up so that incoming mail is sent through procmail and so we can alias names/users to mailboxes.
    mailbox_command = /usr/bin/procmail -a "$DOMAIN"

    alias_maps = hash:/etc/postfix/aliases

    If you have a dynamic IP or have trouble with mail being returned from large ISP's or mail systems you are going to have to take a few extra steps. We will set it up so that mail will go through a relay host. In this example I will use my ISP's (SBC) smtp server as an example. Make these additional changes to main.cf
    relayhost = [smtp.sbcglobal.yahoo.com]

    # authentication for sbc yahoo
    smtp_sasl_auth_enable = yes
    smtp_sasl_security_options = noanonymous
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

    That wraps up our changes to main.cf. We just need to create the hash aliases databases that we defined above. Add these lines to the top of /etc/postfix/aliases (replacing hypexr with your user account of course):

    root: hypexr

    spam: hypexr
    ham: hypexr

    Generate the database. From /etc/postfix dir:

    $ postalias aliases

    Set up smtp server and authentication for SBC mail relay. sasl_passwd:

    smtp.sbc.mail.yahoo4.akadns.net my_username@sbcglobal.net:my_passw

    Note: Server name can change from time to time. There is a CNAME that points to this name but CNAMEs do not work here.

    Generate the database:

    $ ./postmap sasl_passwd

    Start the postfix server and we are done with postfix!!!!

    $ /etc/rc.d/postfix start

    Having problems getting it to start? Check out the Postfix log file usually in /var/log/mail or /var/log/maillog.

    Fetchmail Configuration

    We are going to run our fetchmail daemon from user root. So create the file /root/.fetchmailrc:

    set postmaster "postmaster"
    set bouncemail
    set no spambounce
    set properties ""
    set daemon 60
    poll pop.example.com with proto POP3
    user 'user_name' there with password 'my_password' is 'local_user_to_deliver_to' here options flush
    poll pop.gmail.com with proto POP3 port 995
    user 'my_gmail_un@gmail.com' there with ssl with password 'my_password' is 'hypexr' here options keep

    This tells fetchmail to check every minute for mail at pop.mypop.com and also at my gmail account. The flush option at the end of the mypop entry tells it to remove the mail after it is downloaded. I do not want the mail removed from my Gmail account so I use the keep option. Google also uses ssl, hence the "with ssl". Fetchmail comes with its configuration utility fetchmailconf which makes setting up your .fetchmailrc file easy.

    I don't believe that Arch Linux has a rc script for fetchmail. The one that I made (/etc/rc.d/fetchmail) looks like this (stat_busy, stat_fail, stat_done are specific to Arch Linux. You could take these out):

    #!/bin/sh

    . /etc/rc.conf
    . /etc/rc.d/functions

    DAEMON_NAME="fetchmail"
    DAEMON_CONF="/root/.fetchmailrc"
    DAEMON_PATH="/usr/bin/fetchmail"

    PID=`pidof -o %PPID ${DAEMON_NAME}`

    case "$1" in
    start)
    stat_busy "Starting ${DAEMON_NAME}"
    [ -z "$PID" ] && ${DAEMON_PATH} -f ${DAEMON_CONF} -d 60 &> /dev/null
    if [ $? -gt 0 ]; then
    stat_fail
    else
    add_daemon ${DAEMON_NAME}
    stat_done
    fi
    ;;
    stop)
    stat_busy "Stopping ${DAEMON_NAME}"
    [ ! -z "$PID" ] && kill "$PID" &> /dev/null
    if [ $? -gt 0 ]; then
    stat_fail
    else
    rm_daemon ${DAEMON_NAME}
    stat_done
    fi
    ;;
    restart)
    # calling 'stop' and 'start' without the $0 fails...
    $0 stop
    sleep 3
    $0 start
    ;;
    *)
    echo "usage: $0 {start|stop|restart}"
    esac
    exit 0

    And start the fetchmail daemon:

    $ /etc/rc.d/fetchmail start

    Or if you don't want to create/modify an rc script you can start the fetchmail daemon like:

    $ /usr/bin/fetchmail -d 60


    Spambayes and Procmail Configuration

    We are going to be using Spambayes to train and determine if mail is spam and Procmail to sort the mail into folders when they enter our mail system. These two go together as far as Procmail is going to use Spambayes to help sort the mail.

    I had used SpamAssassin for a year and had not been very happy with its performance. I have only been using Spambayes for a few weeks and have been pleasantly surprised by how well it has worked and how quickly it adapts. In fairness I had been training SpamAssassin on all of my spam, the spam it had caught and the spam it had missed as well. It was also an older version and I was not using all of the features. With that being said if you are curious give it a try. Many other excellent programs exist. A quick search on Google will turn them up.

    When Spambayes is installed it is going to move several files that start with sb_ into your /usr/bin directory. We are going to be interested in sb_mboxtrain.py and sb_filter.py. The former trains the spam filter and the later classifies incoming spam. There are two methods I tried for the initial training:

    1. Since I already had thousand of spam and ham (non spam) messages saved up I first tried initially training on this older mail. The results were okay but it was miss sorting mail. These problems would have sorted them selves out with the continued training of the misclassified mail but it would have also took a little while because the database had already been trained so much.
    2. The second method I used was extremely effective. I started out with no training on initial messages. I simply let Spambayes work with no information. I then sent the spam and ham messages that ended up in the wrong mailbox to a designated folder. I then run the Spambayes training program on these miss classified messages.

    The results from the second method have been amazing. Without even having to manually classify very many messages Spambayes has been performing at superior levels. Check out Spambayes Wiki for many other training methods. I will discuss easy methods of sorting miss classifications in the Mutt and Squirrel Mail sections.

    Spam System Initial Setup

    We are going to want Maildir folders to hold our regular mail, mail classified as spam, mail classified as unsure, missed spam, and missed ham.

    If the standard Maildir directory (~/Maildir) doesn't already exist lets create it with the necessary sub directories to make it a mail box. Run these commands from your user account who will be receiving the mail.
    $ mkdir ~/Maildir
    $ mkdir ~/Maildir/{new,cur,tmp}

    And now the other 4 directories that we are going to use for dealing with spam (Making the directories hidden is going to be done for integration with Squirrelmail):
    $ mkdir ~/Maildir/{.MissedSpam,.MissedHam,.CaughtSpam,.Unsure}
    $ mkdir ~/Maildir/.MissedSpam/{new,cur,tmp}
    $ mkdir ~/Maildir/.MissedHam/{new,cur,tmp}
    $ mkdir ~/Maildir/.CaughtSpam/{new,cur,tmp}
    $ mkdir ~/Maildir/.Unsure/{new,cur,tmp}

    The messages that we are going to be training as spam are going to be in ~/Maildir/.MissedSpam and ham will be in ~/Maildir/.MissedHam. Lets create the script and cron job that will take care of training the Spambayes db. Create a file ~/Maildir/train_spambayes and add this:

    #!/bin/sh
    # Script to copy mail missed spam and ham into correct folders
    # and run sb_mboxtrain.py to train spambayes
    # Training will be done only on missed spam and ham

    # Files we saved or bounced may be in the new directory
    # We want them in cur for training
    mv /home/hypexr/Maildir/.MissedSpam/new/* \
    /home/hypexr/Maildir/.MissedSpam/cur 2>/dev/null
    mv /home/hypexr/Maildir/.MissedHam/new/* \
    /home/hypexr/Maildir/.MissedHam/cur 2>/dev/null
    /usr/bin/sb_mboxtrain.py -d /home/hypexr/.hammie.db \
    -g /home/hypexr/Maildir/.MissedHam \
    -s /home/hypexr/Maildir/.MissedSpam

    Make the script executable:
    $ chmod +x ~/Maildir/train_spambayes

    Set up our database that will be consulted for new email and trained on new spam/ham:
    $ /usr/bin/sb_filter.py -d $HOME/.hammie.db -n

    You will want cron installed so that it can launch the script above, which trains Spambayes, every night at 3:21 am. Edit your cron jobs with the command crontab -e and add:
    21 3 * * * ~/Maildir/train_spambayes
    Procmail Configuration for Spambayes

    These are basic procmail recipes that will sort the spam from ham. From Spambayes on Unix or Linux. Add these lines to your mail recipient's ~/.procmailrc:

    SHELL=/bin/sh
    MAILDIR=$HOME/Maildir
    DEFAULT=$HOME/Maildir/
    CAUGHT_SPAM=$MAILDIR/CaughtSpam/
    UNSURE=$MAILDIR/Unsure/

    #Spambayes process
    :0fw:hamlock
    | /usr/bin/sb_filter.py -d /home/hypexr/.hammie.db

    :0
    * ^X-Spambayes-Classification: spam
    ${CAUGHT_SPAM}

    :0
    * ^X-Spambayes-Classification: unsure
    ${UNSURE}

    # Catches everything else.
    # Anything left over goes into the DEFAULT folder
    :0:
    ${DEFAULT}

    So incoming mail is not filtered through procmail's rules where Spambayes's sb_filter decides whether it is spam or ham. The mail is now sitting in the correct directories and ready to be accessed by whatever reader/front-end you would like. Next I going to describe setting up Mutt and SquirrelMail for viewing your mail. Mutt will be the most powerful option combining speed and sleekness but SquirrelMail will be able to match functionality.


    Mutt Configuration

    First we need to set the MAIL variable so that Mutt will know where to look for your mail. In your ~/.bashrc (create if does not exist) add the line:

    MAIL='~/Maildir'

    Exit out of your shell and log back in so that the variable will be set or run export MAIL='~/Maildir'. On some systems mutt will not use $MAIL to determine the location of your mail box. When trying to start mutt if it reports a message that no mail directory exists you can try setting the MAILDIR variable or just create the directory that it wants to use and make it a valid Maildir: mkdir -p ~/.maildir/{cur,new,tmp} where .maildir is the folder that mutt wants to use. If you use a directory other than ~/Maildir remember to substitute that wherever I reference Maildir in this document.

    Now for the fun part. Lets make everything look pretty and integrated in Mutt. If you start up Mutt right now you will see any mail that your system has received since you have completed the steps above. If no mail shows up in Mutt and there should be mail you need to first check if Spambayes has filtered it into your .Unsure or .CaughtSpam directories. Type 'c' to change directories and enter ~/Maildir/Unsure and check out the mail thats been classified as spam: 'c' ~/Maildir/CaughtSpam. If you still have not found the mail that you are expecting to have received make sure that you have configured Postfix, Fetchmail, and Procmail correctly. Also, try sending mail directly to your_user_accunt@example.com and see if it shows up in one of the directories above.

    Now mail is flowing into your system and we can check how Spambayes has classified it by checking the different mail folders. The miss classified mail just needs to be moved into the correct folders for the training.
    To manually move the misclassified spam mail:

    1. From you Maildir inbox tag each message that has arrived that is spam. Do this by pressing 't' and an asterisk will appear by the messages. After all of the messages have been tagged, press '; m' and enter ~/Maildir/MissedSpam and the spam messages in your inbox will be moved to the MissedSpam mailbox for training by spambayes.
    2. When looking at the mail that it has classified as spam in '~/Maildir/CaughtSpam', tag all of the messages it considered spam that were ham and press '; C' and enter ~/Maildir/MissedHam. Now tag them again and press '; m' and enter ~/Maildir to move them into your inbox, where they should have been placed in the first place.

    Of course all of this manual stuff is a huge pain so lets automate all of it in .muttrc.

    .muttrc Configuration

    This .muttrc file is going to save you a quazillion.. thats right a quiazalliona hours in productivity in dealing with our current setup. Here it is:

    # Emacs is my editor of choice. I have mostly read that people like
    # using emacs-client here and using an emacs server so that the
    # editing opens up in an existing emacs session but I prefer
    # loading up a fresh instance. The default editor is some 'vi'
    set editor="emacs"

    # Setting these macros is going to save us all of that time I was
    # talking about. Now instead of having to type all of those
    # characters to move the mail around we will can just tag the messages
    # and, for the instance of spam in your inbox, hit 'S'.

    # Move mail to correct directories
    macro index S ";s~/Maildir/.MissedSpam\r\r$\r"
    macro pager S ";s~/Maildir/.MissedSpam\r\r$\r"
    macro index H ";C~/Maildir/.MissedHam\r\r;s~/Maildir\r\r$\r"
    macro pager H ";C~/Maildir/.MissedHam\r\r;s~/Maildir\r\r$\r"
    macro index M ";s~/Maildir/\r"
    macro pager M ";s~/Maildir/\r"

    # This one lets me quickly move job search related emails to the
    # correct directory. Want to give me a job? :)
    macro index B ";s~/Maildir/.Job\r\r$\r"
    macro pager B ";s~/Maildir/.Job\r\r$\r

    # This is how we are going to move around to the different
    # mailboxes. Hitting 'alt-1' will take us to our inbox
    # 'alt-2' and we are looking at the mail Spambayes classified
    # as spam. etc.
    # The extra mailboxes I have in here are for mailing lists I am on.
    # I will show the procmail recipe that automatically puts
    # the mailing list mail into its correct mailbox further down.

    # Move to mailboxes quickly
    macro index 1 "c~/Maildir\r"
    macro pager 1 "c~/Maildir\r"
    macro index 2 "c~/Maildir/.CaughtSpam\r"
    macro pager 2 "c~/Maildir/.CaughtSpam\r"
    macro index 3 "c~/Maildir/.Unsure\r"
    macro pager 3 "c~/Maildir/.Unsure\r"
    macro index 4 "c~/Maildir/.Tur\r"
    macro pager 4 "c~/Maildir/.Tur\r"
    macro index 5 "c~/Maildir/.Sbayes\r"
    macro pager 5 "c~/Maildir/.Sbayes\r"
    macro index 6 "c~/Maildir/.Wikka\r"
    macro pager 6 "c~/Maildir/.Wikka\r"
    # Training Maildirs for Spam and Ham
    macro index 8 "c~/Maildir/.MissedSpam\r"
    macro pager 8 "c~/Maildir/.MissedSpam\r"
    macro index 9 "c~/Maildir/.MissedHam\r"
    macro pager 9 "c~/Maildir/.MissedHam\r"
    # Job E-mails
    macro index 0 "c~/Maildir/.Job\r"
    macro pager 0 "c~/Maildir/.Job\r"

    # Setting these colors makes it easy to tell which emails
    # Spambayes has missed.
    # Turn spam red and unsure green
    color index red default "~h '^X-Spambayes-Classification: spam'"
    color index green default "~h '^X-Spambayes-Classification: unsure'"
    # Turn gmail mail brightblue
    # (My regular expression is not correct here. I think that it
    # is looking anywhere in the header for my gmail address
    # instead of what I wanted.. Just in the 'To:'.
    # It still works for the most part)
    color index brightblue default "~h '(^)*my_name@gmail.com'

    # Lets set more colors to make things look beautiful. Judging by
    # my title for this section I must have had bad feelings towards
    # colors when I added this.
    #Color crap
    color index brightwhite default ~N # color for new messages
    color status black yellow
    color attachment brightyellow default # file attachments
    color search brightred default # search matches
    color quoted brightyellow default # quoted text in replies
    color quoted1 magenta default # quoted text in replies
    color body cyan default "((ftp|http|https)://|news:)[^ >)\"\t]+" # URLs
    color body cyan default "[-a-z_0-9.+]+@[-a-z_0-9.]+" # email

    # The rest of this stuff is pretty important for functionality and
    # readability.

    # Don't ask to move read message
    set move=no

    # My signature is in this file
    set signature="~/.signature"

    # Change mail to look like from scott@hypexr.org
    # Stick your email address here.
    my_hdr From: Scott Rippee

    # Header control h displays header when in pager
    # I want to only see the unignored by default
    ignore * # weed out all headers
    unignored date from: to cc subject organization # now show me these...

    # Thanks to many people whom have written the documents and posts that I
    # have gotten these settings from.

    New Mutt Commands

    Here are the most useful (as far as dealing with spam) commands that we can now use in mutt:

    t Tag messages to be manipulated
    S Send message/s to spam training folder
    H Send message/s to ham training folder and to inbox
    alt-1 Change mailbox to Maildir/ (inbox)
    alt-2 Change mailbox to .CaughtSpam
    alt-3 Change mailbox to .Unsure
    alt-8 Change mailbox to .MissedSpam
    alt-9 Change mailbox to .MissedHam

    So for example, if a couple of spam messages show up in your inbox you can now tag them and hit 'S' (remember its uppercase s) and have them vanished into .MissedSpam for training.


    SquirrelMail Configuration

    To configure SquirrelMail go into your html_base_directory/squirrelmail/config and run ./conf.pl. Edit the options to fit your needs. If you want to test your config cruise over to http://localhost/squirrelmail/src/configtest.php.

    Now go to http://localhost/squirrelmail/ and login using your user account. If you have any email in your in box you should see it after you log in. Now click on the Folders option that is along the top, select all of the mailbox folders that we created earlier (they are listed here because we prefixed them with a period), and click on subscribe. Hit refresh and the mailboxes should be listed in the side panel. Now you can use SquirrelMail for almost all of you mail needs including tagging messages and moving them to the correct folders for Spambayes training and checking on the mail that Spambayes has classified as spam and unsure. The only functionality from our mutt setup that can't be duplicated in SquirrelMail is copying missed ham into its training folder and then moving it into your inbox. This is due to the lack of copying ability. So you will have to go into the ham training folder to see some of the mail that should be in your inbox.

    !!! IMPORTANT SECURITY NOTE!!! - Using SquirrelMail like this is not secure! Sending the plain text passwords that you use for your Unix account can be accessed by by a 3rd party, which would them access to your account. You should set up a secure server with SSL and have Courier-imap use passwords that differ from the users system password using Courier Authlib, which I will demonstrate in the next session. Excellent documents exist all over the net for setting up your web server with ssl.

    Courier Authentication

    Now is a good time to address a bit of essential security. As of now when a user connects via the SquirrelMail or IMAP interface the passwords are being sent in plain text and if these are sniffed that users system account is compromised. Without adding secure connections we can minimize the threat by using alternate passwords for imap connections. The snoop would then have access to your mail, but not be able to log in to the system.

    Edit your authdaemonrc file. If your on Arch Linux this will be in /etc/authlib. Under authmodulelist I commented out:

    authmodulelist="authpam authpwd authuserdb authshadow ..."

    And replaced it with:

    authmodulelist="authuserdb"

    I believe that adding authuserdb to the front of the list may work, but I am only using this method of authentication so it is all I need in my list.

    Lets create the user account entry:

    $ userdb "some_user_name" set home=/home/user_dir \
    mail=/home/user_dir/Maildir \
    uid=users_userid gid=users_groupid

    $ userdbpw | userdb "some_user_name" set systempw

    You will now be prompted for this pseudo users new password. Next make sure that /etc/authlib/userdb has read/write/execute access for the owner. If not chmod 700 /usr/authlib/userdb. Now create the user database that courier is going to look to for authentication:

    $ makeuserdb

    Again look to using Postfix/TLS for a tunneling the connection through a secure connection.

    Pop-before-smtp Configuration

    To successfully configure pop-before-smtp follow the straight forward instructions in contrib/README.QUICKINSTALL. When you are done and everything is working it is important to make sure that you have not some how made your mail server an open relay! This would cause your mail server to be flooded with traffic and be put on the open relay ban lists.

    !!! IMPORTANT SECURITY NOTE!!! - I will not use the pop-before-smtp method because it involves sending a password over an insecure connection. Use Postfix through a SSL connection, Postfix/TLS, to accomplish this. Since your local machines are likely already allowed to use your Postfix as a mail relay the only time that you would be using this method is from a non-trusted server where you password can be sniffed. If you still choose to use this method make sure that you have changed the users courier password as described in Courier Authentication.

    Additional Simple Procmail Recipes and Mailbox Config

    If you are a member of any news letters/mailing lists you can have them automatically sorted to their own mailbox using Procmail. First create the new mail directory in your ~/Maildir directory. Lets call it .Sbayes and pretend that we are on the Spambayes mailing list. So exactly as before with the spam related mailboxes:

    mkdir -p ~/Maildir/.Sbayes/{cur,new,tmp}

    Now add this new rule to your ~/.procmailrc:

    # spambayes-dev@python.org mailing list
    :0
    * ^X-BeenThere: spambayes@python.org
    ${MAILDIR}/.Sbayes/

    In the .mutrc example above it shows an example of setting alt-5 as the macro to see your Spambayes emails.

    A slightly different method can be used to send spam and ham for training. Adding the following lines will allow you to bounce spam messages to spam@localhost (localhost or your mail_domain.com) and ham messages to ham@localhost:

    # Mail has been bounced to spam@localhost
    :0
    * ^Resent-To:.*spam
    ${MAILDIR}/.MissedSpam

    # Mail has been bounced to ham@localhost
    :0
    * ^Resent-To:.*ham
    ${MAILDIR}/.MissedHam

    If you want to bounce messages to the spam and ham addresses like this, you will need to make sure that the headers stay intact. Do not try using this or a similar technique for forwarding mails to an address because the email's headers would not be intact and this is a large part of the spam classification. This method works because above we specified spam and ham as aliases for hypexr in the Postfix aliases file.

    Conclusion

    For Arch Linux users, Add saslauthd authdaemond courier-imap postfix fetchmail to DAEMONS in your /etc/rc.conf file and they will be started automatically when your machine boots. If you are running a web server have the httpd service listed after the services we are adding.

    /etc/rc.conf

    DAEMONS=(... saslauthd authdaemond postfix courier-imap fetchmail ...)

    Enjoy your new mail system and centralized mailbox. If you are handling a large number of users for you email system this is just the tip of the iceberg and you are going to mostly be interested in virtual users, security, and a system wide spam classifier. There are many good documents on various setups to accomplish this, see the links section. If you have any suggestions, questions, comments, or corrections send me an email or drop a note in the forum. If this document has been of any use to you, cheers. :)

    Setup Linux menjadi Mail Server

    Yang harus diperlukan dan diinstall pada sistem linux anda, untuk menginstall paket pada distro yang lain silakan merujuk pada distro yang anda pakai :

    1. MTA (mail transer Agent )

    Mail transfer agent program yang digunakan untuk menerima dan mengirim email dari server anda,, yang digunakan disini adalah Postfix

    #apt-get install postfix
    2. Mail Filtering

    Digunakan untuk memfilter email yang masuk ke Server Mail anda untuk mendeteksi Spam & Virus, namun pada pembahasan kali ini tidak dibahas .. untuk topik advance pembahasan ini akan dibahas :D .
    3. Mail Delivery Agent

    Agar us bisa mendownload email dari lokasi yang lain kita membutuhkan server IMAP or POP3 disini banyak sekali pilihannya namun pada tutorial ini akan digunakan Dovecot.

    #apt-get install dovecot-common dovecot-imapd dovecot-pop3d

    Beberapa pilihan untuk IMAP & POP3 :
    1. Dovecot
    2. Courier
    3. Cyrus
    4. Webmail Server

    Agar Mail Server anda dapat diakses melalui lingkungan Web base anda memerlukan Webmail server berikut pilihannya:

    #apt-get install squirrelmail
    1. Squirrelmail
    2. OpenWebmail

    Yang digunakam pada tutorial ini adalah Squirrelmail
    5.

    WebServer (Lamp = Linux , apache , mysql, php)

    Untuk menjalankan Webmail Server anda membutuhkan Lamp sudah terinstalasi dengan baik ,, pada tutorial ini tidak dibahas bagaimana menkonfigurasi Lamp cobaah merujuk ke manual2 yang lain.

    Setelah anda berhasil menginstall paket2 yang disebutkan diatas step selanjutnya adalah megkonfigurasi Mail Server anda ….

    *

    Konfigurasi Dovecot
    o

    Menentukan Prorokol IMAP & POP3

    Edit konfigurasi pada /etc/dovecot/dovecot.conf

    tambahkan konfigurasi berikut: protocols = pop3 pop3s imap imaps
    o

    Memilih Mailboxes

    Agar mail disimpan pada home direktory maka kita edit konfigurasi /etc/dovecot/dovecot.conf

    rubahlah :

    #mail_location = maildir:~/Maildir menjadi mail_location = maildir:~/Maildir (pagarnya dihilangkan)
    o

    Testing2 dovecot

    root@w3hol:/home/rachmat# telnet localhost pop3

    Trying 127.0.0.1…

    Connected to localhost.

    Escape character is ‘^]’.

    +OK Dovecot ready.
    *

    Konfigurasi Alias squeirrelmail pada apache :

    karena saya menggunakan apache2 maka edit file konfigurasi /etc/apache/apache2.conf

    jika anda menggunakan distro fedora file konfigurasi ada pada /etc/apche/httpd.conf

    tambahkan script berikut pada bagian alias :

    Alias /webmail “/usr/share/squirrelmail/”

    Options Indexes MultiViews

    AllowOverride None

    Order allow,deny

    Allow from all

    jika anda menggunakan distro fedora anda tidak perlu mengkonfigurasi konfigurasi ini karena anda bisa langsung mengaksesnya dari http://localhost/webmail
    *

    okey sekarang kita selesai konfigurasi

    mari kita restart semua service yang dibutuhkan

    #/etc/init.d/apache2 restart untu distro fedora #/etc/init.d/httpd restart

    # /etc/init.d/dovecot restart

    #/etc/init.d/postfix restart

    buka browser … untuk mengakses squirrelmail buka alamat http://localhost/webmail

    dan login menggunakan user dan pass sistem linux anda… anda bisa berkirim dan menerima email di jaringan anda…. menggunakan email client seperti thunderbird, evolution dan lain2. untuk bahasa selanjutnya kita akan membahas bagaimana kita bisa mendownload email2 dari internet dan mengirim email kita ke internet menggunakan email server yang telah kita buta.

    Installasi mailserver dengan postfix and courier menggunakan authentikasi mysql

    Tutorial ini menjelaskan Step by Step tentang cara membuat mailserver dg virtual domain (domain email tidak harus selalu sama dg domain komputer yang sesungguhnya) denganberbasiskan postfix dan courier dg memanfaatkan mysql sebagai penyimpan data username & password bagi tiap2 user. Berikut ini yang harus anda lakukan.

    ( INTERNET )—————-| DMZ |—————-( Local Area Networks )


    Step 1: Install paket-paket yang diperlukan
    Paket yang diperlukan dalam tutorial ini antara lain :
    Untuk Mengirim email (SMTP) : postfix (Pilih: “Local only”), postfix-tls, postfix-mysql, postfix-doc
    Untuk Database user : mysql-client-5.0, mysql-server-5.0
    Untuk menerima email (POP3 & IMAP) : courier-base (Pilih: “No”), courier-authdaemon, courier-authlib-mysql, courier-pop, courier-pop-ssl, courier-imap, courier-imap-ssl
    Untuk Keamanan Pengiriman dan Penerimaan email : libsasl2, libsasl2-modules, libsasl2-modules-sql, openssl
    Untuk Mencegah Virus dan Spam : amavisd-new, spamassassin, clamav, clamav-daemon, zoo, unzip, lha
    Untuk tampilan WebMail : squirrelmail, phpmyadmin
    Untuk testing tools : telnet

    root@bajoel:~#apt-get install postfix postfix-tls postfix-mysql postfix-doc mysql-client-5.0 mysql-server-5.0 courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2 libsasl2-modules libsasl2-modules-sql openssl amavisd-new spamassassin clamav clamav-daemon zoo unzip lha squirrelmail phpmyadmin telnet

    Step 2: Membuat user, database, dan tabel yang diperlukan pada mysql
    Tambahkan database dan tabel-tabel baru pada mysql anda sebagai berikut
    root@bajoel:~#mysql -u root -p
    password:
    mysql>CREATE DATABASE mail;
    mysql>CREATE USER ‘mailadmin’@'localhost’ identified by ‘passwordanda’;
    mysql>USE mail;
    mysql>CREATE TABLE domains (
    domain varchar(50) NOT NULL,
    PRIMARY KEY (domain) )
    TYPE=MyISAM;
    mysql>CREATE TABLE forwardings (
    source varchar(80) NOT NULL,
    destination TEXT NOT NULL,
    PRIMARY KEY (source) )
    TYPE=MyISAM;
    mysql>CREATE TABLE users (
    email varchar(80) NOT NULL,
    password varchar(20) NOT NULL,
    PRIMARY KEY (email) )
    TYPE=MyISAM;
    mysql>GRANT all ON mail.* TO ‘mailadmin’@'localhost’;

    Step 3: Membuat file2 baru sebagai penunjuk ke database mysql
    Buat file baru dg nama mysql-virtual_domains.cf
    root@bajoel:~#touch /etc/postfix/mysql-virtual_domains.cf
    isi file mysql-virtual_domains.cf dg baris-baris dibawah ini:
    root@bajoel:~#mcedit /etc/postfix/mysql-virtual_domains.cf
    user = mailadmin
    password = passwordanda
    dbname = mail
    table = domains
    select_field = ‘virtual’
    where_field = domain
    hosts = 127.0.0.1

    Buat file baru dg nama mysql-virtual_forwardings.cf yg berisi :
    root@bajoel:~#touch /etc/postfix/mysql-virtual_forwardings.cf
    isi file mysql-virtual_forwardings.cf dg baris-baris dibawah ini:
    root@bajoel:~#mcedit /etc/postfix/mysql-virtual_forwardings.cf
    user = mailadmin
    password = passwordanda
    dbname = mail
    table = forwardings
    select_field = destination
    where_field = source
    hosts = 127.0.0.1

    Buat file baru dg nama user mysql-virtual_mailboxes.cf yg berisi :
    root@bajoel:~#touch /etc/postfix/mysql-virtual_mailboxes.cf
    isi file mysql-virtual_mailboxes.cf dg baris-baris dibawah ini:
    root@bajoel:~#mcedit /etc/postfix/mysql-virtual_mailboxes.cf
    user = mailadmin
    password = passwordanda
    dbname = mail
    table = users
    select_field = CONCAT(SUBSTRING_INDEX(email,’@',-1),’/',SUBSTRING_INDEX(email,’@',1),’/')
    where_field = email
    hosts = 127.0.0.1

    Buat file baru mysql-virtual_email2email.cf yang berisi :
    root@bajoel:~#touch /etc/postfix/mysql-virtual_email2email.cf
    isi file mysql-virtual_email2email.cf dg baris-baris dibawah ini:
    root@bajoel:~#mcedit /etc/postfix/mysql-virtual_email2email.cf
    user = mailadmin
    password = passwordanda
    dbname = mail
    table = users
    select_field = email
    where_field = email
    hosts = 127.0.0.1

    [Penting] Demi keamanan, pastikan hanya user root & postfix saja yang bisa mengakses file-file yang telah anda buat.
    root@bajoel:~#chown root:postfix /etc/postfix/mysql-virtual_*.cf
    root@bajoel:~#chmod u=rw,g=r,o= /etc/postfix/mysql-virtual_*.cf

    Step 4: Membuat user baru pada system kita sebagai administrator-email
    User ini bertugas untuk membuat maildir baru setiap ada user baru yang mendaftar pada mailserver anda
    root@bajoel:~#groupadd -g 5000 mail-admin
    root@bajoel:~#useradd -g mail-admin -u 5000 mail-admin -d /home/mail -m
    root@bajoel:~#mkdir /home/mail
    root@bajoel:~#chown -R mail-admin:mail-admin /home/mail
    root@bajoel:~#chmod -R u=rwx,g=,o= /home/mail

    Step 5: Mengkonfigurasi postfix sbg server SMTP
    File main.cf ini adalah file konfigurasi utama dari postfix
    root@bajoel:~#mcedit /etc/postfix/main.cf
    Editlah file tsb, sehingga menjadi seperti dibawah ini:
    inet_interfaces = all
    myhostname = mail.domain-anda.org (fqdn)
    mydestination = (jangan menuliskan virtual domain disini -> lebih baik dikosongi saja)
    mynetworks = lqman.org (nama domain anda)
    virtual_alias_domains =
    virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_forwardings.cf mysql:/etc/postfix/mysql-virtual_email2email.cf
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
    virtual_mailbox_base = /home/mail
    virtual_uid_maps = static:5000
    virtual_gid_maps = static:5000
    smtpd_sasl_auth_enable = yes
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
    smtpd_use_tls = yes
    smtpd_tls_cert_file = /etc/postfix/smtpd.cert
    smtpd_tls_key_file = /etc/postfix/smtpd.key

    Testing…
    Restart service postfix, dan cobalah untuk mengakses port 25 dengan telnet
    root@bajoel:~#/etc/init.d/postfix restart
    root@bajoel:~#postfix check
    Jika tidak muncul suatu pesan kesalahan, berarti anda sukses…….
    root@bajoel:~#telnet localhost 25
    Trying 127.0.0.1…
    Connected to localhost.localdomain.
    Escape character is ‘^]’.
    220 mail.lqman.org ESMTP Postfix (Debian/GNU)

    Jika muncul sebagaimana tulisan diatas, berarti postfix anda sudah berjalan lancar…….
    Tekanlah tombol Ctrl+] lalu ketik quit untuk keluar dari sesi telnet,
    Ambilah napas dalam-dalam, dan lanjutkan perjuangan ;)

    Step 6: Mengaktifkan fasilitas authentikasi pada postfix (Auth-SMTP)
    Tell Postfix to use SASL/MySQL, dg cara buat file baru dg nama /etc/postfix/sasl/smtpd.conf
    root@bajoel:~#touch /etc/postfix/sasl/smtpd.conf
    Isi file /etc/postfix/sasl/smtpd.conf dg baris-baris dibawah ini:
    root@bajoel:~#mcedit /etc/postfix/sasl/smtpd.conf
    pwcheck_method: auxprop
    auxprop_plugin: sql
    mech_list: plain login cram-md5 digest-md5
    sql_engine: mysql
    sql_hostnames: 127.0.0.1
    sql_user: mailadmin
    sql_passwd: passwordanda
    sql_database: mail
    sql_select: select password from users where email=’%u@%r’
    log_level: 7

    [Penting] Demi keamanan, pastikan hanya user root & postfix saja yang bisa mengakses file-file yang telah anda buat.
    root@bajoel:~#chown root:postfix /etc/postfix/sasl/smtpd.conf
    root@bajoel:~#chmod u=rw,g=r,o= /etc/postfix/sasl/smtpd.conf

    Mengaktifkan TLS untuk meng-encrypt SMTP traffik, dg cara membuat sertifikat (certificate)
    root@bajoel:~#openssl req -new -outform PEM -out /etc/postfix/smtpd.cert -newkey rsa:2048 -nodes -keyout /etc/postfix/smtpd.key -keyform PEM -days 365 -x509

    [Penting] Demi keamanan, pastikan hanya user root & postfix saja yang bisa mengakses file-file yang telah anda buat.
    root@bajoel:~#chown root:postfix /etc/postfix/smtpd.*
    root@bajoel:~#chmod u=rw,g=r,o= /etc/postfix/smtpd.*

    Step 7: Mengkonfigurasi courier sebagai server POP3 / IMAP
    Edit file /etc/courier/authdaemonrc,
    root@bajoel:~#mcedit /etc/courier/authdaemonrc
    ubah parameter authmodulelist menjadi :
    authmodulelist=”authmysql”
    Lalu edit file /etc/courier/authmysqlrc,
    root@bajoel:~#mcedit /etc/courier/authmysqlrc
    Ubah beberapa parameter, shg menjadi seperti di bawah ini :
    MYSQL_SERVER localhost
    MYSQL_USERNAME mailadmin
    MYSQL_PASSWORD passwordanda
    MYSQL_PORT 0
    MYSQL_DATABASE mail
    MYSQL_USER_TABLE users
    #MYSQL_CRYPT_PWFIELD (jadikan baris ini sebagai komentar)
    MYSQL_CLEAR_PWFIELD password
    MYSQL_UID_FIELD 5000
    MYSQL_GID_FIELD 5000
    MYSQL_LOGIN_FIELD email
    MYSQL_HOME_FIELD “/home/mail”
    MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,’@',-1),’/',SUBSTRING_INDEX(email,’@',1),’/')
    #MYSQL_NAME_FIELD (jadikan baris ini sebagai komentar)

    [Penting] Mengedit file authmysqlrc agak sedikit susah, pastikan anda berhati-hati dan tidak membuat kesalahan (jangan memakai tanda SPASI, tetapi gunakan tombol TAB)

    Testing…
    Restart service courier-authdaemon, dan cobalah untuk mengakses port 110 dengan telnet
    root@bajoel:~#/etc/init.d/courier-authdaemon restart
    Jika tidak muncul suatu pesan kesalahan, berarti anda sukses…….
    root@bajoel:~#telnet localhost 110
    Trying 127.0.0.1…
    Connected to localhost.
    Escape character is ‘^]’.
    +OK Hello there.

    Router sebagai Gateway Internet di Debian

    1. .:: Set IP Address eth0 dan eth1.

    Pengsian berdasarkan asumsi sebagai berikut;
    eth0 terhubung ke jaringan lokal / client internet
    eth1 terhubung ke Modem ADSL atau WiFi dengan ip 10.1.1.1
    Set eth0 dengan ip 192.168.0.254 dan eth1 10.1.1.2

    # vi /etc/network/interfaces

    auto eth0
    iface eth0 inet static
    address 192.168.0.254
    netmask 255.255.255.0
    broadcast 192.168.1.255

    auto eth1
    iface eth1 inet static
    address 10.1.1.2
    netmask 255.255.255.0
    broadcast 10.1.1.255
    gateway 10.1.1.1

    2. ..::Install Bind 9 sebagai DNS server.

    # apt-get install bind9

    setelah selesai terinstall lakukan setting:

    # vi /etc/bind/named.conf

    masukkan perintah ;

    // add entries for other zone below here

    zone "domain yang diinginkan" IN {
    type master;
    file "db.domain";
    };

    zone "0.168.192.in-addr.arpa" IN {
    type master;
    file "db.ip";
    };

    *lalu buat file db.domain dan db.ip , letak posisi file di /var/cache/bind/

    .::db.domain

    ; chuprex.net
    $TTL 604800
    @ IN SOA ns1.chuprex.net. root.chuprex.net. (
    2006020201 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800); Negative Cache TTL
    ;
    @ IN NS ns1
    IN MX 10 mail
    IN A 192.168.0.254
    ns1 IN A 192.168.0.254
    mail IN A 192.168.0.2 ; We have our mail server somewhere else.
    www IN A 192.168.0.254
    client1 IN A 192.168.0.1 ; We connect to client1 very often.

    .:: db.ip

    ; chuprex.net
    $TTL 604800
    @ IN SOA ns1.chuprex.net. root.chuprex.net. (
    2006020201 ; Serial
    604800 ; Refresh
    86400 ; Retry
    2419200 ; Expire
    604800); Negative Cache TTL
    ;
    @ IN NS ns1
    IN MX 10 mail
    ns1 IN PTR 192.168.0.254
    254 IN PTR ns1
    254 IN PTR ns1.chuprex.net

    ** Setting file resolv.conf , posisi di /etc/resolv.conf

    nameserver 192.168.0.254
    domain chuprex.net
    domain www.chuprex.net

    **setelah itu restart bind

    /etc/init.d/bind9 restart

    2. ..:: Sekarang saatnya edit Routing Setting :

    **Edit file ipv4_forward untuk memForwardkan ip dari 2 eth.

    #vi /etc/network/options

    ip_forward = yes
    spoofprotect = yes
    syncookies = no

    **Masukkan rule iptables untuk share internet dari eth1 ke eth0.

    #iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

    untuk mempermanenkan rule iptables, jangan lupa menyimpannya.

    #iptables-save

    Sekian aja ya, setting router sederhana sudah selesai. Ooops, ternyata ada yg tertinggal.

    **:: Restart setting network anda.

    #/etc/init.d/networking restart

     

    About Me

    My photo
    Presiden Director of : Monopoly Cell Groups, Monopoly Games and Internet Lounge, Monopoly Computer : Hardware, Maintenance and Supply Computer Product, Internet Networking Company, All in Depok City ,--------------------------, Send me Email : Radarmerauke@telkom.net

    My Blog Stat :