Facebook Badge

Showing posts with label IT. Show all posts
Showing posts with label IT. Show all posts

Tuesday, February 10, 2009

VLAN

I’m going to show how to segment logical network using VLAN.

Say, there are two department in the office.

VLAN 2 is for IT department and VLAN 3 is for sales department.

There are 2 switches, and placed at two places, switch 1 and 2 connected on fast ethernet port 0/24 which configured for trunk port. So here is the switch configuration:

switch1>enable
switch1#configure terminal
switch1(config)#int fa0/24
switch1(config-if)#switchport mode trunk
switch1(config-if)#switchport trunk allowed vlan 2-3
switch(config-if)#switchport native vlan 40
switch1(config-if)#exit
switch1(config)#vlan 2
switch1(config)#name IT-department
switch1(config)#vlan 3
switch1(config)#name Sales-department
switch1(config)#int fa0/1
switch1(config-if)#switchport mode access
switch1(config-if)#switchport access vlan 2
switch1(config-if)#int fa0/2
switch1(config-if)#switchport mode access
switch1(config-if)#switchport access vlan 3
switch1(config-if)#^Z
switch1(config)#copy running-config startup-config

if you want to access the switch using telnet you have to configure it like this:

switch1#configure terminal
switch1(config)#int vlan1
switch1(config-if)#ip address 192.168.100.253 255.255.255.0
switch1(config-if)#no shut
switch1(config-if)#line vty 0 4
switch1(config-line)#password yourpassword
switch1(config-line)#login
switch1(config-line)#exit
switch1(config)#service password-encryption
switch1(config)#enable secret yourpassword
switch1(config)#exit
switch1#copy running-config startup-config

for switch 2, follow the configuration above. Both switches, trunk port must use vlan 40 in order to communicate.

Friday, October 24, 2008

Instalasi Mail Server dengan Qmail

1. Dokumen ini akan menjelaskan instalasi berikut:
  • 1. qmail sebagai MTA,
  • 2. checkpassword sebagai module authentikasi pada pop3 server,
  • 3. vpopmail sebagai module authentikasi pada pop3 server,
  • 4. ezmlm yang digunakan untuk aplikasi mailing-list,
  • 5. sqwebmail, yaitu interface webmail seperti hotmail,
  • 6. autorespond, seperti answering machine pada sistem telepon,
  • 7. qmailadmin, yaitu interface web untuk melakukan administrasi email server yang meliputi, edit user, virtualdomain, forwarding, mailing list dan autorespond.

2. Instalasi Qmail
Persyaratan yang harus dipenuhi untuk menginstal Qmail adalah:
  1. - Sebuah mesin dengan sistem operasi Unix compatible. Qmail tidak mendukung sistem operasi M$ Windows NT atau Windows 2000. Penulis melakukan instalasi qmail pada mesin Linux Redhat 6.2.
  2. - Sangat direkomendasikan Anda memiliki sebuah DNS server sebagai tempat registarsi Mail Exchanger (MX). Jika Anda tidak memilikinya, dapat dilakukan registrasi gratis pada http://www.dyndns.org.
  3. - Sangat dianjurkan Anda terhubung ke internet secara leased-line. Qmail dirancang untuk konektivitas jaringan yang baik, jadi jangan Anda gunakan qmail pada 28,8 kbps dial-up. Untuk koneksi yang agak buruk qmail menyediakan serialmail.

