PT. Hawk Teknologi Solusi

Silahkan Cari Disini

Rabu, 28 Mei 2008

Menjadikan debian sebagai syslog server yang disimpan di mysql

Kadang kita perlu menyimpan log dari mesin2 tertentu ke sebuah syslog server agar diperoleh report yang dibutuhkan, lebi seru lagi kalau datanya disimpan di database server seperti mysql jadi mudah untuk di query.

Berikut adalah cara instalasi syslog server yang datanya disimpan di mysql pada distro debian.

Pertama install syslog-ng

apt-get install syslog-ng syslog-summary


kemudian tambahkan file di /etc/syslog-ng/syslog-ng.

source net { udp(); };

destination d_mysql {
pipe("/tmp/mysql.pipe"
template("INSERT INTO logs (host, facility, priority, level, tag, date,
time, program, msg) VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL','$TAG',
'$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$PROGRAM', '$MSG' );\n") template-escape(yes));
};

log { source(net); destination(d_mysql); };


save lalu restart syslog-ng

/etc/init.d/syslog-ng restart

buat fifo pipe untuk syslog-ng caranya:

mkfifo /tmp/mysql.pipe


buat database syslogdb di mysql dengan perintah SQL berikut:
perintah SQL ini bisa diinput melalui phpmysql atau melalui console, kalau saya paling praktis menggunakan phpmysql, sorry di artikel ini saya tidak menjelaskan instalasi mysqlnya, jadi asumsi mysqlnya udah jalan dengan benar.


CREATE DATABASE syslogdb;
USE syslogdb;

CREATE TABLE logs (
host varchar(32) default NULL,
facility varchar(10) default NULL,
priority varchar(10) default NULL,
level varchar(10) default NULL,
tag varchar(10) default NULL,
date date default NULL,
time time default NULL,
program varchar(15) default NULL,
msg text,
seq int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (seq),
KEY host (host),
KEY seq (seq),
KEY program (program),
KEY time (time),
KEY date (date),
KEY priority (priority),
KEY facility (facility)
) TYPE=MyISAM;


berikutnya buat script /etc/syslog-ng/rc.syslog-ng-to-myqsl
yang isinya:

#
# Created by Tadghe Patrick Danu
#
#!/bin/bash

if [ -e /tmp/mysql.pipe ]; then
while [ -e /tmp/mysql.pipe ]
do
mysql -u root --password='password root mysql yang digunakan' syslogdb < /tmp/mysql.pipe done
else
mkfifo /tmp/mysql.pipe
fi


kemudian chmod 750 /etc/syslog-ng/rc.syslog-ng-to-mysql hati-hati di file itu ada password root msyql jadi jangan lupa utk dibuat 750 ya supaya orang lain selain root tidak bisa lihat isinya, atau bisa juga buat user khusus utk syslogdb di mysqlnya.


kalau sudah tinggal restart syslog-ng /etc/init.d/syslog-ng restart dan eksekusi /etc/syslog-ng/rc.syslog-ng-to-mysql & atau bisa juga dimasukkin ke /etc/rc.local supaya otomatis jalan kalau debiannya direboot. ini hasilnya kalau dilihat di phpmyadmin.




sebagai tambahan kalau dari mesin cisco mau dilempar lognya ke syslog server commandnya spt ini:

conf t
logging IP_address_of_UNIX_host
logging facility local7 (use local7 syslog facility)
logging trap level_of_debugging (default is "informational")
logging on



reference:

http://kryptoz.wordpress.com/2008/04/10/configure-syslog-ng-syslogd-remote-log-server/
http://vermeer.org/docs/1
http://www.brandonhutchinson.com/Remote_Cisco_logging.html

Senin, 19 Mei 2008

Memfilter broadcast traffic yang bukan menuju ke pelanggan yang bersangkutan

Dikarenakan switch yang digunakan di roof cyber sementara tidak managable alias tidak bisa di konfigurasi vlan maka traffic antar radio pelanggan yang satu bisa ter-broadcast ke pelanggan lainnya.

Untuk mengurangi beban traffic tersebut agar tidak ter-broadcast ke radio disisi pelanggan maka saya buat filtering sbb:

Langkah 1
Buat daftar address-lists dengan nama pelanggan , misalnya disini contohnya adalah "praisindo" yang isinya blok ip yang digunakan oleh pelanggan utk terkoneksi ke Internet, disini contohnya user praisindo menggunakan IP:
- 203.89.26.104/30 -> Ip Publik pelanggan
- 10.3.0.0/29 -> IP Radio pelanggan


Langkah 2
Buat Filter Rules pada chain: forward, pada Tab General set in-interface = ether1 (yang merupakan interface yang terhubung ke switch di roof cyber) dan out interface = wlan1 (yang merupakan interface wireless yang menuju ke pelanggan)


Pada Tab Advanced, Dst-address list = !praisindo (artinya bukan "!" dari list "praisindo")


Pada Tab Action, Action = Drop


Dengan demikian broadcast dari pelanggan lainnya difilter untuk tidak diteruskan ke sisi wireless pelanggan tersebut.

Jumat, 16 Mei 2008

Instalasi Caci di Debian

DITULIS OLEH : EKA RAHMAT H

EMAIL : surat-mu@hotmail.com
http://sisulung.wordpress.com/2007/12/14/install-cacti-di-debian-etch/


