Monday, July 25, 2005

Bikin VLAN di Linux

# VLAN installation & Configuration on the Linux Side.


I have:

* Linux kernel 2.2.14
* Vlan 0.0.10 Patched into it
* Cisco Catalyst 2900XL
* 3Com 3C509B NIC using patched driver 3c59x


Currently VLAN is not part of the kernel distribution so you need to patch
it into a supported Linux kernel and re-compile.

You need the kernel source. If you don't have it already, you can get from
ftp.kernel.org or from one of its mirrors. If this scares you, read the
KERNEL-HOWTO.

It is assumed that you have the linux kernel source extracted, and found at:
$HOME/linux If your setup is different, then some of these commands may
need to be slightly different.

Download the VLAN package from the vlan homepage and extract it's contents.
tar -xvzf vlan*.tar.gz

Go to the vlan directory, build the vlan tools by just typing:
make

After this you get a programm named . This program manages all VLAN
specific configurations.

Now patch the kernel.
Go to the linux directory
cd linux
(if you installed the kernel source from some rpm based distribution it is
something like /usr/src/linux)
patch the kernel by typing:

patch -p 1 < $HOME/vlan/vlan.patch (patch is in the vlan directory)

Time to compile your kernel. Use the make menuconfig command in your
linux directory to select your kernel options. The option related to
802.1Q VLANs is found under the Networking options.

Additional help for kernel compilation can be found in KERNEL-HOWTO

Assuming your kernel compiled cleanly, you are now ready to use it.
Install your kernel in the normal manner (fix up your /etc/lilo.conf file
appropriately and run lilo as root.)
Reboot your computer and choose your new kernel.

As your computer comes back to life, there will be little sign that you are
now 802.1Q capable.
You should see something like this:

802.1Q VLAN Support v0.10 Ben Greear
vlan Initialization complete.


Your system is now vlan ready, lets configure some vlans:
I'm assuming that your VLAN capable network card is eth0.

First, set the eth0 state to down:

ifconfig eth0 down

Ben's Note: Regarding the next section, you can run plain ethernet and VLAN over the same NIC, but you may not want to..

Whatever your previous netconf was, you should move everything to vlans.
This means, that you don't set ip address to the real interface, but set it to
vlan interface. To set your eth0 with no ip:

ifconfig eth0 0.0.0.0 up

!note!
YOU MUST SET THE ETH0 TO UP, or it wont work. (ifconfig eth0 up)

Add some vlans; goto your vlan directory where you previously compiled
vconfig and type:

vconfig add eth0 2

! Little note about VLAN 1. In Cisco systems it is the default VLAN
so you MUST start using vlans from 2.

This will create device vlan0002 to your system. Linux will think, that it
is just another network device, so you can configure it like any other. Also
you should see the interface by typing

ifconfig -a

Lets make some conf on the vlan then:
ifconfig -i vlan0002 10.0.231.1 broadcast 10.0.231.0 netmask 255.255.255.0 up

This ends the configuration at the linux side.

# Specific Extreme Networks Configuration

From: Craig Metz: cmetz@inner.net

Extreme configuration example:

create vlan v42
config vlan v42 tag 42
config vlan v42 add port 10 tagged

... will create a vlan named v42, whose 802.1Q tag is 42, and connect port
10 (tag 42) to that vlan.

Cisco-specific configuration

Cisco Conf
configure the port you want to use as the trunk:

telnet switch or use the console port

ena
(will prompt for password, so have it ready)

conf t
interface FastEthernet0/24 (it doesnt have to be 0/24)
duplex full
speed 100
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 2
switchport mode trunk


This conf will do the following:

Set the port to full duplex mode; force the port to 100Mb mode; set the port
vlan encapsulation to support 802.1Q; tell the
switch that the port is allowed to run vlans through (even if you set just
VLAN 2, cisco will automatically add VLAN 1 and VLAN 1002-1005) to the port
and set the port to trunk mode aswell. Trunk mode tells the switch that
a number of VLANS can go through it.

Last line is usually the mother of all screw-ups. If you forget that, you
won't get your VLAN working. Simple as that.

Now configure some other port to be used as the destination for the vlan:

conf t
interface FastEthernet0/1
duplex half
speed 10
switchport access vlan 2
end

Here we tell the switch to force the port 1 to half duplex 10Mb mode (normal
10 Mb NIC) and only traffic from interface VLAN 2 can go through this port.
also you can use a number of ports with VLAN 2, like a HUB ;)

You should now connect some other device to port 1.

Let it have an ip of eg. 10.0.231.2 mask 255.255.255.0

Ping linux from it

ping 10.0.231.1

If it replies scream: "YESS!!" This means, that VLAN is working.