2.1. Langkah instalasi dan konfigurasi Qmail
Sebelum Anda menginstall qmail, sebaiknya dicatat terlebih dahulu pada direktori apa saja file-file qmail ditempatkan. Hal ini dilakukan karena qmail yang akan diinstal adalah dalam format tar.gz. Tidak seperti paket aplikasi yang datang dalam bentuk rpm, paket dalam format tar.gz tidak mendokumentasikan letak file-file yang akan diinstal. Pencatatan dapat dilakukan dengan cara berikut:
- catat semua file yang terinstall pada mesin Anda sebelum menginstal qmail:
# find /* before-qmail
- catat semua file yang terinstall pada mesin Anda setelah menginstal qmail:
# find /* after-qmail
- lihat file-file hasil instalasi qmail:
# diff before-qmail after-qmail qmail-files.
Urutan langkah instalasi dan konfigurasi qmail adalah:
1. Dapatkan paket qmail terkini, pada saat tulisan ini dibuat versi terakhir adalah qmail-1.03.tar.gz. Paket ini dapat diambil pada ftp://koobera.math.uic.edu/www/software/qmail-1.03.tar.gz.
2. Dapatkan juga paket pendukung lainnya yaitu:
- ucspi-tcp, yang menyediakan tcpserver sebagai daemon pengganti inetd pada ftp://koobera.math.uic.edu/www/software/ucspi-tcp-0.88.tar.gz
- daemontools, yang berisi sekumpulan layanan monitoring dan controlling pada ftp://koobera.math.uic.edu/www/software/daemontools-0.61.tar.gz
- qmail-103.patch, untuk mengkoreksi proses reply DNS yang ilegal seperti AOL Provider yang tidak menghiraukan RFC.Paket ini dapat diperoleh pada http://www.ckdhr.com/ckd/qmail-103.patch
3. Copy paket-paket tersebut pada direktori /usr/local/src
4. Unpack paket-paket tersebut:
# cd /usr/local/src
# tar -zxvf qmail-1.03.tar.gz
# tar -zxvf ucspi-tcp-0.88.tar.gz
# tar -zxvf daemontools-0.61.tar.gz
5. Lakukan patch DNS menggunakan file qmail-103.patch:
# patch -p1 /var/run/svscan.pid
echo "."
;;
stop)
echo -n "Stopping qmail: svscan"
kill `cat /var/run/svscan.pid`
echo -n " qmail"
svc -dx /var/qmail/supervise/*
echo -n " logging" svc -dx /var/qmail/supervise/*/log
echo "."
;;
stat)
cd /var/qmail/supervise
svstat * */log
;;
doqueuealrm)
echo "Sending ALRM signal to qmail-send."
svc -a /var/qmail/supervise/qmail-send
;;
queue)
qmail-qstat
qmail-qread
;;
reloadhup)
echo "Sending HUP signal to qmail-send."
svc -h /var/qmail/supervise/qmail-send
;;
pause)
echo "Pausing qmail-send"
svc -p /var/qmail/supervise/qmail-send
echo "Pausing qmail-smtpd"
svc -p /var/qmail/supervise/qmail-smtpd
;;
cont)
echo "Continuing qmail-send"
svc -c /var/qmail/supervise/qmail-send
echo "Continuing qmail-smtpd"
svc -c /var/qmail/supervise/qmail-smtpd
;;
restart)
echo "Restarting qmail:"
echo "* Stopping qmail-smtpd."
svc -d /var/qmail/supervise/qmail-smtpd
echo "* Sending qmail-send SIGTERM and restarting."
svc -t /var/qmail/supervise/qmail-send
echo "* Restarting qmail-smtpd."
svc -u /var/qmail/supervise/qmail-smtpd
;;
cdb)
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp &1
Catatan:
Jika usaha koneksi ke port 25 gagal atau system remote tidak bisa mengirim email kepada Anda, maka coba naikkan softlimit menjadi 3000000 atau 4000000
6. Buat file /var/qmail/supervise/qmail-smtpd/log/run dengan isi:
#!/bin/sh exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog t /var/log/qmail/smtpd 7. Jadikan ke empat file run tersebut excutable:
# chmod 755 /var/qmail/supervise/qmail-send/run
# chmod 755 /var/qmail/supervise/qmail-send/log/run
# chmod 755 /var/qmail/supervise/qmail-smtpd/run
# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
8. Setup direktori log:
# mkdir -p /var/log/qmail/smtpd
# chown qmaill /var/log/qmail /var/log/qmail/smtpd
9. Buat qmail startup script executable dan link file tersebut ke direktori di dalam path Anda:
# chmod 755 /etc/init.d/qmail
# ln -s /etc/rc.d/init.d/qmail /usr/local/sbin
10. Izinkan localhost untuk menginject mail lewat SMTP:
# echo '127.:allow,RELAYCLIENT=""' /etc/tcp.smtp
Jika Anda menginginkan relay untuk local network Anda, maka tambahkan:
# echo '192.168.1.:allow,RELAYCLIENT=""' /etc/tcp.smtp
# /usr/local/sbin/qmail cdb
11. Hentikan dan hapus MTA Sendmail yang telah terinstal sebelumnya:
# /etc/rc.d/init.d/sendmail stop
# kill PID-of-Sendmail
# rpm -e --nodeps sendmail
Replace semua /usr/lib/sendmail dengan qmail
# mv /usr/lib/sendmail /usr/lib/sendmail.old
# ignore errors
# mv /usr/sbin/sendmail /usr/sbin/sendmail.old
# ignore errors
# chmod 0 /usr/lib/sendmail.old /usr/sbin/sendmail.old
# ignore errors
# ln -s /var/qmail/bin/sendmail /usr/lib
# ln -s /var/qmail/bin/sendmail /usr/sbin
12. Buat system alias:
# echo miral /var/qmail/alias/.qmail-root
# echo miral /var/qmail/alias/.qmail-postmaster
# ln -s .qmail-postmaster /var/qmail/alias/.qmail-mailer-daemon
# chmod 644 /var/qmail/alias/.qmail-root /var/qmail/alias/.qmail-postmaster
13. Jika user yang menjadi anggota qmail adalah user yang terdaftar di /etc/passwd, maka buat Maildir pada setiap direktori home user yang bersangkutan:
# /var/qmail/bin/maildirmake ~miral/Maildir
# echo ./Maildir/ ~miral/.qmail
# cd ~miral
# chown -R miral:miral /Maildir
# chown miral:miral .qmail
14. Jika semua user baru yang akan terdaftar pada /etc/passwd juga akan menjadi anggota qmail, maka buat direktori Maildir pada direktori /etc/skel
# /var/qmail/bin/maildirmake /etc/skel/Maildir
# echo ./Maildir/ /etc/skel/.qmail
14. Instalasi selesai, jalankan qmail yang baru saja Anda install
# /etc/rc.d/init.d/qmail start
Masukkan command ini pada file /etc/rc.d/rc.local, jika Anda menginginkan qmail berjalan secara otomatis pada saat komputer Anda boot.
15. Test hasil instalasi dengan mengikuti langkah yang dijelaskan pada
file /var/qmail/doc/TEST.deliver dan /var/qmail/doc/TEST.receive
3. Instalasi Pop3 Server
Qmail menyertakan sebuah POP3 Server yaitu module qmail-pop3d.
Tetapi module yang merupakan daemon ini tidak terinstal dan terkonfigurasi pada proses intalasi qmail pada bagian 2 di atas. qmail-pop3d mensupport berbagai macam authentikasi melalui beberapa module atuhentikasi. Sebuah qmail-pop3d server memiliki tiga buah module, yaitu:
1. qmaip-popup, untuk mengambil nama user dan password
2. checkpassword, untuk authentikasi nama user dan password. Module ini terlepas dari paket qmail.
3. qmail-pop3d, yaitu berupa POP daemon Cara kerja qmail pop3 server: qmail-popup dijalankan melalui inetd atau tcpserver, menerima koneksi pada port 110, yaitu port Pop3.
Jika terjadi koneksi pada port tersebut, maka qmail-popup menanyakan nama user dan password. Kemudian module checkpassword (atau module authentikasi alternatif lainnya) melakukan verifikasi namauser/password dan akhirnya daemon qmail-pop3d akan aktif jika verifikasi berhasil.
3.1. Instalasi checkpassword
Checkpassword melakukan authentikasi terhadap user yang terdapat pada file /etc/passwd. Jadi user pada pop3 juga merupakan user yang terdaftar pada system Unix Anda.
1. Dapatkan paket checkpassword terkini. Pada saat tulisan ini dibuat versi terakhir adalah checkpassword-0.81.tar.gz.
Paket ini dapat diambil pada http://pobox.com/~djb/checkpwd.html.
2. Copy paket tersebut pada direktori /usr/local/src
3. Unpack:
# tar -zxvf checkpassword-0.81.tar.gz
4. Kompilasi:
# make
# make setup check Hasil instalasi adalah /bin/checkpassword
5. Jalankan pop3 server dengan 2 metode:
a). Dari inetd.conf. Tambahkan baris berikut pada file /etc/inetd.conf
# pop3 stream tcp nowait root /var/qmail/bin/qmail-popup
hostname.domain /bin/checkpassword /var/qmail/bin/qmail-pop3d Maildir
# kill -HUP PID-of-inetd, untuk merestart inetd.
b). Dari tcpserver. Buat file /etc/rc.d/init.d/pop-start dengan mode 755:
#!/bin/sh
env - PATH="/var/qmail/bin:/usr/local/bin"
tcpserver -v -R 0 pop3 /var/qmail/bin/qmail-popup hostname.domain
/bin/checkpassword
/var/qmail/bin/qmail-pop3d Maildir 2&1
/var/qmail/bin/splogger pop3d &
Apabila Anda menginginkan pop3 server berjalan secara otomatis pada saat komputer boot, masukkan baris /etc/rc.d/init.d/pop-start tersebut di atas pada file /etc/rc.d/rc.local.
6. Test hasil instalasi dengan melakukan telnet localhost pada port 110
# telnet localhost 110
3.2. Instalasi vpopmail
vpopmail adalah sekumpulan program yang mengotomatisasi proses pembuatan dan pemeliharaan user pop mail yang tidak berada pada file /etc/passwd.
vpopmail merupakan module authentikasi yang dapat menggantikan checkpassword.
vpopmail menggunakan sebuah user pada /etc/passwd untuk membuat banyak user virtual pop di bawah direktori ~vpopmail.
User yang menjadi anggota pop mail adalah virtual user yang berada di bawah direktori ~vpopmail tersebut, bukan user pada file /etc/passwd.
Vpopmail juga mampu membuat banyak virtualdomain pada email server Anda. Terdapat 2 paket tambahan pada vpopmail, yaitu:
1. qmailadmin, menyediakan interface web untuk melakukan administrasi dan pemeliharaan user pop, forwards, aliases, mailing list dan autorespond.
2. sqwebmail, merupakan system email berbasis web seperti hotmail yang membaca langsung dari Maildirs, local, NFS atau NAS dan autoresponders. vpopmail beserta 2 paket tambahannya dapat diambil pada http://www.inter7.com/qmail. Semua paket tersebut adalah GPL.
Langkah instalasi vpopmail adalah:
1. Dapatkan paket vpopmail terkini. Pada saat tulisan ini dibuat versi terakhir adalah vpopmail-4.9.tar.gz. Paket ini dapat diambil di http://www.inter7.com/vpopmail.
2. Copy paket tersebut pada direktori /usr/local/src
3. Unpack:
# tar -zxvf vpopmail-4.9.tar.gz
4. Lakukan pengecekan ruang HDD Anda, untuk menentukan lokasi vpopmail akan ditempatkan:
# df
5. Tambahkan user dan group di bawah ini pada system Unix Anda:
# groupadd vchkpw
# useradd -g vchkpw vpopmail
Jika Anda ingin menempatkan direktori vpopmail selain /home/vpopmail:
# useradd -g vchkpw -d /path/tempat/vpopmail/yang/diinginkan vpopmail
6. Buat file ~vpopmail/etc/tcp.smtp
# mkdir ~vpopmail/etc
# echo "127.0.0.:allow,RELAYCLIENT=""" ~vpopmail/etc/tcp.smtp
Jika Anda menginginkan local network dapat merelay smtp tambahkan baris berikut:
# echo "192.168.1.:allow,RELAYCLIENT=""" ~vpopmail/etc/tcp.smtp
7. Konfigurasi dan instalasi:
# ./configure Jika Anda ingin menginstall vpopmail dengan authentikasi melalui database yang disimpan pada mysql, maka lakukan command berikut:
# ./configure --enable-mysql=y
--enable-sqlincdir=/usr/local/mysql/include/mysql
--enable-sqllibdir=/usr/local/mysql/lib/mysql
--enable-hardquota=50000000
--enable-default-domain=your_virtual_domain_name (hanya jika Anda ingin menjadikan sebuah virtual domain sebagai domain primary/default.
Lihat penjelasan pada langkah 9b di bawah. Opsi ini tidak ada hubungannya dengan mysql).
Diasumsikan Anda telah menginstall mysql pada direktori
/usr/local/mysql. Sebelum melakukan konfigurasi, terlebih dahulu edit file vmysql.h.
Ubah nama host, user dan password yang telah diberi izin mengakses mysql. Biasannya adalah user root (bukan root dari system Unix).
# make
# make install-strip
Apabila Anda akan melakukan rekonfigurasi dan reinstalisasi lakukan langkah berikut:
# make clean
# rm -rf config.cache
# ./configure (dengan opsi-opsi yang Anda inginkan)
# make
# make install-strip
8. Buat file start-up pop3 pada /etc/rc.d/init.d/pop-start dengan mode 755:
#!/bin/sh
env - PATH="/var/qmail/bin:/usr/local/bin"
tcpserver -u509 -g509 -H -R 0 pop3
/var/qmail/bin/qmail-popup hostname.domain
/home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir &
Ganti u509 dan g509 dengan uid vpopmail dan gid vchkpw. Ubah juga hostname.domain dengan nama host dan domain Anda.
9. Buat pop user account dengan 2 metode berikut:
a). Tanpa virtual domain
# cd ~vpopmail/bin
# ./vadduser user1
# ./vadduser user2
# ...dst, sesuai dengan jumlah user yang akan didaftarkan.
User yang dibuat akan ditempatkan pada direktori ~vpopmail/users.
Perhatikan file /var/qmail/users/assign untuk melihat proses pengarahan mail yang datang pada user1, user2, dst tersebut.
Pada metode ini domain yang digunakan adalah dari file /var/qmail/control/locals.
Nama user untuk authentikasi user pop adalah namauser.
b). Dengan virtual domain
# cd ~vpopmail/bin
# ./vadddomain virtual.domain.com
# ./vadduser user1@virtual.domain.com
# ./vadduser user2@virtual.domain.com
# ...dst, sesuai jumlah user yang akan didaftarkan.
User ini akan ditempatkan pada direktori ~vpopmail/domains/virtual.domain.com.
Perhatikan file /var/qmail/users/assign untuk melihat proses pengarahan mail yang datang pada user1, user2, dst tersebut.
Pada metode ini nama user untuk authentikasi user pop adalah namauser%virtual_domain_name.
Anda dianjurkan menggunakan virtual domain, sekalipun Anda akan memanfaatkan satu domain saja. Apabila virtual domain tersebut ingin dijadikan primary domain sehingga metode authentikasi seperti tanpa virtual domain (domain local) yaitu cukup dengan memberikan namauser (tanpa menambahkan %virtual_domain_name), lakukan langkah berikut:
# rm -f ~vpopmail/users
# ln -s ~vpopmail/domains/virtual_domain_name ~vpopmail/users
Langkah tersebut di atas dapat dilakukan juga dengan menambahkan opsi
--enable-default-domain=your_virtual_domain_name
pada ./configure (langkah 7).
Kemudian lakukan pembuatan virtual domain yang akan dijadikan default dan pembuatan virtual user seperti pada langkah
9b. Anda tidak perlu lagi menghapus direktori ~vpopmail/users dan membuat softlink ke direktori ~vpopmail/domains/virtual_domain_name. Metode authentikasi pada pop server Anda cukup dengan memasukkan nama user saja tanpa diikuti dengan %virtual_domain_name.
10. Start pop3 server dengan menjalankan file /etc/rc.d/init.d/pop-start
# /etc/rc.d/init.d/pop-start
Apabila Anda menginginkan pop3 server berjalan secara otomatis pada saat komputer boot, masukkan command /etc/rc.d/init.d/pop-start
pada file /etc/rc.d/rc.local
11. Lakukan pengetesan dengan mengirim mail ke user-user yang telah dibuat tersebut, dan lihat hasilnya pada port 110 dengan telnet:
# telnet localhost 110
12. Catatan tambahan: untuk administrasi virtual domain dan virtual user
- Menghapus virtual domain
# ~vpopmail/bin/vdeldomain virtual_domain_name
- Megnhapus virtual user
# ~vpopmail/bin/vdeluser namauser@virtual_domain_name (untuk user pada virtual domain)
# ~vpopmail/bin/vdeluser namauser (untuk user tanpa virtual domain)
- Mengubah password virtual user
# ~vpopmail/bin/vpasswd namauser@virtual_domain_name (untuk user pada virtual domain)
# ~vpopmail/bin/vpasswd namauser (untuk user tanpa virtual domain)
4. Instalasi mailing-list manager
Mailing-list manager yang khusus diperuntukkan bagi qmail adalah ezmlm. Langkah instalasi secara cepat (quick install) dan konfigurasi ezmlm adalah:
1. Dapatkan paket ezmlm dan ezmlm-idx terkini. Pada saat tulisan ini dibuat versi terakhir adalah ezmlm-0.53.tar.gz dan ezmlm-idx-0.40.tar.gz. Kedua paket ini dapat diambil pada http://www.ezmlm.org
2. Copy kedua paket tersebut pada direktori /usr/local/src
3. Unpack:
# cd /usr/local/src
# tar -zxvf ezmlm-0.53.tar.gz
# tar -zxvf ezmlm-idx-0.40.tar.gz
4. Pindahkan semua direktori/usr/local/src/ezmlm-idx-0.40
ke direktori /usr/local/src/ezmlm-0.53
# mv -f /usr/local/src/ezmlm-idx-0.40/* /usr/local/src/ezmlm-0.53/
5. Lakukan patch
# cd /usr/local/src/ezmlm-0.53
# patch amount of time to consider a message (in seconds) num - maximum number of messages to allow within time seconds message - the filename of the message to send dir - the directoru to hold the log messages - Isi file .
qmail-help di atas menyatakan bahwa: This will allow up to five messages within about 3 hours.
- Buat sebuah file help_message pada
/var/qmail/alias (domain local) atau pada
~vpopmail/domains/your_virtual_domain (untuk virtual domain),
dengan isi sebagai berikut:
From: Support Subject: Help Response This is a response to your help request. Below is a copy of the message we received. --------
- Buat sebuah direktori help_autorespond pada pada
/var/qmail/alias (domain local) atau pada
~vpopmail/domains/your_virtual_domain (untuk virtual domain).
Direktori ini digunakan untuk mencatat log dari pesan yang dikirimkan.
- Jangan lupa ubah owhnership semua file dan direktori yang Anda buat (alias untuk direktori ~alias dan
vpopmail:vchkpw untuk direktori virtual domain).
5. Instalasi qmailadmin
Qmailadmin adalah paket/aplikasi yang sangat berguna bagi mail administrator. Aplikasi ini merupakan sebuah interface web untuk melakukan administrasi terhadap virtual domain, user dalam virtual domain, email forwarding, autorespond, dan mailing list. Untuk menginstal qmailadmin, Anda terlebih dahulu telah menginstal vpopmail, ezmlm dan autorespond. Langkah instalasi yang akan dijelaskan di bawah mengasumsikan bahwa vpopmail yang telah Anda instal menggunakan opsi enable mysql=y. Langkah instalasi dan konfigurasi adalah:
1. Dapatkan paket qmailadmin terkini. Pada saat tulisan ini dibuat versi terakhir adalah qmailadmin-0.35.tar.gz
2. Copy paket tersebut pada direktori /usr/local/src
3. Unpack:
# cd /usr/local/src
# tar -zxvf qmailadmin-0.35.tar.gz
4. Kompilasi dan instalasi
# cd /usr/local/src/qmailadmin-0.35
# make clean
# env LIBS="-L/usr/local/mysql/lib/mysql -lmysqlclient" ./configure
# make
# make install
5. Jalankan web browser Anda dan buka http://localhost/cgi-bin/qmailadmin