Apa itu CACTI?

Cacti adalah frontend dari RRDTool yang menyimpan informasi kedalam database !MySQL dan membuat graph berdasarkan informasi tersebut. Proses pengambilan data (lewat SNMP maupun skrip) sampai kepada pembuatan gambar (graph) dilakukan menggunakan bahasa pemrograman PHP.

http://www.raxnet.net/products/cacti

Instalasi:

Cacti membutuhkan beberapa aplikasi berikut terinstall kedalam sistem sebelumnya.

RRDTool 1.0.48 or greater http://www.rrdtool.org rrdtool

MySQL 3.23 or greater, 4.0.20d or greater highly recommended for advanced features http://www.mysql.org MySQL

PHP 4.1 or greater, 4.3.6 or greater highly recommended for advanced features http://www.php.net PHP

http://net-snmp.sourceforge.net net-snmp

Install Cacri di Debian

Pada dasarnya, kalau Anda menggunakan debian menginstall cacti tidaklah susah karena paket .deb sudah tersedia, Cuma pada saat saya peraktekan terjadi error nah untuk menyiasatinya kita install manual aja paket-paket yang dibutuhkan untuk menjalankan cacti.

  1. Install cacti dengnan menggunakan apt-get (auto)
    Debian:~#apt-get install cacti
    Ket : ini akan menginstall semua paket yang di butuhkan seperti mysql, rrdtool, Cuma sayangnya pas saya coba masih ada setikit error pada paket mysql-nya dan php dan biasanya php-ya masih yang php4, untuk menginstall versi terbaru dari php kita lakukan cara manual aja dech, caranya ada di langkah ke 2.
  2. Install paket-paket yang di butuhkan si cacti
    Menginstall server database MySQL
    Debian:~#apt-get install mysql-server
    Ket : MySQL awalnya hanya mengizinkan koneksi dari localhost (127.0.0.1) saja. Kita harus menghapus pembatasan in jika Anda ingin membuat MySQL dapat diakses oleh siapapun melalui internet. Buka berkas /etc/mysql/my.cnf
    Debian:~#vim /etc/mysql/my.cnf

    Cari baris ini bind-address = 127.0.0.1 dan berikan komentar (#)


    #bind-address = 127.0.0.1


    Ket : Default-nya MySQL tidak memasang password root. Hal ini dapat menimbulkan masalah keamanan. Anda harus segera menetapkan password root. Anda juga harus menetapkan password root, apabila ingin menggunakan akses root dari komputer lokal Anda. Nama-mesin-local adalah nama komputer yang sedang Anda gunakan.

    Debian:~#mysqladmin -u root password your-new-password

    Debian:~#mysqladmin -h root@nama-mesin-lokal -u root -p password your-new-password

    Debian:~#sudo /etc/init.d/mysql restart

    Sampai disini install mysql sudah selesai.

    Menginstall server http Apache

    Debian:~#
    apt-get install apache2

    Ket : Setelah proses installasi selesai, untuk mencobanya Anda ketikan perintah ini di browser : http://localhost

    Bagaimana menginstal PHP5 untuk Server HTTP Apache

    Debian:~#sudo apt-get install php5

    Debian:~#sudo apt-get install libapache2-mod-php5

    Debian:~#sudo /etc/init.d/apache2 restart

    Ket : Jika Anda hanya membutuhkan php4 ya ganti aja tulisan php5 dengan tulisan php4

    Untuk menguji jika php4 telah terinstal dengan baik

    Debian:~#vim /var/www/testphp.php

    Buat berkas baru dan masukkan baris berikut


    Simpan berkas yang telah disunting

    Untuk mengujinya coba buka browser dan ketikan perintah ini http://localhost/testphp.php kalau ga mau jalan coba ketikan seperti ini http://ipAddressServer/testphp.php

    Bagaimana menginstal MYSQL untuk Server HTTP Apache

    Debian:~#apt-get install libapache2-mod-auth-mysql

    Debian:~#apt-get install php5-mysql

    Untuk membuat PHP bekerja dengan MySQL, buka berkas

    Debian:~#vim /etc/php5/apache2/php.ini

    Anda harus menghapus komentar di baris “;extension=mysql.so” sehingga akan terlihat seperti ini


    extension=mysql.so


    Simpan berkas dan keluar

    Debian:#/etc/init.d/apache2 restart

    Untuk mempermudah penggunaan php saya sangat menyarankan Anda menggunakan program yang namanya “phpmyadmin” cara install di debian sbb:

    Debian:~#apt-get install phpmyadmin

    Ket : Kalau dah selesai installnya, coba jalankan browser dan ketikan http://localhost/phpmyadmin dan akan muncul spt gambar di bawah ini :


    Nama pengguna : root

    Kata Sandi : password_anda

    Dan akan tampil seperti gambar di bawah ini :


    Ket : Sejauh ini install paket-paket yang di butuhkan oleh si cacti sudah selesai, sekarang tibalah saatnya untuk mengkonfigurasi si cacti.

  3. Configurasi Cacti
    Membuat user buat si cacti :
    Debian:~#adduser cacti
    Membuat MySQL database buat si cacti
    Debian:~#mysqladmin –user=root create cacti

    Meninport database default si cacti

    Debian:~#mysql cacti < cacti.sql

    Ket : Tapi kalau dengan cara ini masih menemui kesulitan atau error maka gunakan cara 2 dengan menggunakan phpmyadmin, supaya lebih mudah kita mengimportnya lewat phpmyadmin.

    1. Bukan browser kesayangan Anda
    2. Download cacti http://www.cacti.net/downloads/cacti-0.8.7a.zip dan lakukan extract..
    3. Ketikan perintah ini : http://localhost/phpmyadmin
    4. Akan tampil gambar seperti di atas, masukan username dan password anda dan tekan enter.
    5. Pada bagian kiri di bagian “Database” pilih “cacti”
    6. Pada bagian atas pilih tulisan “import”
    7. Pada bagian “File to Import” klik tombol “Browse..”
    8. Cari dimana Anda meletakan hail extract.. cacti tersebut dan filih file “cacti” klik “open”
    9. Klik “GO” di pojok kanan bawah.

    Ket : Prosess di atas sebetulnya cukup dilakukan dengan perintah mysql cacti < cacti.sql, Cuma pas say peraktekan kok ga bisa ya… makanya saya cari car lain aja dech…!!

    Membuat MySQL username dan password buat si Cacti

    Debian:~#mysql –user=root mysql

    Debian:~#mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY ’somepassword’;

    Debian:~#mysql> flush privileges;

    Saatnya meng Edit include/config.php

    Debian:~#vim /usr/share/cacti/site/include/config.php

    Cari bagian-bagian ini dan tambahkan user, password, database buat di cacti.

    ….

    $database_default = “cacti”;

    $database_hostname = “localhost”;

    $database_username = “cactiuser”;

    $database_password = “cacti”;

    ….

    Ubah permissions directory-nya

    Debian:~#chown -R cactiuser /usr/share/cacti/site/rra

    Debian:~#chown -R cactiuser /usr/share/cacti/site/log

    Saatnya meng Edit /etc/crontab

    Debian:~#vim /etc/crontab

    Masukan baris berikut ini

    ….

    */5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1

    ….

    Hemmmmm hemmmm sepertinya perjalanan panjang installasi dan configurasi cacti sudah hampir mendekati selesai…

  4. Tahap akhir konfigurasi Cacti.
    Buka browser kesayangan anda dan ketikan http://localhost/cacti
    Jika tidak ada yang error klik next dan selesay dechhhhhhhhhhhhh….
    Tinggal Anda bereksperimen sendiri menggunakan Cacti..
    Demikian dulu pelajaranya… kl ada yang mau menambahkan silahkan posting nanti akan saya tampilkan dech… swerrrrrrrr

CACTI SUPPORT

http://forums.cacti.net/

Download Official Patches For Cacti

http://www.cacti.net/download_patches.php

Additional scripts For Cacti

http://www.cacti.net/additional_scripts.php

Cacti Screen Shots

http://www.cacti.net/screenshots.php

BAHAN RUJUKAN

http://www.debianhelp.co.uk/cacti.htm

http://www.cacti.net/downloads/docs/html/unix_configure_cacti.html

http://wiki.ubuntu-id.org/PanduanUbuntu

http://corebsd.or.id/wiki/doku.php?id=coreartikel:cacti

Sabtu, 10 Mei 2008

ZEROSHELL live cd router

Bermula dari rencana mengganti router mikrotik kantor jakarta dengan komputer IBM Netvista dari mas priyo yang ternyata tidak ikhlas kalau harddisk nya di babat karena ada konfigurasi SIP Server.

Semula mau coba mikrotik booting lewat USB, percobaan pertama sukses menggunakan USB 1GB tapi kan sayang-sayang tuh jadi coba pake USB 128MB hadiah dari vendor eh ternyata bermasalah akhirnya cari-cari live+cd+router di google.com dan akhirnya didapat ZEROSHELL yang merupakan router live cd berbasis linux.

cara instalasinya mudah saja download file iso nya lalu burn di cd kemudian booting komputer menggunakan live cd tersebut , selanjutnya konfigure ZEROSHELL lewat browser ke ip defaultnya 192.168.0.75/24 dengan user=admin , pass=zeroshell kemudian setup networknya dan fitur-fitur yang dibutuhkan seperti dhcp server, qos dll.

yang menarik konfigurasinya bisa di simpan di USB jadi kalau di reboot setinggannya tidak hilang karena ZEROSHELL akan membaca konfigurasi yang active dari USB tersebut.

Tapi ini bagian yang paling menyebalkan karena caranya mesti buat database dulu di USB terus copy konfigurasi yang sudah kita buat baru aktifasikan file database yang berisi konfigurasi yang telah kita buat. atau bisa juga di backup filenya jadi simpan di komputer kerja admin, kalau sewaktu-waktu dibutuhkan bisa di save ke USB, pengalaman lebih baik USB di format menggunakan ext3 , kalau pake vfat (FAT) format windows file databasenya jadi bengkak ukurannya.

berikut adalah tampilan ZEROSHELL router yang digunakan di kantor



Web ZEROSHELL bisa diakses di http://www.zeroshell.net/eng


Jadi kalau mau ngirit manfaatin PC bekas buat router dikantor ZEROSHELL bisa jadi alternatif murah meriah.

Sayangnya saya belum berhasil untuk setingan QoS nya mungkin hanya efektif di mode bridge.

Kamis, 08 Mei 2008

What is a VLAN?

The Basic Definition

The acronym VLAN expands to Virtual Local Area Network. A VLAN is a logical local area network (or LAN) that extends beyond a single traditional LAN to a group of LAN segments, given specific configurations. Because a VLAN is a logical entity, its creation and configuration is done completely in software.

How Is a VLAN Identified

Since a VLAN is a software concept, identifiers and configurations for a VLAN must be properly prepared for it to function as expected. Frame coloring is the process used to ensure that VLAN members or groups are properly identified and handled. With frame coloring, packets are given the proper VLAN ID at their origin so that they may be properly processed as they pass through the network. The VLAN ID is then used to enable switching and routing engines to make the appropriate decisions as defined in the VLAN configuration.

Why Use VLANs

Traditional network designs use routers to create broadcast domains and limit broadcasts between multiple subnets. This prevents broadcast floods in larger networks from consuming resources, or causing unintentional denials of service unnecessarily. Unfortunately, the traditional network design methodology has some flaws in design

  • Geographic Focus - Traditional network designs focus on physical locations of equipment and personnel for addressing and LAN segment placement. Because of this there are a few significant drawbacks:
  • Network segments for physically disjointed organizations cannot be part of the same address space. Each physical location must be addressed independently, and be part of its own broadcast domain. This can force personnel to be located in a central location, or to have additional latency or connectivity shortfalls.
  • Relocations of personnel and departments can become difficult, especially if the original location retains its network segments. Relocated equipment will have to be reconfigured based on the new network configuration.

A VLAN solution can alleviate both of these drawbacks by permitting the same broadcast domain to extend beyond a single segment.

  • Additional Bandwidth Usage - Traditional network designs require additional bandwidth because packets have to pass through multiple levels of network connectivity because the network is segmented.

A proper VLAN design can ensure that only devices that have that VLAN defined on it will receive and forward packets intended as source or destination of the network flow.

Types of VLAN

There are only two types of VLAN possible today, cell-based VLANs and frame-based VLANs.

  • Cell-based VLANs are used in ATM switched networks with LAN Emulation (or LANE). LANE is used to allow hosts on legacy LAN segments to communicate using ATM networks without having to use special hardware or software modification.
  • Frame-based VLANs are used in ethernet networks with frame tagging. The two primary types of frame tagging are IEEE 802.10 and ISL (Inter Switch Link is a Cisco proprietary frame-tagging). Keep in mind that the 802.10 standard makes it possible to deploy VLANs with 802.3(Ethernet), 802.5(Token-Ring), and FDDI, but ethernet is most common.

VLAN modes

There are three different modes in which a VLAN can be configured. These modes are covered below:

  • VLAN Switching Mode - The VLAN forms a switching bridge in which frames are forwarded unmodified.
  • VLAN Translation Mode - VLAN translation mode is used when the frame tagging method is changed in the network path, or if the frame traverses from a VLAN group to a legacy or native interface which is not configured in a VLAN. When the packet is to pass into a native interface, the VLAN tag is removed so that the packet can properly enter the native interface.
  • VLAN Routing Mode - When a packet is routed from one VLAN to a different VLAN, you use VLAN routing mode. The packet is modified, usually by a router, which places its own MAC address as the source, and then changes the VLAN ID of the packet.

VLAN configurations

Different terminology is used between different hardware manufacturers when it comes to VLANs. Because of this there is often confusion at implementation time. Following are a few details, and some examples to assist you in defining your VLANs so confusion is not an issue.

Cisco VLAN terminology

You need a few details to define a VLAN on most Cisco equipment. Unfortunately, because Cisco sometimes acquires the technologies they use to fill their switching, routing and security product lines, naming conventions are not always consistent. For this article, we are focusing only one Cisco switching and routing product lines running Cisco IOS.

  • VLAN ID - The VLAN ID is a unique value you assign to each VLAN on a single device. With a Cisco routing or switching device running IOS, your range is from 1-4096. When you define a VLAN you usually use the syntax "vlan x" where x is the number you would like to assign to the VLAN ID. VLAN 1 is reserved as an administrative VLAN. If VLAN technologies are enabled, all ports are a member of VLAN 1 by default.
  • VLAN Name - The VLAN name is an text based name you use to identify your VLAN, perhaps to help technical staff in understanding its function. The string you use can be between 1 and 32 characters in length.
  • Private VLAN - You also define if the VLAN is to be a private vlan in the VLAN definition, and what other VLAN might be associated with it in the definition section. When you configure a Cisco VLAN as a private-vlan, this means that ports that are members of the VLAN cannot communicate directly with each other by default. Normally all ports which are members of a VLAN can communicate directly with each other just as they would be able to would they have been a member of a standard network segment. Private vlans are created to enhance the security on a network where hosts coexisting on the network cannot or should not trust each other. This is a common practice to use on web farms or in other high risk environments where communication between hosts on the same subnet are not necessary. Check your Cisco documentation if you have questions about how to configure and deploy private VLANs.
  • VLAN modes - in Cisco IOS, there are only two modes an interface can operate in, "mode access" and "mode trunk". Access mode is for end devices or devices that will not require multiple VLANs. Trunk mode is used for passing multiple VLANs to other network devices, or for end devices that need to have membership to multiple VLANs at once. If you are wondering what mode to use, the mode is probably "mode access".

Cisco VLAN implementations

VLAN Definition

To define a VLAN on a cisco device, you need a VLAN ID, a VLAN name, ports you would like to participate in the VLAN, and the type of membership the port will have with the VLAN.

  • Step 1 - Log into the router or switch in question and get into enable mode.
  • Step 2 - Get into configuration mode using "conf t".
  • Step 3 - Create your VLAN by entering "vlan X" where X is the ID you would like to assign the VLAN.
  • Step 4 - Name your VLAN by entering "name ". Replace with the string you would like to identify your VLAN by.
  • Step 5 - If you want your new VLAN to be a private-vlan, you now enter "private-vlan primary" and "private-vlan association Y" where Y is the secondary VLAN you want to associate with the primary vlan. If you would like the private VLAN to be community based, you enter "private-vlan community" instead.
  • Step 6 - Exit configuration mode by entering "end".
  • Step 7 - Save your configuration to memory by entering "wr mem" and to the network if you have need using "wr net". You may have to supply additional information to write configurations to the network depending on your device configuration.
VLAN Configuration

A VLAN isn't much use if you haven't assigned it an IP Address, the subnet netmask, and port membership. In normal network segment configurations on routers, individual interfaces or groups of interfaces (called channels) are assigned IP addresses. When you use VLANs, individual interfaces are members of VLANs and do not have individual IP addresses, and generally don't have access lists applied to them. Those features are usually reserved for the VLAN interfaces. The following steps detail one method of creating and configuring your VLAN interface. NOTE: These steps have already assumed that you have logged into the router, gotten into enable mode, and entered configuration mode. These specific examples are based on the Cisco 6500 series devices.

  • Step 1 - Enter "Interface VlanX" where X is the VLAN ID you used in the VLAN definition above.
  • Step 2 - This step is optional. Enter "description " where VLAN description details what the VLAN is going to be used for. You can just simply re-use the VLAN name you used above if you like.
  • Step 3 - Enter "ip address
    " where
    is the address you want to assign this device in the VLAN, and is the network mask for the subnet you have assigned the VLAN.
  • Step 4 - The step is optional. Create and apply an access list to the VLAN for inbound and outbound access controls. For a standard access list enter "access-group XXX in" and "access-group YYY out" where XXX and YYY corresponds to access-lists you have previously configured. Remember that the terms are taken in respect to the specific subnet or interface, so "in" means from the VLAN INTO the router, and "out" means from the router OUT to the VLAN.
  • Step 5 - This step is optional. Enter the private VLAN mapping you would like to use if the port is part of a private VLAN. This should be the same secondary VLAN you associated with the primary VLAN in VLAN definition above. Enter "private-vlan mapping XX" where XX is the VLAN ID of the secondary VLAN you would like to associate with this VLAN.
  • Step 6 - This step is optional. Configure HSRP and any other basic interface configurations you would normally use for your Cisco device.
  • Step 7 - Exit configuration mode by entering "end".
  • Step 8 - Save your configuration to memory by entering "wr mem" and to the network if you have need using "wr net". You may have to supply additional information to write configurations to the network depending on your device configuration.

Now you have your vlan defined and configured, but no physical ports are a member of the VLAN, so the VLAN still isn't of much use. Next port membership in the VLAN is described. IOS devices describe interfaces based on a technology and a port number, as with "FastEthernet3/1" or "GigabitEthernet8/16". Once you have determined which physical ports you want to be members of the VLAN you can use the following steps to configure it. NOTE: These steps have already assumed that you have logged into the router, gotten into enable mode, and entered configuration mode.

For access ports
  • Step 1 - Enter "Interface " where is the name Cisco has assigned the interface you would like to associate with the VLAN.
  • Step 2 - This step is optional. Enter "description " where is text describing the system connected to the interface in question. It is usually helpful to provide DNS hostname, IP Address, which port on the remote system is connected, and its function.
  • Step 3 - This step depends on your equipment and IOS version, and requirements. Enter "switchport" if you need the interface to act as a switch port. Some hardware does not support switchport mode, and can only be used as a router port. Check your documentation if you don't know the difference between a router port and a switch port.
  • Step 4 - Only use this step if you used step 3 above. Enter "switchport access vlan X" where X is the VLAN ID of the VLAN you want the port to be a member of.
  • Step 5 - Only use this step if you used step 3 above. Enter "switchport mode access" to tell the port that you want it to be used as an access port.
  • Step 6 - Exit configuration mode by entering "end".
  • Step 7 - Save your configuration to memory by entering "wr mem" and to the network if you have need using "wr net". You may have to supply additional information to write configurations to the network depending on your device configuration.
For trunk ports
  • Step 1 - Enter "Interface " where is the name Cisco has assigned the interface you would like to associate with the VLAN.
  • Step 2 - This step is optional. Enter "description " where is text describing the system connected to the interface in question. It is usually helpful to provide DNS hostname, IP Address, which port on the remote system is connected, and its function.
  • Step 3 - This step depends on your equipment and IOS version, and requirements. Enter "switchport" if you need the interface to act as a switch port. Some hardware does not support switchport mode, and can only be used as a router port. Check your documentation if you don't know the difference between a router port and a switch port.
  • Step 4 - Only use this step if you used step 3 above. Enter "switchport trunk encapsulation dot1q". This tells the VLAN to use dot1q encapsulation for the VLAN, which is the industry standard encapsulation for trunking. There are other encapsulation options, but your equipment may not operate with non Cisco equipment if you use them.
  • Step 5 - Only use this step if you used step 3 above. Enter "switchport trunk allowed vlan XX, YY, ZZ" where XX, YY, and ZZ are VLANs you want the trunk to include. You can define one or more VLANs to be allowed in the trunk.
  • Step 6 - Only use this step if you used step 3 above. Enter "switchport mode trunk" to tell the port to operate as a VLAN trunk, and not as an access port.
  • Step 7 - Exit configuration mode by entering "end".
  • Step 8 - Save your configuration to memory by entering "wr mem" and to the network if you have need using "wr net". You may have to supply additional information to write configurations to the network depending on your device configuration.
For private VLAN ports
  • Step 1 - Enter "Interface " where is the name Cisco has assigned the interface you would like to associate with the VLAN.
  • Step 2 - This step is optional. Enter "description " where is text describing the system connected to the interface in question. It is usually helpful to provide DNS hostname, IP Address, which port on the remote system is connected, and its function.
  • Step 3 - This step depends on your equipment and IOS version, and requirements. Enter "switchport" if you need the interface to act as a switch port. Some hardware does not support switchport mode, and can only be used as a router port. Check your documentation if you don't know the difference between a router port and a switch port.
  • Step 4 - Enter "switchport private-vlan host association XX YY" where XX is the primary VLAN you want to assign, YY is the secondary VLAN you want to associate with it.
  • Step 5 - Enter "switchport mode private-vlan host" to force the port to operate as a private-vlan in host mode.
  • Step 6 - Exit configuration mode by entering "end".
  • Step 7 - Save your configuration to memory by entering "wr mem" and to the network if you have need using "wr net". You may have to supply additional information to write configurations to the network depending on your device configuration.

You should now have your VLAN properly implemented on a Cisco IOS device.

HP VLAN terminology

HP's Procurve line of switchgear is becoming more and more prevalent in enterprise and other business environments. Because of this, it isn't uncommon to have to get Cisco and Procurve hardware to integrate, and because of terminology this can be a challenge. Below some of the VLAN terminology is defined so there is less opportunity for confusion.

  • VLAN ID - Fortunately, VLAN id's are pretty much the same everywhere, the only significant differences are the range of IDs that can be used. With Procurve devices, the number of VLANs is defined in the configuration. The default maximum VLANs supported on a Procurve device differs between models and firmware revisions, but is commonly set to 8. Newer Procurve hardware supports 4,096 VLAN ids, but only 256 concurrently defined VLANs on a single device. VLAN ID 1 is reserved for the "DEFAULT_VLAN" or the default administrative VLAN.
  • VLAN names - VLAN names are text fields that assist technicians to identify VLANs. Procurve allows names up to 32 characters, but if you want it to properly display in menu configuration mode, you should probably limit the name to 12 characters.
  • VLAN modes - Procurve has three modes of operation for VLANs on the chassis, Untagged, Tagged, and No. Untagged mode is cisco's access mode. This mode is used for ports that connect to end nodes, or devices that will not be passing VLAN traffic forward. Tagged mode is the same as Cisco's trunk mode. This mode is used for ports that are connecting to devices that will be passing VLAN traffic forward, or for trunking multiple VLANs. No mode means that the port in question has no association whatsoever with that VLAN.
  • Special note on "trunk" - Lots of confusion surrounds the word "trunk" when you go between vendor equipment. In Cisco's case, trunking is only used with VLANs. If you want to group multiple ethernet ports into a single logical ethernet group, they call it a channel-group. This is regardless of whether FEC or LACP is used for the channel properties. Procurve uses "trunk" to define a group of ethernet ports when using the HP trunking protocol, and the term "Tagged" for what Cisco calls a VLAN trunk. Of course, these two technologies have nothing to do with each other, but because of naming conventions, confusion arises.

HP Procurve VLAN implementations

VLAN Definition

Most modern Procurve switches enable VLAN use by default, but if, for some reason, you have an older model, log into the switch, get into manager mode, go to the switch configuration menu (usually item 2), then the VLAN menu (usually item 8), then the VLAN support item (usually item 1), and make sure VLANs are enabled. If you change this setting, you will need to reboot the switch to get it to activate properly. The configuration menu is useful for these kinds of activities, troubleshooting, and other things, but is a little more difficult for configuring multiple switches or for using configuration templates, so the rest of the HP Procurve configuration details will be provided for the console configuration mode. Aside for enabling VLAN support as a whole, VLAN definitions and configuration are created in the same place, so the rest of the configuration examples will be provided under the VLAN configuration topic.

VLAN Configuration

Configuring VLANs on a modern Procurve is pretty simple, you must first define the VLAN, set its properties, and then set up membership for ports and the VLAN mode they will support. The following list should help you accomplish these tasks. NOTE: HP has defined its interface ports by using a module/port convention. If you have a non-modular chassis (such as the 3448cl) then ports are numbered only using numbers, such as 1 or 36. If the chassis is modular (such as the 5308) then the ports number is prepended with the module slot, such as A1 or H6. No reference to the type of switch port (ethernet, fast ethernet, gigabit ethernet) is used for port reference.

  • Step 1 - Log into the switch and get into manager mode. If, after logging in, you are in the configuration menu, exit the configuration menu by selecting item 5 (in most cases) or by using the arrow keys on your keyboard to highlight the "Command Line (CLI)" item.
  • Step 2 - Enter "conf t" to get into terminal configuration mode.
  • Step 3 - Enter "vlan X" where X is the VLAN id of the VLAN you would like to create.
  • Step 4 - Name your VLAN by entering "name """ where is a text string from 1 to 32 characters (12 characters if you care about the configuration menu display). You should use quotes when naming the VLAN.
  • Step 5 - Give the VLAN an IP address by entering "ip address " where is the IP address you want to assign this switch in that subnet, and is the network mask for the subnet assigned.
  • Step 6 - This step is optional. If you want to assign some end node ports to the VLAN enter "untagged " where is a list of ports either comma delimited if they are non-sequential, or using a dash between list beginning and end if they are. An example of this is "untagged 1,3,5,7-16". This would configure ports 1, 3, 5, and 7 through 16 to be untagged on that VLAN.
  • Step 7 - This step is optional. If you want to assign some VLAN trunk ports to the VLAN enter "tagged " where is a list of ports either comma delimited if they are non-sequential, or using a dash between list beginning and end if they are. An example of this is "untagged 1,3,5,7-16". This would configure ports 1, 3, 5, and 7 through 16 to be untagged on that VLAN.
  • Step 8 - Enter "exit" to leave VLAN configuration mode.
  • Step 9 - Exit configuration mode by entering "exit" again.
  • Step 10 - Save your configuration by entering "wr memory".

You have now successfully configured your HP Procurve VLAN.

Vendor Summary

If you are going to integrate Cisco and HP Procurve hardware on the same network, and you intend to use VLANs there are only a few things you need to remember:

  • For end nodes - Cisco uses "mode access", HP uses "untagged" mode.
  • For VLAN dot1q trunks - Cisco uses "mode trunk", HP uses "tagged" mode.
  • For no VLAN association - Cisco uses no notation at all, HP uses "no" mode in the configuration menu, or you have VLAN support turned off.

Next time you have to integrate the two with VLANs, this simple list should help keep you out of trouble.


Source: http://www.tech-faq.com/vlan.shtml

Jumat, 02 Mei 2008

Mengatasi postfix/postdrop[xxxxx]: warning: unable to look up public/pickup: Permission denied

Hari ini ada masalah di smtp2 sbb:

root@proxy02-smg [/var/spool/postfix]# tail -f /var/log/maillog
May 2 21:52:31 proxy02-smg postfix/postdrop[30924]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:31 proxy02-smg postfix/postdrop[31054]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:33 proxy02-smg postfix/postdrop[31410]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:34 proxy02-smg postfix/postdrop[31091]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:34 proxy02-smg postfix/postdrop[31062]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:34 proxy02-smg postfix/postdrop[31245]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:34 proxy02-smg postfix/postdrop[31255]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:34 proxy02-smg postfix/postdrop[31391]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:34 proxy02-smg postfix/postdrop[31087]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:35 proxy02-smg postfix/postdrop[31094]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:37 proxy02-smg postfix/postdrop[31056]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:37 proxy02-smg postfix/postdrop[31408]: warning: unable to look up public/pickup: Permission denied
May 2 21:52:38 proxy02-smg postfix/postdrop[31257]: warning: unable to look up public/pickup: Permission denied

Dari googling petunjuk yang didapat adalah

root@proxy02-smg [~]# postfix check
root@proxy02-smg [~]# chgrp -R postdrop /var/spool/postfix/public/
root@proxy02-smg [~]# chgrp -R postdrop /var/spool/postfix/maildrop/
root@proxy02-smg [~]# postfix check

lalu restart service-servicenya

root@proxy02-smg [~]# /etc/init.d/postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
root@proxy02-smg [~]# /etc/init.d/clamsmtpd restart
Stopping ClamSmtpd: [ OK ]
Starting ClamSmtpd: [ OK ]
root@proxy02-smg [~]# /etc/init.d/clamd restart
Stopping Clam AV daemon: [ OK ]
Starting Clam AV daemon: [ OK ]

Hasilnya smtp postfix telah berfungsi kembali :

root@proxy02-smg [/etc/postfix]# tail -f /var/log/maillog
May 2 22:57:23 proxy02-smg postfix/smtpd[6874]: connect from unknown[119.82.240.211]
May 2 22:57:34 proxy02-smg postfix/smtpd[6874]: E7C9C20E997: client=unknown[119.82.240.211]
May 2 22:57:35 proxy02-smg postfix/cleanup[6877]: E7C9C20E997: message-id=<481b39d3.20809@datautama.net.id>
May 2 22:57:35 proxy02-smg postfix/qmgr[6573]: E7C9C20E997: from=, size=814, nrcpt=1 (queue active)
May 2 22:57:35 proxy02-smg spamd[5755]: spamd: connection from localhost [127.0.0.1] at port 56882
May 2 22:57:35 proxy02-smg spamd[5755]: spamd: setuid to spamfilter succeeded
May 2 22:57:35 proxy02-smg spamd[5755]: spamd: processing message <481b39d3.20809@datautama.net.id> for spamfilter:503
May 2 22:57:36 proxy02-smg postfix/smtpd[6874]: disconnect from unknown[119.82.240.211]
May 2 22:57:40 proxy02-smg spamd[5755]: spamd: clean message (0.0/5.0) for spamfilter:503 in 4.5 seconds, 789 bytes.
May 2 22:57:40 proxy02-smg spamd[5755]: spamd: result: . 0 - scantime=4.5,size=789,user=spamfilter,uid=503,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=56882,mid=<481b39d3.20809@datautama.net.id>,autolearn=ham
May 2 22:57:40 proxy02-smg spamd[5692]: prefork: child states: II
May 2 22:57:40 proxy02-smg postfix/pickup[6572]: 490ED20E9E7: uid=503 from=
May 2 22:57:40 proxy02-smg postfix/cleanup[6877]: 490ED20E9E7: message-id=<481b39d3.20809@datautama.net.id>
May 2 22:57:40 proxy02-smg postfix/pipe[6878]: E7C9C20E997: to=, relay=spamfilter, delay=17, status=sent (smtp2.datautama.net.id)
May 2 22:57:40 proxy02-smg postfix/qmgr[6573]: E7C9C20E997: removed
May 2 22:57:40 proxy02-smg postfix/qmgr[6573]: 490ED20E9E7: from=, size=1125, nrcpt=1 (queue active)
May 2 22:57:40 proxy02-smg clamsmtpd: 100007: accepted connection from: 127.0.0.1
May 2 22:57:40 proxy02-smg postfix/smtpd[6884]: connect from localhost[127.0.0.1]
May 2 22:57:40 proxy02-smg postfix/smtpd[6884]: 5983820E997: client=localhost[127.0.0.1]
May 2 22:57:40 proxy02-smg postfix/cleanup[6877]: 5983820E997: message-id=<481b39d3.20809@datautama.net.id>
May 2 22:57:40 proxy02-smg postfix/qmgr[6573]: 5983820E997: from=, size=1370, nrcpt=1 (queue active)
May 2 22:57:40 proxy02-smg clamsmtpd: 100007: from=harijanto@datautama.net.id, to=harijantopribadi2001@yahoo.com, status=CLEAN
May 2 22:57:40 proxy02-smg postfix/smtp[6882]: 490ED20E9E7: to=, relay=127.0.0.1[127.0.0.1], delay=0, status=sent (250 Ok: queued as 5983820E997)
May 2 22:57:40 proxy02-smg postfix/smtpd[6884]: disconnect from localhost[127.0.0.1]
May 2 22:57:40 proxy02-smg postfix/qmgr[6573]: 490ED20E9E7: removed
May 2 22:58:23 proxy02-smg postfix/smtp[6886]: 5983820E997: to=, relay=d.mx.mail.yahoo.com[66.196.82.7], delay=43, status=sent (250 ok dirdel)
May 2 22:58:23 proxy02-smg postfix/qmgr[6573]: 5983820E997: removed

Kamis, 01 Mei 2008

Configuring Postfix to act as a backup MX server

Configuring Postfix to act as a backup MX server

Tags:

If you’re running your own mailserver for receiving e-mail, you probably want some kind of redundancy when it goes down so you don’t lose any mail. The solution to this is to configure several backup mail exchanger (or MX) servers. Postfix is a popular replacement for the classic *NIX sendmail program that, along with being a primary mail exchanger, can be configured to act as a secondary, backup MX.

Changes to Postfix’s main.cf

Postfix first needs to be allowed to work as a MX backup server, which can be done in addition to being a primary mail server for some other domain. This is done through configuring smtpdrecipientrestrictions in Postfix’s main.cf configuration file (usually located in /etc/postfix/). Add permitmxbackup to the list of restrictions. For example:

smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination permit_mx_backup

Next, the domains to act as a backup. These are added to the relay_domains option. For example:

relay_domains = $mydestination domain1.com domain2.net domain3.org

Now that postfix knows to accept mail destined for these domains, it needs to know what to do with it. Postfix’s transport maps feature can be used to specify to send mail back to the main mailserver. In main.cf, add a transport_maps configuration option, pointing to a database supported by Postfix (such as hashes), like so:

transport_maps = hash:/etc/postfix/transport

Postfix will then look to this file for any information on delivering the e-mail from domains specified in this file.

Setting up Postfix transports file

Assuming you are using Postfix’s hash database format, create a new file transport (in /etc/postfix/ if following the example above). This file is a space-separated list of domains and how to deliver mail for them. For example:

domain1.com smtp:mail.domain1.com
domain2.net smtp:mail.domain2.net
domain3.org smtp:mail.domain3.org

This tells Postfix to send mail destined for domain1.com, domain2.net, and domain3.org via SMTP to mail.domain1.com, mail.domain2.net, and mail.domain3.org respectively.

After adding the above, a binary database that Postfix will actually use needs to be created. This can be made by running;

postmap transport

in the directory the file transport resides.

After doing all this, you’ll now have a backup MX server for your main mail server. If your main mail server goes down, mail will then get sent to this backup MX server and queued up for eventually delivery back to your main mail server when it comes back online.


Source : http://samat.org/node/configuring_postfix_to_act_as_a_backup_mx_server