Hard truth: It's not over, till its over.
if this works, then you are out of the woods, if not, well I hear that
tcpdump is a good tool ;-) and tcpdump that came with the vlan package even
better tool. (if you want to dump, use the one that came with vlan package)

NOTE: Ethereal also supports VLANs, and is much more beautiful than tcpdump, if you have GUI capabilities.

If you can ping the linux and from linux the host, you should try the
following at linux side:

ping -s 1476 10.0.231.2

If there is no reply, there is something foggy with the NIC. and you
should start debugging. If ping -s 100 10.0.231.2 works, then it is most likely
an MTU problem with your NIC/Driver.
Cisco-specific configuration

Cisco Conf
configure the port you want to use as the trunk:

telnet switch or use the console port

ena
(will prompt for password, so have it ready)

conf t
interface FastEthernet0/24 (it doesnt have to be 0/24)
duplex full
speed 100
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 2
switchport mode trunk


This conf will do the following:

Set the port to full duplex mode; force the port to 100Mb mode; set the port
vlan encapsulation to support 802.1Q; tell the
switch that the port is allowed to run vlans through (even if you set just
VLAN 2, cisco will automatically add VLAN 1 and VLAN 1002-1005) to the port
and set the port to trunk mode aswell. Trunk mode tells the switch that
a number of VLANS can go through it.

Last line is usually the mother of all screw-ups. If you forget that, you
won't get your VLAN working. Simple as that.

Now configure some other port to be used as the destination for the vlan:

conf t
interface FastEthernet0/1
duplex half
speed 10
switchport access vlan 2
end

Here we tell the switch to force the port 1 to half duplex 10Mb mode (normal
10 Mb NIC) and only traffic from interface VLAN 2 can go through this port.
also you can use a number of ports with VLAN 2, like a HUB ;)

You should now connect some other device to port 1.

Let it have an ip of eg. 10.0.231.2 mask 255.255.255.0

Ping linux from it

ping 10.0.231.1

If it replies scream: "YESS!!" This means, that VLAN is working.

Hard truth: It's not over, till its over.
if this works, then you are out of the woods, if not, well I hear that
tcpdump is a good tool ;-) and tcpdump that came with the vlan package even
better tool. (if you want to dump, use the one that came with vlan package)

NOTE: Ethereal also supports VLANs, and is much more beautiful than tcpdump, if you have GUI capabilities.

If you can ping the linux and from linux the host, you should try the
following at linux side:

ping -s 1476 10.0.231.2

If there is no reply, there is something foggy with the NIC. and you
should start debugging. If ping -s 100 10.0.231.2 works, then it is most likely
an MTU problem with your NIC/Driver.

Router dengan LINUX

#############################################
Router dengan LINUX ( Fedora Core-2 )
#############################################


Note : Sebelum install mending buat netscafe dolo, idupin TV atau mp3 :P


1. Install LINUX melalui CDRoom/Ftp/DOS.
( saya gunakan Fedora Core-2 )

* Custom
* Automatic
* Remove all partition
* DHCP uncheck
* setting IP
> IP addres
gateway
DNS
* no firewell
* Development tools (check list)
install .....


2. setelah tahap install selesai, lalu isikan ip address untuk Routernya pada eth0 dan eth1.
Ok sekarang kita berasumsi mempunyai blok ip public dan local :

- untuk ip public :

Blok IP = 202.162.198.154 - 158 -----> range ip yg bisa di pakai.
Subnetmask = 255.255.255.248 -----> Netmask.
GateWay = 202.162.198.153

- Untuk Ip Local :

Blok Ip = 192.168.0.1 - 254
Subnetmask = 255.255.255.0

Sekarang kita Konfigurasi eth0 dan eth1 :

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=202.162.198.154
NETMASK=255.255.255.248
GATEWAY=202.162.198.153

# vi /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.1
NETMASK=255.255.255.0


# vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=RouterName

# /etc/init.d/network restart

# ifconfig


3. Untuk memforward paket pastikan :

# vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

# sysctl -p /etc/sysctl.conf


4. OK sekarang kita install squid versi .rpm agar lebih cepat :P
dalam hal ini saya gunakan squid-2.5.STABLE4-2.i686.rpm :

# wget http://hostname/mirror/squid-2.5.STABLE4-2.i686.rpm

# rpm -ivh squid-2.5.STABLE4-2.i686.rpm

# squid -z

# vi /etc/squid/squid.conf


#Konfigurasi untuk ip dan port squid nya.
http_port 192.168.0.1:3128

#Konfigurasi untuk cache dir.
cache_dir diskd /var/spool/squid 512 16 256

#direktory log cache.
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log none

#group dan user squid
cache_effective_user squid
cache_effective_group squid


# /etc/init.d/squid start

# ps ax|grep squid