Friday, September 28, 2007

Penghitungan Subneting

Setelah anda membaca artikel Konsep Subnetting dan memahami konsep Subnetting dengan baik. Kali ini saatnya anda mempelajari teknik penghitungan subnetting. Penghitungan subnetting bisa dilakukan dengan dua cara, cara binary yang relatif lambat dan cara khusus yang lebih cepat. Pada hakekatnya semua pertanyaan tentang subnetting akan berkisar di empat masalah: Jumlah Subnet, Jumlah Host per Subnet, Blok Subnet, dan Alamat Host- Broadcast.
Penulisan IP address umumnya adalah dengan 192.168.1.2. Namun adakalanya ditulis dengan 192.168.1.2/24, apa ini artinya? Artinya bahwa IP address 192.168.1.2 dengan subnet mask 255.255.255.0. Lho kok bisa seperti itu? Ya, /24 diambil dari penghitungan bahwa 24 bit subnet mask diselubung dengan binari 1. Atau dengan kata lain, subnet masknya adalah: 11111111.11111111.11111111.00000000 (255.255.255.0). Konsep ini yang disebut dengan CIDR (Classless Inter-Domain Routing) yang diperkenalkan pertama kali tahun 1992 oleh IEFT.
Pertanyaan berikutnya adalah Subnet Mask berapa saja yang bisa digunakan untuk melakukan subnetting? Ini terjawab dengan tabel di bawah:
Subnet Mask Nilai CIDR
255.128.0.0 /9
255.192.0.0 /10
255.224.0.0 /11
255.240.0.0 /12
255.248.0.0 /13
255.252.0.0 /14
255.254.0.0 /15
255.255.0.0 /16
255.255.128.0 /17
255.255.192.0 /18
255.255.224.0 /19
255.255.240.0 /20
255.255.248.0 /21
255.255.252.0 /22
255.255.254.0 /23
255.255.255.0 /24
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
255.255.255.252 /30

