CCTV

Rabu, 17 Oktober 2012

Setting Jaringan di Linux


Linux mempunyai keunggulan di bidang jaringan, karena selain bisa menjadi client juga bisa menjadi server pada saat yang bersamaan. Hal ini sangat membantu, terutama bagi para programmer dan webmaster yang membutuhkan penggunaan server. Terutama bagi mereka yang menggunakan apache, cgi dan php.
Selain itu Linux juga memiliki kelebihan untuk bisa berhubungan dengan sistem operasi lainny, seperti: Windows 9.x, Windows ME, Windows 2000, Windows XP, Mac OS, Amiga, Atari, Sun, dan keluarga Unix lainnya.
Segala kelebihan tersebut di atas tentunya akan sia-sia jika kita tidak bisa menghubungkan komputer Linux kita dengan jaringan komputer lainnya. Untuk itu, ini akan memberikan sedikit tips untuk menghubungkan komputer Linux kita dengan jaringan komputer lainnya.
I. Setting jaringan dengan metoda konvensional, dengan alasan : (Kresno Aji )
• Setting jaringan pada setiap distribusi berbeda antara satu dan lainnya.
• Agar kita tidak menjadi manja dan menjadi bodoh dengan setting konfigurasi yang serba otomatis, sebagaimana sistem operasi lain :) .
• artikel ini menggunakan SuSE Linux 7.0
Gambar 1. Jaringan Multiplatform
Setting Jaringan Dasar
Setting jaringan dasar merupakan langkah awal kita dalam rangka menghubungkan diri dengan komputer tetangga :) . Adapun langkahnya adalah sebagai berikut:
Setting Kartu Jaringan
1. Pastikan komputer anda telah terpasang kartu jaringan, saat ini di pasaran telah beredar banyak sekali macam & jenis kartu jaringan. Untuk mudahnya, usahakan memilih kartu jaringan yang banyak dipakai, misalnya kompatibel ne2000 pci dengan kecepatan standard 10/100M.
2. Anda juga bisa menggunakan kartu jaringan lama, versiISA atau ISA Plug&Play, pastikan anda mengetahui alamat yang digunakan, bisa melalui disket bawaan, kemudian anda mencatatnya untuk diinstalasi di sistem Linux.
3. Pastikan kernel mengenali kartu jaringan anda, dengan mengetikkan perintah:
4. putr@bric.net:~ $> dmesg
5. ——— dipotong ———–
6. Serial driver version 4.27 with HUB-6 MANY_PORTS MULTIPORT SHARE_IRQ enabled
7. ttyS00 at 0x03f8 (irq = 4) is a 16550A
8. ttyS01 at 0x02f8 (irq = 3) is a 16550A
9. 3Com 3c90x Version 1.0.0 1999 (20:28:04)
10. enable_irq() unbalanced from c4024510
11. Installing knfsd (copyright (C) 1996 okir@monad.swb.de)
12. nfsd_fh_init : initialized fhcache, entries=512
atau dengan cara ketikkan perintah:
root@bric:/home/bric $> ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:DA:C8:A6:5A
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:609275 errors:0 dropped:0 overruns:0 frame:0
TX packets:397967 errors:38 dropped:0 overruns:0 carrier:39
collisions:0 txqueuelen:100
Interrupt:11 Base address:0xd800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:99 errors:0 dropped:0 overruns:0 frame:0
TX packets:99 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
Pada dasarnya, hampir semua distro Linux sudah mengaktifkan modul kernel untuk pengenalan kartu jaringan.
13. Jika ternyata kernel belum mengenali kartu jaringan anda, yang ditunjukkan dengan menampilkan “lo” tanpa eth0. Anda bisa mengaktifkannya dengan membuka /etc/rc.d/rc.modules.
14. Jika anda tidak dapat menemukan /etc/rc.d/rc.modules., anda bisa mencarinya di /lib/modules/net atau di /etc/conf.modules untuk melihat konfigurasi modul-modul yang aktif. Sebagaimana modul kartu jaringan di /lib/modules/net berikut ini:
15. putr@bric:/lib/modules/2.2.18/net $> ls
16. 3c501.o comx-proto-lapb.o hp100.o sb1000.o
17. 3c503.o comx-proto-ppp.o ibmtr.o sbni.o
18. 3c505.o comx.o ipddp.o scc.o
19. 3c507.o cops.o ircomm.o sdla.o
20. 3c509.o cosa.o irda.o sdladrv.o
21. 3c515.o cs89x0.o irda_deflate.o sealevel.o
22. 3c59x.o de4x5.o irlan.o shaper.o
23. 3c90x.o de600.o lance.o sis900.o
24. 6pack.o de620.o lanstreamer.o sk98lin.o
25. 8139too.o depca.o lapbether.o skfp.o
26. 82596.o dgrs.o lne390.o sktr.o
27. 8390.o dlci.o ltpc.o slhc.o
28. ac3200.o dmascc.o mkiss.o slip.o
29. acenic.o dmfe.o n2.o smc-ultra.o
30. arc-rimi.o dummy.o ne.o smc-ultra32.o
31. arcnet.o e100.o ne2k-pci.o smc9194.o
32. arlan-proc.o e1000.o ne3210.o soundmodem.o
33. arlan.o e2100.o ni5010.o starfire.o
34. at1700.o eepro.o ni52.o strip.o
35. baycom_epp.o eepro100.o ni65.o syncppp.o
36. baycom_par.o eexpress.o old_tulip.o tlan.o
37. baycom_ser_fdx.o epic100.o olympic.o tulip.o
38. baycom_ser_hdx.o eql.o pc300.o via-rhine.o
39. bonding.o es3210.o pci-scan.o wanpipe.o
40. bpqether.o eth16i.o pcnet32.o wanxl.o
41. bsd_comp.o ethertap.o plip.o wavelan.o
42. c101.o ewrk3.o ppp.o wd.o
43. com20020.o fmv18x.o ppp_deflate.o x25_asy.o
44. com90io.o hamachi.o ppp_mppe.o yam.o
45. com90xx.o hdlc.o pppox.o yellowfin.o
46. comx-hw-comx.o hdlcdrv.o rcpci.o z85230.o
47. comx-hw-locomx.o hostess_sv11.o rl100a.o
48. comx-hw-mixcom.o hp-plus.o rrunner.o
49. comx-proto-fr.o hp.o rtl8139.o
50. Kemudian untuk mengaktifkannya, anda bisa mengetikkan perintah:
root@bric:~ $> modprobe ne2k-pci
51. Untuk menyertakannya ke dalam modul, sehingga setiap saat bisa dijalankan secara otomatis pada saat start komputer, sertakan ke dalam file conf.modules. Misalnya sebagaimana contoh di bawah ini:
52. putr@bric:/etc $> more conf.modules
53. #
54. # Copyright (c) 1996-2000 SuSE GmbH Nuernberg, Germany. All rights reserved.
55. #
56. # Author: Hubert Mantel , 1996-2000
57. #
58. # Configuration file for loadable modules; used by modprobe and kerneld#
59. # Aliases – specify your hardware
60. alias eth1 off
61. alias tr0 off
62. alias scsi_hostadapter off
63. alias fb0 off
64. # only used for Mylex or Compaq Raid as module
65. alias block-major-48 off
66. alias block-major-49 off
67. alias block-major-72 off
68. alias block-major-73 off
69. # only needed for fifth and sixth IDE adaptor
70. alias block-major-56 off
71. alias block-major-57 off
72. # mouse (for older busmice)
73. alias char-major-10 off
74. alias parport_lowlevel parport_pc
75. options parport_pc io=0×378 irq=none,none
76. ;
77. ————dipotong—————
78. ;
79. # post-install paride insmod frpw
80. # YaST2: Network card
81. alias eth0 ne2k-pci
Mengaktifkan Alamat IP Ethernet
Langkah selanjutnya, adalah mengaktifkan alamat IP ethernet, sehingga komputer kita bisa dikenal oleh server & komputer lain pada jaringan. Untuk mengaktifkan alamat IP ethernet, anda bisa mengetikkan perintah di bawah ini:
root@bric:~ $> ifconfig eth0 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0
Untuk mengaktifkan konfigurasi alamat IP eth baru kita, jalankan script /etc/rc.d/init.d/network dengan option ‘restart’, seperti di bawah ini:
root@bric:~ $> /etc/rc.d/init.d/network restart
Agar alamat ip komputer kita bisa berjalan secara otomatis, maka perintah ifconfig tsb. di atas perlu dimasukkan kedalam skrip khusus. Untuk beberapa distribusi bisa dimasukkan kedalam rc.local. Sedangkan distro SuSE terdapat dalam file /etc/rc.config. Adapun contohnya adalah seperti berikut ini:
#
# IP Adresses
#
IPADDR_0=”192.168.1.1″
IPADDR_1=”"
IPADDR_2=”"
IPADDR_3=”"
#
# network device names (e.g. “eth0″)
#
NETDEV_0=”eth0″
NETDEV_1=”"
NETDEV_2=”"
NETDEV_3=”"
#
# parameteres for ifconfig, simply enter “bootp” or “dhcpclient” to use the
# respective service for configuration
# sample entry for ethernet:
# IFCONFIG_0=”192.168.81.38 broadcast 192.168.81.63 netmask 255.255.255.224″
#
IFCONFIG_0=”192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0″
IFCONFIG_1=”"
IFCONFIG_2=”"
IFCONFIG_3=”"
Sampai di sini selesailah sudah setting jaringan Linux tahap awal, jika anda menghendaki mempunyai virtual domain sendiri yang dikenal oleh komputer lain,masuk ke tahap server DNS.
Setting Server DNS
DNS merupakan singkatan dari Domain Name Server, merupakan sebuah database yang berisi daftar seluruh nama komputer yang terhubung ke jaringan lokal (intranet).
Gambarannya, jika anda mempunyai jaringan komputer yang berisi 5 pc yang terhubung ke komputer server, dan anda ingin menghubungi server melalui browser secara intranet (lokal) ke alamat http://server.net, pc anda akan mencarinya dulu di /etc/resolc.conf untuk mencari nama komputer server. Setelah terhubung, name server akan meneruskan ke database root, jika ketemu maka server akan merespon balik, dengan memberikan informasi mesin yang menggunakan nama server.net ke pc anda
Untuk membuat sebuah server DNS, pertama kali anda harus menginstalasi bind versi 8.2.x, dengan perintah:
rpm -ivh bind8-8.2.3-36.rpm
Setelah terinstalasi, sekarang silakan anda mengedit file /etc/resolv.conf, isinya seperti berikut ini:
search .
domain nama.isp.anda
domain server.net
nameserver 202.x.x.x
nameserver 192.168.1.1
Kemudian silakan edit file /etc/named.conf, isinya seperti berikut ini:
/* sample configuration file for BIND 8.1 or later
* should be installed as /etc/named.conf
*
* Author: Florian La Roche
*/
#
# overall options of the server
#
options {
directory “/var/named”;
# the default is to fail, if the master file is not correct
check-names master warn;
pid-file “/var/run/named.pid”;
datasize default;
stacksize default;
coresize default;
files unlimited;
recursion yes;
multiple-cnames no; // if yes, then a name my have more
// than one CNAME RR. This use
// is non-standard and is not
// recommended, but it is available
// because previous releases supported
// it and it was used by large sites
// for load balancing.
# the default is to ask the forwarders and if they fail
# try to find the answer yourself, this will only ask the forwarders
#forward only;
# list of DNS servers to ask
#forwarders {
# 192.168.1.1;
# 192.168.1.2;
# 192.168.1.3;
#};
# the default is to listen on port 53 on all available interfaces
# you can also give a detailed list:
#listen-on { 5.6.7.8; };
#listen-on port 1234 { !1.2.3.4; 1.2/16; };
};
#
# do not be verbose about these problems…
#
#logging {
# category lame-servers { null; };
# category cname { null; };
#};
#
# predefined access control lists (acl):
# “any” allows all hosts
# “none” denies all hosts
# “localhost” allows the IP adresses of all interfaces of the system
# “localnets” allows any host on a network of the local interfaces
#
# defining an additional ACL:
#acl can_download { 192.168.0.17; 192.168.0.18; };
#
# The server statement defines the characteristics to be associated with
# a remote name server.
#
# Marking a server as bogus will prevent queries to that server.
#server 192.168.0.128 { bogus yes; }
# If the other name server has also BIND 8.1 or newer installed, you
# can allow compacter zone transfers with this statement.
#server 192.168.0.128 { transfer-format many-answers; }
zone “.” IN {
type hint;
file “root.hint”;
};
zone “localhost” IN {
type master;
file “localhost.zone”;
check-names fail;
allow-update { none; };
};
zone “0.0.127.in-addr.arpa” IN {
type master;
file “127.0.0.zone”;
check-names fail;
allow-update { none; };
};
#
# a master zone
#
#zone “isc.org” IN {
# type master;
# file “isc.org”;
# # by default, any host can receive zone transfers
# #allow-transfer { any; };
# notify yes;
#};
#
# a slave zone
#
#zone “isc.org” IN {
# type slave;
# file “slave/db.isc.org”;
# masters { 192.168.0.128; };
#};
Kemudian, sisipkan perintah berikut ini:
forwarders { x.x.x.x; y.y.y.y; };,
Dimana:
x: merupakan server utama, dan
y: merupakan server kedua
Pada contoh di atas, kalimat forwarders, sudah tersedia. Anda tinggal menghilangkan tanda # dan mengubah nomor ip sesuai dengan komputer anda.
Untuk memastikan server DNS berjalan pada saat komputer dinyalakan, ketikkan perintah berikut:
root@bric:~ $> chkconfig named on
Kemudian jalankan server DNS, dengan mengetikkan perintah:
/etc/rc.d/init.d/named start
Agar komputer anda dikenal nama doamin-nya oleh server dan sebaliknya isikan nama domain komputer anda pada server atau nama domain server pada komputer anda ke dalam file /etc/hosts, seperti tampak pada contoh di bawah ini:
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# “named” name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
# special IPv6 addresses
127.0.0.1 localhost
192.168.1.2 masaji.net masaji
192.168.1.1 server.net server
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
Sampai di sini pc anda sudah bisa berhubungan ke server dan sebaliknya

0 komentar:

Posting Komentar