#pastikan squid berjalan baik :
Squid -D
(squid) -D
diskd 255450 3578665 455678


# netstat -pln | grep squid

# tail -f /var/log/squid/cache.log

# ntsysv

#untuk mengaktivkan service squid :
(*) squid --> cek list


# vi /etc/wgetrc

#untuk Konfigurasi proxy :
http_proxy = http://192.168.0.1:3128/
use_proxy = on
waitretry = 10


5. Sekarang Kita Konfigurasi Iptables dan NAT untuk transparant Proxy :


# iptables -t nat -A PREROUTING -s 192.168.0.0/255.255.255.0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128

# iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -j MASQUERADE

# /etc/init.d/iptables save

# /etc/init.d/iptables restart

# iptables -t nat -nL

# reboot

Thursday, July 21, 2005

TIPS BELI CISCO 2nd

Dari Gudang Router Cisco, 081319704536.
berikut ada tips yang berguna bagi teman semua....

1.Beli murah asal berkualitas dan garansi
2.Kemudian jangan lupa , ROUTER harus pakai IOS yang
latest 12.2 atau ios nya juga bisa ip plus atau
enterprise, kalau murah biasanya pakai ios 12.0 atau
11 yang sudah expired
3.perhatikan semua log nya , karena ada yang sudah tua
sekali, kalau dijalankan untuk transfer data besar
suka crash.
4. perhatikan memory, harus cisco approved memory,

selamat berburu yang berkualitas dan murah

Tuesday, July 05, 2005

Syarat-syarat menjadi kekasih Allah

Syarat-syarat menjadi kekasih Allah

Ali Ibn Abi Talib bercerita:

Suatu hari di Masjid Nabawi Rasulullah mengajari Ibn Abbas perihal capaian-capaian dan syarat-syarat seseorang untuk menjadi kekasih Allah:

Jagalah hak dan kewajibanmu terhadap Allah, Allah akan menjagamu
Jagalah hak dan kewajibanmu terhadap Allah, Dia akan menyertai setiap langkah dan usahamu.
Jika kau meminta, mintalah kepada Allah.
Jika kau memohon pertolongan, mohonlah kepada Allah.
Ketahuilah; seandainya semua umat berkumpul untuk memberimu kebahagian, ingatlah bahwa kebahagian tidak akan pernah terwujud kecuali Allah sudah menentukan terhadap dirimu. Dan seandainya segenap manusia berusaha mencelakakanmu, hal itu tidak akan pernah terjadi kecuali Allah telah menggariskan mara bahaya itu terhadapmu.
Jagalah hak dan kewajiban terhadap Allah, Dia akan selalu berada di depanmu.
Ingatlah akan Allah pada saat kau lapang dalam kesenangan, dan Allah akan mengingatmu dalam kesedihan dan himpitan.
Ketahuilah apa yang menimpamu, bukanlah hukuman atas kesalahanmu, dan kesalahanmu belum tentu menyebabkan musibahmu..

Sesungguhnya bersama kesedihan itu ada kesenangan.
Sesungguhnya bersama kesempitan itu ada kelapangan.
Sesungguhnya bersama kesusahan itu ada kemudahan.
Sesungguhnya kesabaran akan melahirkan kemenangan.

Imam asy-Syafii berkata dalam bait-bait syairnya:

Tiada persinggahan bagi seorang insan setelah kematiannya, kecuali persinggahan yang sudah dibangunnya sebelum kematian.

Bila pondasi persinggahan itu dibangun dengan kebaikan, akan kokoh.
Jika dibangun dengan amal keburukan, akan rapuh.
Nafsu mendorong untuk mencintai dunia.
Sedangkan kebahagian adalah meninggalkan kesenangan duniawi.
Bergegaslah untuk menanam ketakwaan diri,
Maka kau akan memetik buahnya setelah kematian.

Jika semua laku seseorang, lahir maupun batin, sudah (sampai)pada purna tawajjuh-nya, maka kasih Allah akan selalu menyertainya, Allah akan menyibakkan tirai karamah (kelebihan) dan ilmu-ilmu Allah yang tersirat.

Semua itu lahir dari buah ketulusan dan keikhlasannya dalam beribadah, dan Allah mengganti ketulusan itu dengan Taufiq-Nya.

Dan bila kesalehan ritual itu disertai dengan kesalehan sosial, Allah akan menuntun pendengaran dan pengelihatan kekasih-Nya kepada hal-hal yang dicintai-NyaE


"Allah adalah pemimpin bagi orang-orang yang beriman, yang membawa mereka dari jalan kegelapan menuju jalan terang benderang.E(Q.S. 2:257)

Sumber:Hadiqah al-Awliya (Tajuddin Naufal)






===================================================================
Menuju Ahli Dzikir, Ahli Fikir, dan Ahli Ikhtiar