SUBNETTING PADA IP ADDRESS CLASS C
Ok, sekarang mari langsung latihan saja. Subnetting seperti apa yang terjadi dengan sebuah NETWORK ADDRESS 192.168.1.0/26 ?
Analisa: 192.168.1.0 berarti kelas C dengan Subnet Mask /26 berarti 11111111.11111111.11111111.11000000 (255.255.255.192).

Penghitungan: Seperti sudah saya sebutkan sebelumnya semua pertanyaan tentang subnetting akan berpusat di 4 hal, jumlah subnet, jumlah host per subnet, blok subnet, alamat host dan broadcast yang valid. Jadi kita selesaikan dengan urutan seperti itu:

Jumlah Subnet = 2x, dimana x adalah banyaknya binari 1 pada oktet terakhir subnet mask (2 oktet terakhir untuk kelas B, dan 3 oktet terakhir untuk kelas A). Jadi Jumlah Subnet adalah 22 = 4 subnet Jumlah Host per Subnet = 2y - 2, dimana y adalah adalah kebalikan dari x yaitu banyaknya binari 0 pada oktet terakhir subnet. Jadi jumlah host per subnet adalah 26 - 2 = 62 host Blok Subnet = 256 - 192 (nilai oktet terakhir subnet mask) = 64. Subnet berikutnya adalah 64 + 64 = 128, dan 128+64=192. Jadi total subnetnya adalah 0, 64, 128, 192. Bagaimana dengan alamat host dan broadcast yang valid? Kita langsung buat tabelnya. Sebagai catatan, host pertama adalah 1 angka setelah subnet, dan broadcast adalah 1 angka sebelum subnet berikutnya.
Subnet 192.168.1.0 192.168.1.64 192.168.1.128 192.168.1.192 Host Pertama 192.168.1.1 192.168.1.65 192.168.1.129 192.168.1.193 Host Terakhir 192.168.1.62 192.168.1.126 192.168.1.190 192.168.1.254 Broadcast 192.168.1.63 192.168.1.127 192.168.1.191 192.168.1.255
Kita sudah selesaikan subnetting untuk IP address Class C. Dan kita bisa melanjutkan lagi untuk subnet mask yang lain, dengan konsep dan teknik yang sama. Subnet mask yang bisa digunakan untuk subnetting class C adalah:

Subnet Mask Nilai CIDR
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
255.255.255.252 /30

SUBNETTING PADA IP ADDRESS CLASS B
Berikutnya kita akan mencoba melakukan subnetting untuk IP address class B. Pertama, subnet mask yang bisa digunakan untuk subnetting class B adalah:
Subnet Mask Nilai CIDR
255.255.128.0 /17
255.255.192.0 /18
255.255.224.0 /19
255.255.240.0 /20
255.255.248.0 /21
255.255.252.0 /22
255.255.254.0 /23
255.255.255.0 /24
255.255.255.128 /25
255.255.255.192 /26
255.255.255.224 /27
255.255.255.240 /28
255.255.255.248 /29
255.255.255.252 /30

Ok, kita coba satu soal untuk Class B dengan network address 172.16.0.0/18.
Analisa: 172.16.0.0 berarti kelas B, dengan Subnet Mask /18 berarti 11111111.11111111.11000000.00000000 (255.255.192.0).
Penghitungan:
Jumlah Subnet = 2x, dimana x adalah banyaknya binari 1 pada 2 oktet terakhir. Jadi Jumlah Subnet adalah 22 = 4 subnet Jumlah Host per Subnet = 2y - 2, dimana y adalah adalah kebalikan dari x yaitu banyaknya binari 0 pada 2 oktet terakhir. Jadi jumlah host per subnet adalah 214 - 2 = 16.382 host Blok Subnet = 256 - 192 = 64. Subnet berikutnya adalah 64 + 64 = 128, dan 128+64=192. Jadi total subnetnya adalah 0, 64, 128, 192. Alamat host dan broadcast yang valid? Subnet 172.16.0.0 172.16.64.0 172.16.128.0 172.16.192.0 Host Pertama 172.16.0.1 172.16.64.1 172.16.128.1 172.16.192.1 Host Terakhir 172.16.63.254 172.16.127.254 172.16.191.254 172.16.255.254 Broadcast 172.16.63.255 172.16.127.255 172.16.191.255 172.16..255.255
Masih bingung? Ok kita coba satu lagi untuk Class B.Bagaimana dengan network address 172.16.0.0/25.
Analisa: 172.16.0.0 berarti kelas B, dengan Subnet Mask /25 berarti 11111111.11111111.11111111.10000000 (255.255.255.128).
Penghitungan:
Jumlah Subnet = 29 = 512 subnet Jumlah Host per Subnet = 27 - 2 = 126 host Blok Subnet = 256 - 128 = 128. Alamat host dan broadcast yang valid? Subnet 172.16.0.0 172.16.0.128 172.16.1.0 … 172.16.255.128 Host Pertama 172.16.0.1 172.16.0.129 172.16.1.1 … 172.16.255.129 Host Terakhir 172.16.0.126 172.16.0.254 172.16.1.126 … 172.16.255.254 Broadcast 172.16.0.127 172.16.0.255 172.16.1.127 … 172.16.255.255
Masih bingung juga? Ok sebelum masuk ke Class A, coba ulangi lagi dari Class C, dan baca pelan-pelan

SUBNETTING PADA IP ADDRESS CLASS A
Kalau sudah mantab dan paham, kita lanjut ke Class A. Konsepnya semua sama saja. Perbedaannya adalah di OKTET mana kita mainkan blok subnet. Kalau Class C di oktet ke 4 (terakhir), kelas B di Oktet 3 dan 4 (2 oktet terakhir), kalau Class A di oktet 2, 3 dan 4 (3 oktet terakhir). Kemudian subnet mask yang bisa digunakan untuk subnetting class A adalah semua subnet mask dari CIDR /8 sampai /30.
Kita coba latihan untuk network address 10.0.0.0/16.
Analisa: 10.0.0.0 berarti kelas A, dengan Subnet Mask /16 berarti 11111111.11111111.00000000.00000000 (255.255.0.0).
Penghitungan:
Jumlah Subnet = 28 = 256 subnet Jumlah Host per Subnet = 216 - 2 = 65534 host Blok Subnet = 256 - 255 = 1. Jadi subnet lengkapnya: 0,1,2,3,4, etc. Alamat host dan broadcast yang valid? Subnet 10.0.0.0 10.1.0.0 … 10.254.0.0 10.255.0.0 Host Pertama 10.0.0.1 10.1.0.1 … 10.254.0.1 10.255.0.1 Host Terakhir 10.0.255.254 10.1.255.254 … 10.254.255.254 10.255.255.254 Broadcast 10.0.255.255 10.1.255.255 … 10.254.255.255 10.255.255.255
Mudah-mudahan sudah setelah anda membaca paragraf terakhir ini, anda sudah memahami penghitungan subnetting dengan baik. Kalaupun belum paham juga, anda ulangi terus artikel ini pelan-pelan dari atas. Untuk teknik hapalan subnetting yang lebih cepat, tunggu di artikel berikutnya
Catatan: Semua penghitungan subnet diatas berasumsikan bahwa IP Subnet-Zeroes (dan IP Subnet-Ones) dihitung secara default. Buku versi terbaru Todd Lamle dan juga CCNA setelah 2005 sudah mengakomodasi masalah IP Subnet-Zeroes (dan IP Subnet-Ones) ini. CCNA pre-2005 tidak memasukkannya secara default (meskipun di kenyataan kita bisa mengaktifkannya dengan command ip subnet-zeroes), sehingga mungkin dalam beberapa buku tentang CCNA serta soal-soal test CNAP, anda masih menemukan rumus penghitungan Jumlah Subnet = 2x - 2

Friday, September 14, 2007

Tutorial Mikrotik VPN : Point to Point Tunnel Protocol (PPTP)

Summary
PPTP (Point to Point Tunnel Protocol) supports encrypted tunnels over IP. The MikroTik RouterOS implementation includes support fot PPTP client and server.
General applications of PPTP tunnels:

* For secure router-to-router tunnels over the Internet* To link (bridge) local Intranets or LANs (when EoIP is also used)* For mobile or remote clients to remotely access an Intranet/LAN of a company (see PPTP setup for Windows for more information)
Each PPTP connection is composed of a server and a client. The MikroTik RouterOS may function as a server or client – or, for various configurations, it may be the server for some connections and client for other connections. For example, the client created below could connect to a Windows 2000 server, another MikroTik Router, or another router which supports a PPTP server.DescriptionPPTP is a secure tunnel for transporting IP traffic using PPP. PPTP encapsulates PPP in virtual lines that run over IP. PPTP incorporates PPP and MPPE (Microsoft Point to Point Encryption) to make encrypted links. The purpose of this protocol is to make well-managed secure connections between routers as well as between routers and PPTP clients (clients are available for and/or included in almost all OSs including Windows).
PPTP includes PPP authentication and accounting for each PPTP connection. Full authentication and accounting of each connection may be done through a RADIUS client or locally.
MPPE 40bit RC4 and MPPE 128bit RC4 encryption are supported.

PPTP traffic uses TCP port 1723 and IP protocol GRE (Generic Routing Encapsulation, IP protocol ID 47), as assigned by the Internet Assigned Numbers Authority (IANA). PPTP can be used with most firewalls and routers by enabling traffic destined for TCP port 1723 and protocol 47 traffic to be routed through the firewall or router.

PPTP connections may be limited or impossible to setup though a masqueraded/NAT IP connection. Please see the Microsoft and RFC links at the end of this section for more information.PPTP Client SetupSubmenu level : /interface pptp-clientProperty Descriptionname (name; default: pptp-out1) - interface name for referencemtu (integer; default: 1460) - Maximum Transmit Unit. The optimal value is the MTU of the interface the tunnel is working over decreased by 40 (so, for 1500-byte ethernet link, set the MTU to 1460 to avoid fragmentation of packets)mru (integer; default: 1460) - Maximum Receive Unit. The optimal value is the MTU of the interface the tunnel is working over decreased by 40 (so, for 1500-byte ethernet link, set the MRU to 1460 to avoid fragmentation of packets)connect-to (IP address)- the IP address of the PPTP server to connect touser (string)- user name to use when logging on to the remote serverpassword (string; default: "")- user password to use when logging to the remote serverprofile (name; default: default) - profile to use when connecting to the remote serveradd-default-route (yes no; default: no) - whether to use the server which this client is connected to as its default router (gateway)ExampleTo set up PPTP client named test2 using username john with password john to connect to the 10.1.1.12 PPTP server and use it as the default gateway:

[admin@MikroTik] interface pptp-client> add name=test2 connect-to=10.1.1.12 \\... user=john add-default-route=yes password=john[admin@MikroTik] interface pptp-client> printFlags: X - disabled, R - running0 X name="test2" mtu=1460 mru=1460 connect-to=10.1.1.12 user="john"password="john" profile=default add-default-route=yes
[admin@MikroTik] interface pptp-client> enable 0
Monitoring PPTP ClientCommand name : /interface pptp-client monitorProperty DescriptionStatistics:
uptime (time) - connection time displayed in days, hours, minutes, and secondsencoding (string) - encryption and encoding (if asymmetric, separated with '/') being used in this connectionstatus (string) - status of the client:# Dialing – attempting to make a connection# Verifying password... - connection has been established to the server, password verification in progress# Connected – self-explanatory# Terminated – interface is not enabled or the other side will not establish a connection

ExampleExample of an established connection:
[admin@MikroTik] interface pptp-client> monitor test2uptime: 4h35sencoding: MPPE 128 bit, statelessstatus: Connected[admin@MikroTik] interface pptp-client>
PPTP Server SetupSubmenu level : /interface pptp-server server
[admin@MikroTik] interface pptp-server server> printenabled: nomtu: 1460mru: 1460authentication: mschap2default-profile: default[admin@MikroTik] interface pptp-server server>
DescriptionThe PPTP server supports unlimited connections from clients. For each current connection, a dynamic interface is created.Property Descriptionenabled (yes no; default: no) - defines whether PPTP server is enabled or notmtu (integer; default: 1460) - Maximum Transmit Unit. The optimal value is the MTU of the interface the tunnel is working over decreased by 40 (so, for 1500-byte ethernet link, set the MTU to 1460 to avoid fragmentation of packets)mru (integer; default: 1460) - Maximum Receive Unit. The optimal value is the MTU of the interface the tunnel is working over decreased by 40 (so, for 1500-byte ethernet link, set the MTU to 1460 to avoid fragmentation of packets)authentication (multiple choice: pap chap mschap1 mschap2; default: mschap2) - authentication algorithmdefault-profile (name; default: default) - default profile to useExampleTo enable PPTP server:
[admin@MikroTik] interface pptp-server server> set enabled=yes[admin@MikroTik] interface pptp-server server> printenabled: yesmtu: 1460mru: 1460authentication: mschap2default-profile: default[admin@MikroTik] interface pptp-server server>
PPTP Server UsersSubmenu level : /interface pptp-serverDescriptionThere are two types of items in PPTP server configuration - static users and dynamic connections. A dynamic connection can be established if the user database or the default-profile has its local-address and remote-address set correctly. When static users are added, the default profile may be left with its default values and only P2P user (in /ppp secret) should be configured. Note that in both cases P2P users must be configured properly.Property Descriptionname - interface nameuser - the name of the user that is configured statically or added dynamically

Statistics:
mtu - shows (cannot be set here) client's MTUclient-address - shows (cannot be set here) the IP of the connected clientuptime - shows how long the client is connectedencoding (string) - encryption and encoding (if asymmetric, separated with '/') being used in this connectionExampleTo add a static entry for ex1 user:
[admin@MikroTik] interface pptp-server> add user=ex1[admin@MikroTik] interface pptp-server> printFlags: X - disabled, D - dynamic, R - running# NAME USER MTU CLIENT-ADDRESS UPTIME ENC...0 DR ex 1460 10.0.0.202 6m32s none1 pptp-in1 ex1[admin@MikroTik] interface pptp-server>
In this example an already connected user ex is shown besides the one we just added.PPTP Router-to-Router Secure Tunnel ExampleThe following is an example of connecting two Intranets using an encrypted PPTP tunnel over the Internet.
There are two routers in this example:
* [HomeOffice]Interface LocalHomeOffice 10.150.2.254/24Interface ToInternet 192.168.80.1/24
* [RemoteOffice]Interface ToInternet 192.168.81.1/24Interface LocalRemoteOffice 10.150.1.254/24
Each router is connected to a different ISP. One router can access another router through the Internet.
On the PPTP server a user must be set up for the client:
[admin@HomeOffice] ppp secret> add name=ex service=pptp password=lkjrhtlocal-address=10.0.103.1 remote-address=10.0.103.2[admin@HomeOffice] ppp secret> print detailFlags: X - disabled0 name="ex" service=pptp caller-id="" password="lkjrht" profile=defaultlocal-address=10.0.103.1 remote-address=10.0.103.2 routes==""
[admin@HomeOffice] ppp secret>

Then the user should be added in the PPTP server list:
[admin@HomeOffice] interface pptp-server> add user=ex[admin@HomeOffice] interface pptp-server> printFlags: X - disabled, D - dynamic, R - running# NAME USER MTU CLIENT-ADDRESS UPTIME ENC...0 pptp-in1 ex[admin@HomeOffice] interface pptp-server>
And finally, the server must be enabled:
[admin@HomeOffice] interface pptp-server server> set enabled=yes[admin@HomeOffice] interface pptp-server server> printenabled: yesmtu: 1460mru: 1460authentication: mschap2default-profile: default[admin@HomeOffice] interface pptp-server server>
Add a PPTP client to the RemoteOffice router:
[admin@RemoteOffice] interface pptp-client> add connect-to=192.168.80.1 user=ex \\... password=lkjrht disabled=no[admin@RemoteOffice] interface pptp-client> printFlags: X - disabled, R - running0 R name="pptp-out1" mtu=1460 mru=1460 connect-to=192.168.80.1 user="ex"password="lkjrht" profile=default add-default-route=no
[admin@RemoteOffice] interface pptp-client>
Thus, a PPTP tunnel is created between the routers. This tunnel is like an Ethernet point-to-point connection between the routers with IP addresses 10.0.103.1 and 10.0.103.2 at each router. It enables 'direct' communication between the routers over third party networks.
To route the local Intranets over the PPTP tunnel – add these routes:
[admin@HomeOffice] > ip route add dst-address 10.150.1.0/24 gateway 10.0.103.2[admin@RemoteOffice] > ip route add dst-address 10.150.2.0/24 gateway 10.0.103.1
On the PPTP server it can alternatively be done using routes parameter of the user configuration:
[admin@HomeOffice] ppp secret> print detailFlags: X - disabled0 name="ex" service=pptp caller-id="" password="lkjrht" profile=defaultlocal-address=10.0.103.1 remote-address=10.0.103.2 routes==""
[admin@HomeOffice] ppp secret> set 0 routes="10.150.1.0/24 10.0.103.2 1"[admin@HomeOffice] ppp secret> print detailFlags: X - disabled0 name="ex" service=pptp caller-id="" password="lkjrht" profile=defaultlocal-address=10.0.103.1 remote-address=10.0.103.2routes="10.150.1.0/24 10.0.103.2 1"
[admin@HomeOffice] ppp secret>
Test the PPTP tunnel connection:
[admin@RemoteOffice]> /ping 10.0.103.110.0.103.1 pong: ttl=255 time=3 ms10.0.103.1 pong: ttl=255 time=3 ms10.0.103.1 pong: ttl=255 time=3 msping interrupted3 packets transmitted, 3 packets received, 0% packet lossround-trip min/avg/max = 3/3.0/3 ms
Test the connection through the PPTP tunnel to the LocalHomeOffice interface:
[admin@RemoteOffice]> /ping 10.150.2.25410.150.2.254 pong: ttl=255 time=3 ms10.150.2.254 pong: ttl=255 time=3 ms10.150.2.254 pong: ttl=255 time=3 msping interrupted3 packets transmitted, 3 packets received, 0% packet lossround-trip min/avg/max = 3/3.0/3 ms
To bridge a LAN over this secure tunnel, please see the example in the 'EoIP' section of the manual. To set the maximum speed for traffic over this tunnel, please consult the 'Queues' section.
Connecting a Remote Client via PPTP TunnelThe following example shows how to connect a computer to a remote office network over PPTP encrypted tunnel giving that computer an IP address from the same network as the remote office has (without need of bridging over eoip tunnels)
Please, consult the respective manual on how to set up a PPTP client with the software You are using.
The router in this example:
* [RemoteOffice]Interface ToInternet 192.168.81.1/24Interface Office 10.150.1.254/24
The client computer can access the router through the Internet.
On the PPTP server a user must be set up for the client:
[admin@RemoteOffice] ppp secret> add name=ex service=pptp password=lkjrhtlocal-address=10.150.1.254 remote-address=10.150.1.2[admin@RemoteOffice] ppp secret> print detailFlags: X - disabled0 name="ex" service=pptp caller-id="" password="lkjrht" profile=defaultlocal-address=10.150.1.254 remote-address=10.150.1.2 routes==""
[admin@RemoteOffice] ppp secret>
Then the user should be added in the PPTP server list:
[admin@RemoteOffice] interface pptp-server> add name=FromLaptop user=ex[admin@RemoteOffice] interface pptp-server> printFlags: X - disabled, D - dynamic, R - running# NAME USER MTU CLIENT-ADDRESS UPTIME ENC...0 FromLaptop ex[admin@RemoteOffice] interface pptp-server>
And the server must be enabled:
[admin@RemoteOffice] interface pptp-server server> set enabled=yes[admin@RemoteOffice] interface pptp-server server> printenabled: yesmtu: 1460mru: 1460authentication: mschap2default-profile: default[admin@RemoteOffice] interface pptp-server server>
Finally, the proxy APR must be enabled on the 'Office' interface:
[admin@RemoteOffice] interface ethernet> set Office arp=proxy-arp[admin@RemoteOffice] interface ethernet> printFlags: X - disabled, R - running# NAME MTU MAC-ADDRESS ARP0 R ToInternet 1500 00:30:4F:0B:7B:C1 enabled1 R Office 1500 00:30:4F:06:62:12 proxy-arp[admin@RemoteOffice] interface ethernet>

Thursday, September 13, 2007

High Speed Internet Connection

Internet has almost become a lifeline for the new generation. Many businesses now depend entirely on the Internet. People residing in different parts of world are able to talk to each other via the medium of Internet. Video conferencing is a live example of it. Many marriages are also made with the help of the Internet. The list of benefits that Internet provides is limitless.
But, what would you do when you have a slow speed internet connection that takes a lot of time? That internet connection would simply be useless to you.

The speed at which you are connected to the Internet plays a very important role in enjoying the advantages offered by it. For example, suppose one of your relatives who is residing overseas, has sent you a holiday clip. Now, if your Internet speed is slow then first of all it would take a long time to load the mail website. Then you would enter your user name and password. It would again take extra time to verify it. Also, downloading the clip would be very slow, even if its size is very small. Overall, you can say that having a low speed Internet connection (dial-up connection) is not a good thing.

There are many choices available for a high speed Internet connection. DSL, Cable and Satellite are some of them. You can select the best one from them. Here are some of the common benefits that all these high speed Internet connections provide.

* Viewing of streamlining clips or videos is very easy and fast in these connections. Dial-up connections may not even allow their access. * You can upload web pages and download any kind of information or software with more than twice the speed of dial-up connection. * Downloading of images and huge e-mail files can be done almost promptly. * High speed Internet connection has proven to be a boon for all businessmen. They can now access the world wide web within a few seconds. Their businesses have been highly benefited through efficient and quick video conferencing which would have been impossible in a slow dial-up connection. * For those people who work from home, a high speed Internet connection can assist them in increasing their overall work efficiency and output. * On a long term basis, the high speed Internet connection can prove to be highly economical.

DSL: The best choice for high speed internet connection Now-a-days, DSL has become the leading choice for a high speed Internet connection. DSL works on existing telephone lines. With a DSL connection you can browse the web and talk on the phone at the same time. Generally, a DSL connection requires a DSL router, a dedicated phone line and a network card or a modem for each system. The installation of DSL at your location is the responsibility of the service provider. Last but not the least, this high speed Internet connection is offered at very affordable prices.

Saturday, April 7, 2007

Running SSH with Nokia N9500

In my office has use wifi and i try wifi from nokia to connect wifi after seting in nokia 9500 is running well, and than i have idea used SSH, TELNET Program from that mobile (nokia 9500) to access my router, my server and etc, and than i search on the internet. and than i found that program, its name Mobile SSHThis Aplication running on OS Symbian it'll running on OS Symbian what ever your mobile

1. Install on Nokia 9500
2. Test to my router (running well)
3. Test to my server (running well)
4. Test to AS400 .. (runninn well)

if you wont try, that aplication can be download at
http://www.idokorro.com/index.shtml

and in that site not only Mobile SSH, so many aplication on that site but it's not free guys..
but u can test with trial