_____LEARN TO THE BEST INDONESIA_____
| Check Page Rank of any web site pages instantly: |
| This free page rank checking tool is powered by Page Rank Checker service |
At this time I want to discuss about what is tcp / ip and its use on the network that connects both networks to public networks and local networks.
The TCP/IP model is a description framework for computer network protocols created in the 1970s by DARPA, an agency of the United States Department of Defense. It evolved from ARPANET, which was the world's first wide area network and a predecessor of the Internet. The TCP/IP Model is sometimes called the Internet Model or the DoD Model.
The TCP/IP model, or Internet Protocol Suite, describes a set of general design guidelines and implementations of specific networking protocols to enable computers to communicate over a network. TCP/IP provides end-to-end connectivity specifying how data should be formatted, addressed, transmitted, routed and received at the destination. Protocols exist for a variety of different types of communication services between computers.
TCP/IP is generally described as having four abstraction layers (RFC 1122). This layer architecture is often compared with the seven-layer OSI Reference Model; using terms such as Internet Reference Model in analogy is however incorrect as the Internet Model is descriptive while the OSI Reference Model was intended to be prescriptive, hence Reference Model.
The TCP/IP model and related protocols are maintained by the Internet Engineering Task Force (IETF).
An early architectural document, RFC 1122, emphasizes architectural principles over layering[1].
* End-to-End Principle: This principle has evolved over time. Its original expression put the maintenance of state and overall intelligence at the edges, and assumed the Internet that connected the edges retained no state and concentrated on speed and simplicity. Real-world needs for firewalls, network address translators, web content caches and the like have forced changes in this principle.[2]
* Robustness Principle: "In general, an implementation must be conservative in its sending behavior, and liberal in its receiving behavior. That is, it must be careful to send well-formed datagrams, but must accept any datagram that it can interpret (e.g., not object to technical errors where the meaning is still clear) RFC 791." [3] "The second part of the principle is almost as important: software on other hosts may contain deficiencies that make it unwise to exploit legal but obscure protocol features. RFC 1122" [4]
Even when the layers are examined, the assorted architectural documents—there is no single architectural model such as ISO 7498, the OSI reference model—have fewer and less rigidly-defined layers than the OSI model, and thus provide an easier fit for real-world protocols. In point of fact, one frequently referenced document, RFC 1958 [5], does not contain a stack of layers. The lack of emphasis on layering is a strong difference between the IETF and OSI approaches. It only refers to the existence of the "internetworking layer" and generally to "upper layers"; this document was intended as a 1996 "snapshot" of the architecture: "The Internet and its architecture have grown in evolutionary fashion from modest beginnings, rather than from a Grand Plan. While this process of evolution is one of the main reasons for the technology's success, it nevertheless seems useful to record a snapshot of the current principles of the Internet architecture."
RFC 1122 on Host Requirements is structured in paragraphs referring to layers, but refers to many other architectural principles not emphasizing layering. It loosely defines a four-layer model, with the layers having names, not numbers, as follows:
* Application (process-to-process) Layer: This is the scope within which applications create user data and communicate this data to other processes or applications on another or the same host. The communications partners are often called peers. This is where the "higher level" protocols such as SMTP, FTP, SSH, HTTP, etc. operate.
* Transport (host-to-host) Layer: The Transport Layer constitutes the networking regime between two network hosts, either on the local network or on remote networks separated by routers. The Transport Layer provides a uniform networking interface that hides the actual topology (layout) of the underlying network connections. This is where flow-control, error-correction, and connection protocols exist, such as TCP. This layer deals with opening and maintaining connections between Internet hosts.
* Internet (internetworking) Layer: The Internet Layer has the task of exchanging datagrams across network boundaries. It is therefore also referred to as the layer that establishes internetworking, indeed, it defines and establishes the Internet. This layer defines the addressing and routing structures used for the TCP/IP protocol suite. The primary protocol in this scope is the Internet Protocol, which defines IP addresses. Its function in routing is to transport datagrams to the next IP router that has the connectivity to a network closer to the final data destination.
* Link Layer: This layer defines the networking methods with the scope of the local network link on which hosts communicate without intervening routers. This layer describes the protocols used to describe the local network topology and the interfaces needed to affect transmission of Internet Layer datagrams to next-neighbor hosts. (cf. the OSI Data Link Layer).
The Internet Protocol Suite and the layered protocol stack design were in use before the OSI model was established. Since then, the TCP/IP model has been compared with the OSI model in books and classrooms, which often results in confusion because the two models use different assumptions, including about the relative importance of strict layering.
Layers in the TCP/IP model
The layers near the top are logically closer to the user application, while those near the bottom are logically closer to the physical transmission of the data. Viewing layers as providing or consuming a service is a method of abstraction to isolate upper layer protocols from the nitty-gritty detail of transmitting bits over, for example, Ethernet and collision detection, while the lower layers avoid having to know the details of each and every application and its protocol.
This abstraction also allows upper layers to provide services that the lower layers cannot, or choose not to, provide. Again, the original OSI Reference Model was extended to include connectionless services (OSIRM CL).[6] For example, IP is not designed to be reliable and is a best effort delivery protocol. This means that all transport layer implementations must choose whether or not to provide reliability and to what degree. UDP provides data integrity (via a checksum) but does not guarantee delivery; TCP provides both data integrity and delivery guarantee (by retransmitting until the receiver acknowledges the reception of the packet).
This model lacks the formalism of the OSI reference model and associated documents, but the IETF does not use a formal model and does not consider this a limitation, as in the comment by David D. Clark, "We reject: kings, presidents and voting. We believe in: rough consensus and running code." Criticisms of this model, which have been made with respect to the OSI Reference Model, often do not consider ISO's later extensions to that model.
1. For multiaccess links with their own addressing systems (e.g. Ethernet) an address mapping protocol is needed. Such protocols can be considered to be below IP but above the existing link system. While the IETF does not use the terminology, this is a subnetwork dependent convergence facility according to an extension to the OSI model, the Internal Organization of the Network Layer (IONL) [7].
2. ICMP & IGMP operate on top of IP but do not transport data like UDP or TCP. Again, this functionality exists as layer management extensions to the OSI model, in its Management Framework (OSIRM MF) [8]
3. The SSL/TLS library operates above the transport layer (utilizes TCP) but below application protocols. Again, there was no intention, on the part of the designers of these protocols, to comply with OSI architecture.
4. The link is treated like a black box here. This is fine for discussing IP (since the whole point of IP is it will run over virtually anything). The IETF explicitly does not intend to discuss transmission systems, which is a less academic but practical alternative to the OSI Reference Model.
Tips N Trik Registry Network With Linux
Other Networktopology between
Here's a script for network configuration in the routing by using software bosson..
IP Client 1
C:>ipconfig /ip 199.168.5.2 255.255.255.0
C:>ipconfig /dg 199.168.5.1
IP Router 1
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router_1
Router_1(config)#Interface eth0
Router_1(config-if)#ip address 192.168.5.1 255.255.255.0
Router_1(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router_1(config-if)#interface s0
Router_1(config-if)#ip address 11.1.1.1 255.0.0.0
Router_1(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0, changed state to up
Router_1(config-if)#clock rate 9600
%LINK-3-UPDOWN: Interface Serial0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
Router_1(config-if)#router rip
Router_1(config-router)#network 199.168.5.0
Router_1(config-router)#network 11.0.0.0
Router_1(config-router)#end
Router_1#wr mem
Building configuration...
[OK]
IP Client 2
C:>ipconfig /ip 14.2.2.2 255.0.0.0
C:>ipconfig /dg 14.2.2.1
IP Router 2
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router_2
Router_2(config)#interface eth0
Router_2(config-if)#ip address 14.2.2.1 255.0.0.0
Router_2(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router_2(config-if)#interface s1
Router_2(config-if)#ip address 192.168.2.1 255.255.255.0
Router_2(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial1, changed state to up
Router_2(config-if)#clock rate 9600
%LINK-3-UPDOWN: Interface Serial1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to down
Router_2(config-if)#router rip
Router_2(config-router)#network 14.0.0.0
Router_2(config-router)#network 192.168.2.0
Router_2(config-router)#end
Router_2#wr mem
Building configuration...
[OK]
IP Client 4
C:>ipconfig /ip 10.3.3.3 255.0.0.0
C:>ipconfig /dg 10.3.3.1
IP Router 4
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router_4
Router_4(config)#interface eth0
Router_4(config-if)#ip address 10.3.3.1 255.0.0.0
Router_4(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router_4(config-if)#interface s2
Router_4(config-if)#ip address 196.5.1.1 255.255.255.0
Router_4(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial2, changed state to up
Router_4(config-if)#clock rate 9600
%LINK-3-UPDOWN: Interface Serial2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2, changed state to down
Router_4(config-if)#router rip
Router_4(config-router)#network 10.0.0.0
Router_4(config-router)#network 196.5.1.0
Router_4(config-router)#end
Router_4#wr mem
Building configuration...
[OK]
IP Client 5
C:>ipconfig /ip 12.4.2.2 255.0.0.0
C:>ipconfig /dg 12.4.2.1
IP Router 5
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface eth 0
Router(config-if)#interface eth0
Router(config-if)#ip address 12.4.2.1 255.0.0.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router(config-if)#interface s3
Router(config-if)#ip address 13.3.3.1 255.0.0.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial3, changed state to up
Router(config-if)#clock rate 9600
%LINK-3-UPDOWN: Interface Serial3, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3, changed state to down
Router(config-if)#router rip
Router(config-router)#network 12.0.0.0
Router(config-router)#network 13.0.0.0
Router(config-router)#end
Router#wr mem
Building configuration...
[OK]
Router 3
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router_3
Router_3(config)#interface s0
Router_3(config-if)#ip address 11.1.1.2 255.0.0.0
Router_3(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0, changed state to up
Router_3(config-if)#clock rate 9600
Router_3(config-if)#interface s1
Router_3(config-if)#ip address 192.168.2.2 255.255.255.0
Router_3(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial1, changed state to up
Router_3(config-if)#clock rate 9600
Router_3(config-if)#interface s2
Router_3(config-if)#ip address 196.5.1.2 255.255.255.0
Router_3(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial2, changed state to up
Router_3(config-if)#clock rate 9600
Router_3(config-if)#interface s3
Router_3(config-if)#ip address 13.3.3.2 255.0.0.0
Router_3(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial3, changed state to up
Router_3(config-if)#clock rate 9600
Router_3(config-if)#router rip
Router_3(config-router)#network 11.0.0.0
Router_3(config-router)#network 192.168.2.0
Router_3(config-router)#network 196.5.1.0
Router_3(config-router)#network 13.0.0.0
Router_3(config-router)#end
Router_3#wr mem
Building configuration...
[OK]
Tips N Trik Registry Network With Linux
Artikel ini saya tujukan untuk siswa-siswa TKJ yang sedang berusaha mempelajari IP Tables, so pada oom hacker kelas kakap dari pada bosen bacanya mendingan bobok aja deh di rumah (peace dunkz).. ok kita langsung aja,,, 1,,, 2,,,, 3,,, Lets Go....
Bagi pengguna linux, tentunya sudah tidak asing lagi ketika mendengar iptables. Apa itu iptables? Iptables adalah suatu aplikasi yang dapat diperoleh di situs netfilter.org , iptables dapat digunakan sebagai pengaman suatu system yang terhubung ke dalam jaringan. Di bawah ini ada contoh rule-rule yang dapat digunakan untuk mini webserver / personal webserver :D. Untuk mengaplikasikan baris-baris perintah dibawah ini harap untuk disesuaikan dengan kebutuhan.
iptables -A INPUT -p udp -i eth0 --sport 53 --dport 1024:65535 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -i eth0 -p tcp -j ACCEPT
iptables -A INPUT -p all -s 124.195.30.64/28 -j ACCEPT -i eth0
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -s 124.195.30.64/28 -p tcp --dport 2223 -j ACCEPT
iptables -A INPUT -s 69.88.4.48/29 -p tcp --dport 2223 -j ACCEPT
iptables -A INPUT -p udp -m multiport --dports 53,67,68,123 -j ACCEPT
iptables -A FORWARD -m state --state INVALID -j DROP
iptables -A FORWARD -m conntrack --ctstate DNAT,SNAT -j ACCEPT
iptables -A FORWARD -t filter -o eth0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -t filter -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state INVALID -j DROP
iptables -A OUTPUT -p icmp -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -p udp -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -p udp -o eth0 --dport 53 --sport 1024:65535 -j ACCEPT
iptables -A OUTPUT -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -j ACCEPT -m state --state NEW,ESTABLISHED,RELATED -o eth0 -p tcp
# Ping of Death
iptables -N ping-of-death
iptables -A ping-of-death -m limit --limit 1/sec --limit-burst 4 -j ACCEPT
iptables -A ping-of-death -i eth0 -j LOG --log-level info --log-prefix 'ping-of-death'
iptables -A ping-of-death -j DROP
iptables -A INPUT -p icmp --icmp-type echo-request -j ping-of-death
iptables -A FORWARD -p icmp --icmp-type echo-request -j ping-of-death
# SYN
iptables -N SYN-FLOOD
iptables -A SYN-FLOOD -m limit --limit 1/s --limit-burst 4 -j RETURN
iptables -A SYN-FLOOD -i eth0 -j LOG --log-level info --log-prefix 'SYN-FLOOD'
iptables -A SYN-FLOOD -j DROP
iptables -A INPUT -p tcp --syn -j SYN-FLOOD
iptables -A FORWARD -p tcp --syn -j SYN-FLOOD
#portscan
iptables -N PORT-SCAN
iptables -A PORT-SCAN -m limit --limit 1/s --limit-burst 4 -j RETURN
iptables -A PORT-SCAN -i eth0 -j LOG --log-level info --log-prefix 'PORT-SCAN'
iptables -A PORT-SCAN -j DROP
iptables -A INPUT -p tcp --tcp-flags SYN,ACK,FIN,RST RST -j PORT-SCAN
iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -j PORT-SCAN
Tips N Trik Registry Network With Linux
Artikel ini saya tulis untuk permintaan saudara-saudara rekanan yang ingin dijelaskan tentang pembuatan transparant proxy. okey, tidak berlama-lama langsung saja saya akan bahas tentang transparant proxy..
Transparent Proxy digunakan apabila kita ingin memaksa clients dalam network untuk menggunakan proxy tanpa sepengetahuan mereka. Maksudnya semua http request dari client secara otomatis akan diarahkan ke proxy terlebih dahulu (forwarded). Keuntungan lainnya, kita tidak perlu repot untuk melakukan setting/konfigurasi browser pada masing-masing client yang mungkin berjumlah banyak.
Dalam FreeBSD kita dapat menggunakan IPFW dan SQUID untuk membuat Transparent Proxy. Contoh disini adalah transparent proxy yang berjalan pada Dial up gateway dengan menggunakan NATD dan SQUID sebagai HTTP proxy nya.
1. Menambahkan rule IPFW untuk forwarding.
Untuk mengaktifkan fungsi IPFW forward, pastikan bahwa sudah terdapat options IPFIREWALL_FORWARD pada file konfigurasi kernel. Seandainya belum ada, maka kita harus menambahkan options tersebut dan kemudian melakukan compile dan install kernel.
add 350 fwd 192.168.0.1,8080 tcp from 192.168.0.0/24 to any www
Rule diatas maksudnya, semua request http (port www) dari clients di forward/diarahkan ke port 8080 (port SQUID di 192.168.0.1). Berikut contoh IPFW rules sederhana untuk menjalankan NATD dan Transparent Proxy :
## ipfw rules
add 350 fwd 192.168.0.1,8080 tcp from 192.168.0.0/24 to any www
add 400 divert natd all from any to any via tun0
add 450 pass all from any to any via rl0
add 500 pass all from any to any via tun0
2. Edit squid.conf pada bagian HTTPD-ACCELERATOR
## HTTPD-ACCELERATOR OPTIONS
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
3. Restart Squid dan coba matikan konfigurasi browser di client.
reference:
http://www.tldp.org/HOWTO/mini/TransparentProxy-2.html
http://infofreebsd.org/article.php?sid=234&mode=thread&order=0
Tips N Trik Registry Network With Linux
Setelah Instalasi Freebsd Sebagai Gateway......Laluuuuuuuuuu
1. Installing Squid
You can install Squid using Ports but you can't play with configure options, so I'll cover the steps to install from a tarball.
You can download the Squid source from http://www.squid-cache.org. The lastest version is squid-2.4.STABLE6-src.tar.gz. Run the following commands as root.
# cd /path/to/tarball
# tar zxvf squid-2.4.STABLE6-src.tar.gz
# cd squid-2.4.STABLE6
tinggal pilih
1. #./configure --enable-kqueue \
--prefix=/usr/local/squid \
--enable-storeio=diskd,ufs \
--enable-ipf-transparent \
--enable-dlmalloc
2. # ./configure --enable-delay-pools --enable-ipf-transparent \
--enable-storeio=diskd,ufs --enable-storeio=diskd,ufs \
--disable-ident-lookups --enable-snmp --enable-removal-policies
# make all
# make install
2. Edit Squid Configuration File /usr/local/squid/etc/squid.conf
Bisa juga kita download configurasi squid.conf dari source yang udah kita kenal, contohnya disini aq udah punya configurasi di server ku, jdi tinggal aq download aja,...heheheeee
#cd /usr/local/squid/etc/
#mv squid.conf squid.conf.asli
#wget http://mail.uns.ac.id/~oktobrima/proxy/squid.conf
tinggal diseting ipnya sesuai ip local kita,...oke broooo
3. Create cache dir and create swap
# mkdir /usr/local/squid/cache : disesuaikan dengn squid.conf terletak pada folder mana: chown artinya mengubah kepemilikan menjadi user dan groupnya apa
# chown nobody:nogroup cache : nobody:nogroup disesuaokan dengan squid.conf pada user effectiv kalo ngak ada coba buat lagi,...oke useradd and group
#pw useradd squidi -s /usr/sbin/nologin
#pw group add squid
membuat directori cache1 2 3 sesuai di squid.conf
#mkdir /usr/cache1
#mkdir /usr/cache2
#mkdir /usr/cache3
ubah kepemikian sesuai di user efektifenya di squid.conf
#chown squidi:squid cache1
#chown squidi:squid cache3
#chown squidi:squid cache2
#chown squidi:squid *squid
#touch /usr/local/squid/var/logs/cache.log
#touch /usr/local/squid/var/logs/access.log
#chown squidi:squid access.log
#chown squidi:squid access.log
#/usr/local/squid/sbin/squid -k parse
#/usr/local/squid/sbin/squid -z
#/usr/local/squid/sbin/squid -sYDF
biar langsung masuk ke star up caranya
buat file squid.sh di
#touch /usr/local/etc/rc.d/squid.sh
#ee /usr/local/etc/rc.d/squid.sh
kasih aplikasi runing squidnya,../usr/local/squid/bin/squid -sYDF
setelh itu
#chmod 755 squid.sh
#./squid.sh
menambah divert ip agar proses browsing bisa terekam di access.log
#ipfw add 350 fwd ipwan,8080 tcp from iplocal/netmask to any www
#ipfw add 350 fwd 222.124.162.300,808 tcp from 192.168.1.1/24 to any www
kalopingin jalan sendiri ketika reboot,...masukkan di
#ee /etc/rc.firewall
met coba aja deeh,....
Tips N Trik Registry Network With Linux
Assalmmualaikum Wr. Wb
Dokumentasi ini berisi tentang bagaimana cara menginstall dan mengkonfigurasi samba server pada Linux Redhat 6.2
Server. Dokumen ini hanyalah dokumen teknis yg dibuat dengan tujuan "minimal jalan", tanpa dilengkapi dengan
security atau optimasi. So, jika ada yang salah CMIIW yaaa :) (hehehehe)
Instalasi samba dilakukan dengan cara:
# rpm -Uvh samba-2.0.6-9.i386.rpm samba-client-2.0.6-9.i386.rpm samba-common-2.0.6-9.i386.rpm --force --nodeps
Mengeset samba server:
Editlah file smb.conf yang terletak di /etc/smb.conf
1. Untuk security level = share (tidak membutuhkan password dalam mengakses samba):
pastikan ada script ini:
security = share
domain master=yes
domain logons=yes
encrypt password=yes
security = share
lalu tentukan nama direktori yg dishare beserta pathnya (direktori yang ingin disharing) dengan option-optionnya.
contoh:
[my share]
comment = multimedia stuff
path = /home/master
public = yes
writeable = yes
2. Untuk security level = user (butuh password ketika mengakses samba):
sama dengan di atas, namun pada baris security isikan dengan kata user (security = user).
Lalu under command prompt (masuk ke shell) tambahkan beberapa user yang telah tercantum di /etc/passwd ke dalam
file /etc/smbpasswd dengan cara:
smbpasswd -a -n
contoh:
[root@ltsp etc]# smbpasswd -a -n hari
Kita dapat mengakses samba server dari komputer windows, dengan menggunakan login hari dan dengan mengisikan
password hari yang terdaftar di komputer linux.
Secara default user yg ditambahkan ke /etc/smbpasswd tidak memiliki password, kita bisa mengisinya dengan
mengetikkan:
# smbpasswd
contoh:
[root@ltsp etc]# smbpasswd hari
3. Mounting file-file yang dishare di windows dari komputer linux
a. Mounting file2 yg ada di windows (dalam satu workgroup):
mount -t smbfs -o username=..., password=... //nama-komputer-windows/direktori-yg-dishare /mnt/mount-pointnya
contoh:
[root@ltsp etc]# mount -t smbfs -o username=guest,password=nedcom //"Kang andi"/nedcom /mnt/net
b. Berbeda workgroup:
Linux@Arinet.org
http://linux2.arinet.org Powered by Joomla! Generated: 7 December, 2007, 10:26
mount -t smbfs -o username=...,password=..., workgroup=... //nama-komputer-windows/direktori-yg-dishare /mnt/mountpointnya
contoh:
[root@ltsp etc]# mount -t smbfs -o username=hari,password=hehehe,workgroup=Lab-siskom //optik/master /mnt/net
4. Menggunakan smbclient
smbclient -L = untuk melihat direktori yang dishare di komputer windows
smbclient /// = masuk ke komputer windows pada direktori yang dishare dengan menggunakan format server ftp.
contoh:
[root@ltsp etc]# smbclient -L text
[root@ltsp etc]# smbclient //text/aborsi
Penutup:
Yang benar hanya datang dari Allah semata, yang salah datangnya cuman dari manusia aja. Kalo ada yg salah...., kirim
email ke ade yaa : adesurya_tkj@yahoo.co.id
Good Luck
Wassalaamu'alaikum Wr Wb
Tips N Trik Registry Network With Linux
Tulisan ini mengasumsikan bahwa komputer dengan sistem operasi Linux yang akan digunakan sebagai gateway ke internet telah dapat mengakses internet dengan baik. Tulisan ini akan membahas apa yang dapat anda lakukan agar komputer-komputer yang berada dalam LAN dapat mengakses internet melalui komputer Linux tersebut. Gambar 1, Contoh Jaringan dengan Linux Gateway.
Proxy Server atau Masquerading ?
Masquerading adalah suatu solusi tingkat rendah (low level) - dengan melakukan perubahan informasi yang terkandung dalam paket TCP/IP dengan melakukan pencatatan terhadap koneksi pada suatu interface dan mem-forward paket tersebut ke interface lain. Pada masquerading, program/sistem klien tidak menyadari proses tersebut. Dalam hal ini bertindak sebagai firewall, dimana semua klien tersembunyi dibelakangnya, sehingga semua akses ke internet dan sebaliknya harus melalui firewall tersebut.
_________________________________________
| __________ LAN _______________ |
_/\__/\_ | | | | | |
| | | | Firewall | | Masqueraded | |
/ Internet \--(PPP0)--| System |--(ETH0)--| Workstation/s | |
\_ _ _ _/ | |__________| |_______________| |
\/ \/ \/ |_________________________________________|
Sedangkan Proxy Server adalah suatu solusi tingkat tinggi (high level) - program/browser pada setiap klien harus dikonfigurasi untuk melakukan permintaan ke server dan bertindak sebagai klien.
Berdasarkan keterangan diatas, Masquerading nampaknya lebih mudah untuk dilakukan dan merupakan suatu pilihan yang mudah dipahami. Tetapi sebenarnya suatu Proxy Server memiliki fungsi lebih dari sekedar hanya melayani permintaan klien, suatu Proxy Server mengerti jenis data yang diminta oleh klien, dan dapat juga melakukan cache terhadap data tersebut, Sebagai contoh, suatu Proxy HTTP dapat melakukan cache terhadap halaman web yang pernah diakses, dan pada permintaan klien terhadap halaman yang sama, maka halaman yang berada dalam cache tersebut akan diberikan, sehingga akan menghemat bandwidth jaringan komunikasi ke internet yang secara langsung akan meningkatkan unjuk kerja sistem.
Anda dapat juga mengabungkan kedua teknik diatas untuk memperoleh suatu konfigurasi yang optimal, dimana Proxy Server digunakan untuk melayani permintaan HTTP, sedangkan Masquerading digunakan untuk permintaan non HTTP, seperti IRC, TELNET, SMTP, POP3, dll
Packet Filtering (Masquerading)
Masquerading bekerja dengan menggunakan paket filter. Paket filter memakai sejumlah Rules (aturan) untuk mengarahkan paket dari suatu interface ke interface lain, misalnya dari ETH0 ke PPP0, dengan melakukan perubahan data terhadap bagian header pada paket TCP/IP.
Untuk menggunakan paket filter di Linux, anda harus menggetahui versi kernel yang anda gunakan, karena pada kernel 2.0.x paket filter standarnya adalah ipfwadm, sedangkan pada kernel kernel 2.1.x dan 2.2.x telah diganti dengan ipchains. Cara melakukan konfigurasi Masquerading sangat tergantung kepada jenis paket filter yang anda gunakan.
Anda mungkin perlu mengkonfigurasi kembali kernel anda untuk kemampuan dukungan terhadap service masquerade/ firewall.
Catatan : Pemakaian Masquerading/ Firewall dapat menyebabkan gangguan operasi internet pada beberapa game.
Sebagai contohnya adalah game yang diproduksi oleh perusahaan Blizzard yang mana memerlukan koneksi ke Battle.net, misalnya pada game Diablo, dan Starcraft. Masalah ini dapat saja diatasi, sejauh mengetahui nomor port/IP address yang digunakan oleh aplikasi game tersebut untuk melakukan koneksi.
ipfwadm
Untuk kernel release 2.0.x dan sebelumnya, paket filtering mengunakan ipfwadm. Berikut ini adalah script sederhana yang memungkinkan komputer pada Gambar 1 untuk menangani pesan dikirim melalui gateway anda ke internet
/etc/rc.d/init.d/pfilter:
#!/bin/sh
# pfilter -- start/stop (IP) packet filter services
# Allow use of autoconfiguration (RH 5.2)
# chkconfig: 345 90 25
#
NAME=$0
case "$1" in
start)
echo -n "Memulai Paket Filter... "
# Mengosongkan setting sebelumnya:
/sbin/ipfwadm -O -f
/sbin/ipfwadm -I -f
/sbin/ipfwadm -F -f
# policy defautnya adalah "deny"
/sbin/ipfwadm -F -p deny
# melakukan brokir terhadap trafik autodial pada Windows, misalnya:
/sbin/ipfwadm -F -a deny -P tcp -S 0.0.0.0/0 137:139
# /sbin/ipfwadm -F -a deny -P udp -S 0.0.0.0/0 137:139
# untuk menyediakan service masquerade bagi komputer lokal - perbaiki
# alamat-alamat berikut sesuaikan dengan LAN anda dan pastikan juga
# untuk komputer Linux-nya !
/sbin/ipfwadm -F -a m -S 192.168.1.0/24 -D 0.0.0.0/0 -P all
# install module-module berikut ini jika anda membutuhkannya...
/sbin/insmod ip_masq_cuseeme
/sbin/insmod ip_masq_ftp
/sbin/insmod ip_masq_irc
/sbin/insmod ip_masq_quake
/sbin/insmod ip_masq_raudio
/sbin/insmod ip_masq_vdolive
echo "Selesai."
;;
stop)
echo -n "Menghentikan Paket Filter..."
/sbin/rmmod ip_masq_cuseeme
/sbin/rmmod ip_masq_ftp
/sbin/rmmod ip_masq_irc
/sbin/rmmod ip_masq_quake
/sbin/rmmod ip_masq_raudio
/sbin/rmmod ip_masq_vdolive
/sbin/ipfwadm -F -f
echo "Selesai."
;;
*)
echo "Pemakaian: $NAME {start|stop}"
exit 1
;;
esac
exit 0
Masquerading harus diaktifkan setelah service network bekerja. Hal tersebut dapat dilakukan dengan salah satu cara sebagai berikut ini :
a) dengan menambahkan command
/etc/rc.d/init.d/pfilter
kedalam file /etc/rc.d/rc.local sehingga Masquerading akan dijalankan pada setiap bootup sistem.
b) cara yang lebih baik adalah jika sistem anda mendukung pemakaian chkconfig adalah menggunakan perintah
chkconfig --add pfilter
Perintah diatas akan membuat suatu link start dan stop ke masq script untuk semua runlevel
ipautofw
ipfwadm bisa saja menyebabkan pemblokiran terhadap beberapa paket ip yang perlu dilewatkan ke internet untuk game-game tertentu. Hal tersebut dapat diatasi dengan menggunakan suatu paket ipautofw. Bacalah dokumentasi tentang ipautofw. Suatu percobaan yang sederhana perlu dilakukan untuk mendapatkan nomor port yang digunakan oleh aplikasi game tersebut :
misalnya : Sisipkan kode startup berikut pada packet filtering:
Fix untuk Starcraft/ Brood - Belum dicoba !
/usr/sbin/ipautofw -A -r tcp 6112 6112 -h
/usr/sbin/ipautofw -A -r udp 6112 6112 -h
Fix untuk Diablo - Belum dicoba !
/usr/sbin/ipautofw -A -r udp 6112 6112 -c tcp 116
/usr/sbin/ipautofw -A -r udp 6112 6112 -c tcp 118
ipchains
Pada umumnya Kernel yang modern telah mendukung "ipchains". IP Chains adalah suatu penulisan ulang terhadap ip.
Peringatan!! Bagian ini tidak pernah dicoba - karena saya belum melakukan instalasi ipchains
Berikut ini adalah script sederhana untuk memungkinkan komputer pada sistem Gambar 1 menangani pesan melalui gateway anda ke internet.
/etc/rc.d/init.d/pfilter:
#!/bin/sh
# pfilter -- start/stop packet filter services
# Allow use of autoconfiguration (RH 5.2)
# chkconfig: 345 90 25
#
NAME=$0
case "$1" in
start)
echo -n "Memulai Packet Filter... "
# 2.1.x/2.2.x secara default menonaktifkan IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# menghapus setting sebelumnya:
/sbin/ipchains -F
# policy defaultnya adalah "deny"
/sbin/ipchains -P forward DENY
# melakukan brokir terhadap trafik autodial pada Windows, misalnya:
/sbin/ipchains -A forward -j DENY -p tcp -s 0.0.0.0/0 137:139
# /sbin/ipchains -A forward -j DENY -p udp -s 0.0.0.0/0 137:139
# menyediakan layanan masquerade bagi komputer lokal
# masquerade interface ppp0 - ganti/ tambah interface lainnya sesuai
dengan kebutuhan
/sbin/ipchains -A forward -j MASQ -i ppp0
# mungkin saja anda membutuhkan yang berikut ini pada
# install module ini jika anda membutuhkannya
# /sbin/insmod ip_masq_cuseeme
# /sbin/insmod ip_masq_ftp
# /sbin/insmod ip_masq_irc
# /sbin/insmod ip_masq_quake
# /sbin/insmod ip_masq_raudio
# /sbin/insmod ip_masq_vdolive
echo "Selesai."
;;
stop)
echo -n "Menghentikan..."
# don't think you need these with IP chains - let me know !!
# install these modules if you have a need for them...
# /sbin/rmmod ip_masq_cuseeme
# /sbin/rmmod ip_masq_ftp
# /sbin/rmmod ip_masq_irc
# /sbin/rmmod ip_masq_quake
# /sbin/rmmod ip_masq_raudio
# /sbin/rmmod ip_masq_vdolive
# /sbin/ipchains forward -F
echo "Done."
;;
*)
echo "Usage: $NAME {start|stop}"
exit 1
;;
esac
exit 0
Masquerading harus diaktifkan setelah service network bekerja. Hal ini dapat dilakukan dengan salah satu cara berikut ini :
a) menambah command
/etc/rc.d/init.d/pfilter
dalam file /etc/rc.d/rc.local sehingga masquerading akan dijalankan pada setiap bootup sistem.
b) metode yang lebih baik dilakukan jika sistem anda mendukung pemakaian chkconfig adalah dengan menggunakan perintah
chkconfig --add pfilter
Perintah diatas membuat suatu start dan stop links ke masq script untuk semua runlevel
ipmasqadm
ipchain bisa saja menyebabkan pemblokiran terhadap beberapa paket ip yang perlu dilewatkan ke internet pada game-game tertentu. Hal ini diatasi dengan menggunakan suatu paket ipmasqadm. Bacalah dokumentasi tentang ipmasqadm. Suatu percobaan yang sederhana perlu dilakukan untuk mendapatkan nomor port yang digunakan oleh aplikasi game tersebut :misalnya.
Sisipkan kode startup berikut untuk packet filtering:
Fix untuk Starcraft/ Brood War fix - belum dicoba !
ipmasqadm autofw -A -r tcp 6112 6112 -h
ipmasqadm autofw -A -r udp 6112 6112 -h
Fix untuk Diablo fix - belum dicoba !
ipmasqadm autofw -A -r udp 6112 6112 -c tcp 116
ipmasqadm autofw -A -r udp 6112 6112 -c tcp 118
Proxy Servers
Bagian ini akan mediskusikan bagaimana melakukan setup suatu proxy server dan paket apa yang tersedia pada service proxy untuk jaringan anda.
Apache
Apache adalah salah satu web server yang paling banyak digunakan, dan disebarkan melalui banyak distribusi Linux. Sesuatu hal yang jarang diketahui, adalah Apache dapat juga berfungsi sebagai suatu proxy server untuk jaringan, supaya dapat melakukan hal ini, anda perlu melakukan edit terhadap konfigurasi file Apache Web yang terdapat pada direktori /etc/httpd/conf dan menambahkan baris-baris berikut:
httpd.conf:
# Proxy Server directives. Uncomment the following line to
# enable the proxy server:
ProxyRequests On
# To enable the cache as well, edit and uncomment the following lines:
CacheRoot /var/cache/httpd
CacheSize 5
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1
NoCache
Apache juga mampu melakukan FTP proxying, dan dapat juga dikombinasikan dengan SOCKS (lihat yang berikut ini).
Socks
Socks adalah suatu mekanisme proxy pada jaringan dimana memungkinkan host-host yang berada pada sisi SOCKS server mendapatkan akses penuh ke host-host yang berada di sisi lain dari SOCKS server tanpa menggunakan IP yang dapat dicapai secara langsung. Hal ini bekerja dengan mengarahkan kembali permintaan koneksi (connection requests) dari suatu host pada satu sisi ke host yang berada di sisi lain pada SOCKS server, dalam hal ini akan melakukan identifikasi yang memperbolehkan akses tersebut atau tidak, membangun suatu koneksi proxy untuk melewatkan data yang masuk dan keluar. Hal ini tepatnya berfungsi sebagai suatu firewall jaringan yang mana memungkinkan host-host yang berada dibelakang suatu SOCKS server untuk mendapatkan akses penuh ke internet dan dapat mencegah akses yang yang tidak diperbolehkan dari internet ke host-host internal.
Socks datang dengan 2 paket, yaitu :
- satu untuk server yang mana diinstall paada komputer Linux gateway,
- satu lagi untuk klien [SocksCap16/32 unttuk Windows , atau runsocks untuk Linux] yang harus diinstall pada sistem klien.
Anda perlu melakukan setup program socks klien pada setiap program yang membutuhkan socks service.Socks juga dapat mendukung UDP proxy, hal ini berarti dia juga dapat bekerja pada sejumlah games. Socks5 menggunakan suatu konfigurasi file pada server (Sistem Unix : file ini adalah /etc/socks5.conf).
httpd.conf:
auth - - -
interface 192.168.1. - -
permit - - 192.168.1. - - -
Squid
Suatu paket alternatif yang sering digunakan untuk memungkinkan service proxy adalah squid. Squid bertindak sebagai suatu proxy caching server yang berkemampuan tinggi untuk FTP, Gopher dan HTTP (Web)
Pemakaian proxy caching server akan menghemat waktu akses dan bandwidth, karena proxy caching server akan melakukan cache terhadap data yang telah diminta dari internet pada proxy server lokal, dan hasil cache tersebut dapat digunakan kembali untuk melayani permintaan berikutnya akan data yang sama.
Secara default, squid diinstall kedalam direktori /usr/local/squid . File konfigurasi squid.conf. dapat saja berada pada suatu subdirektori etc dalam direktori tertentu, atau berada pada subdirektori /etc yang sebenarnya Konfigurasi file berikut mengandung perintah yang mana menentukan siapa saja yang diperbolehkan untuk menggunakan proxy server.Suatu contoh untuk file squid.conf adalah:
squid.conf:
daftar Access control. Hal ini sangat penting karena mencegah
pencurian resource jaringan oleh orang lain. Isikan pada "allowed_hosts"
ACL,dengan alamat jaringan (misalnya 192.168.200.0 dan mask jaringan
anda (misalnya 255.255.255.0):
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl all src 0.0.0.0/0.0.0.0
acl allowed_hosts src 192.168.1.0/255.255.255.0
http_access deny manager all
http_access allow allowed_hosts
http_access deny all
icp_access allow allowed_hosts
icp_access deny all
Pada contoh diatas, ganti bagian yang ber-cetak tebal network dan netmask dengan alamat IP dan netmask yang sesuai dengan jaringan anda. Setelah melakukan konfigurasi, pertama kali squid perlu diaktifkan dengan parameter -z yang berfungsi untuk melakukan setup suatu cache direktori. Akhirnya, suatu startup script harus di buat untuk memulai operasi squid. Suatu contoh startup script untuk squid pada RH5.2 adalah:
/etc/rc.d/init.d/squid:
!/bin/bash
# squid This shell script takes care of starting and stopping
# Squid Internet Object Cache
#
# chkconfig: - 90 25
# description: Squid - Internet Object Cache. Internet object caching is
\
# a way to store requested Internet objects (i.e., data available \
# via the HTTP, FTP, and gopher protocols) on a system closer to the \
# requesting site than to the source. Web browsers can then use the \
# local Squid cache as a proxy HTTP server, reducing access time as \
# well as bandwidth consumption.
# pidfile: /var/run/squid.pid
# config: /etc/squid.conf
PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# check if the squid conf file is present
[ -f /etc/squid.conf ] || exit 0
# determine the name of the squid binary
[ -f /usr/sbin/squid ] && SQUID=squid
[ -f /usr/sbin/squid.novm ] && SQUID=squid.novm
[ -z "$SQUID" ] && exit 0
# determine which one is the cache_swap directory
CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid.conf | \
grep cache_dir | sed -e 's/cache_dir//' | \
tr -d '\n'`
[ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid
# default squid options
# -D disables initial dns checks. If you most likely will not to have an
# internet connection when you start squid, uncomment this
#SQUID_OPTS="-D"
case "$1" in
start)
echo -n "Starting $SQUID: "
[ ! -d $CACHE_SWAP/00 ] && \
echo -n "init_cache_dir $CACHE_SWAP... " && $SQUID -z -F 2>/dev/null
$SQUID $SQUID_OPTS &
echo $SQUID
touch /var/lock/subsys/$SQUID
;;
stop)
echo -n "Stopping $SQUID: "
$SQUID -k shutdown &
rm -f /var/lock/subsys/$SQUID
while : ; do
[ -f /var/run/squid.pid ] || break
sleep 2 && echo -n "."
done
echo "done"
;;
restart)
$SQUID $SQUID_OPTS -k reconfigure
exit $?
;;
status)
status $SQUID
$SQUID -k check
exit $?
;;
probe)
exit 0;
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0
Konfigurasi browser anda untuk menggunakan proxy server
Jika anda telah memilih proxy service untuk layanan jaringan anda, anda perlu melakukan konfigurasi pada web browser di setiap komputer klien (kecuali komputer gateway anda) agar dapat menggunakan fasilitas proxy server tersebut.
Anda tidak perlu melakukan hal ini pada Masquerading/Packet Filtering!
Pada Netscape hal ini dapat ditemukan pada menu Preferences dan didalam Advanced/Proxies. Pilih Manual Configuration yang mana akan memungkinkan anda untuk mengisi alamat IP dan port dari komputer proxy server. Setting standard untuk port proxy server adalah :
http: 80
ftp: 21
gopher: 70
Tips N Trik Registry Network With Linux
Sering kali, kita ingin menggunakan Mikrotik Wireless untuk solusi point to point dengan mode jaringan bridge (bukan routing). Namun, Mikrotik RouterOS sendiri didesain bekerja dengan sangat baik pada mode routing. Kita perlu melakukan beberapa hal supaya link wireless kita bisa bekerja untuk mode bridge.
Tips N Trik Registry Network With Linux
Saya menulis ini buat temen2 yang minta untuk di buatin tutorial untuk setting router warnet,dimana sebelumnya mereka memakai router windows dan mau migrasi ke linux
|eth0
|
|-------|
| MGW |
|---|---|
|
|eth1
|
|
|--------------------hub----------------------|
| | |
| | |
| | |
|---------| |---------| |---------|
|Client 01| |Client 02| |Client 03|
|---------| |---------| |---------|
Pertama yang harus di lakukan adalah mensetting mgw(main gateway) supaya bisa connect ke internet
Sebelum Mensetting :
1.Minta IP public ke ISP lengkap dengan netmask,broadcast dan dns nya
misalnya :
RANGE : 202.159.121.0/29
IP : 202.159.121.2
GATEWAY : 202.159.121.1
Nemast : 255.255.255.248
broadcast : 202.159.121.7
DNS1 : 202.159.0.10
DNS2 : 202.159.0.20
berarti kita mendapatkan ip 5 buah dari 202.159.121.2 - 202.159.121.6
2.Menentukan IP local yang akan kita gunakan buat client
Setting IP MGW :
1.[root@mgw cachak]$ vi /etc/sysconfig/network
lalu isi dengan :
NETWORKING=yes
HOSTNAME=mgw.domain.com
GATEWAY=202.159.121.1
lalu simpen dengan menekan :wq
2.Menconfigurasi IP eth0(default)
[root@mgw root]$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
lalu isi dengan :
DEVICE=eth0
BOOTPROTO=static
IPADDR=202.159.121.2
BROADCAST=202.159.121.7
NETMASK=255.255.255.249
ONBOOT=yes
USERCTL=no
lalu simpen dengan menekan :wq
3.Setting dns resolve
[root@mgw root]$ vi /etc/resolve.conf
lalu isi dengan nameserver dari isp kita tadi :
nameserver 202.159.0.10
nameserver 202.159.0.20
lalu simpen dengan menekan :wq
4.Setting ip_forwarding
[root@mgw cachak]$ vi /etc/sysctl.conf
rubah net.ipv4.ip_forward = 0 menjadi net.ipv4.ip_forward = 1
atau kalau gak ada net.ipv4.ip_forward = 0 tambahin net.ipv4.ip_forward = 1
simpen dengan menekan :wq
5.restart network
[root@mgw cachak]$ /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@www root]#chkconfig --level 2345 network on
[root@www root]#
6.testing dengan ngeping ke default gateway 202.159.121.1
[root@mgw cachak]$ ping 202.159.121.1
PING 202.159.121.1 (202.159.121.1) 56(84) bytes of data.
64 bytes from 202.159.121.1: icmp_seq=1 ttl=63 time=0.356 ms
64 bytes from 202.159.121.1: icmp_seq=2 ttl=63 time=0.269 ms
64 bytes from 202.159.121.1: icmp_seq=3 ttl=63 time=0.267 ms
64 bytes from 202.159.121.1: icmp_seq=4 ttl=63 time=0.268 ms
--- 202.159.121.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.267/0.290/0.356/0.038 ms
7.testing untuk ngeping google.com untuk ngecek dns nya
kalau muncul :
PING google.com (216.239.39.99) 56(84) bytes of data.
berarti dns kita untuk mgw dah bekerja, tapi kalau muncul :
ping: unknown host google.com
berarti dns yang kita isikan di /etc/resolve.conf masih salah,silahkan cek lagi ke ISP nya :)
nah bereskan sudah setting IP untuk mgw nya :)
supaya mgw ini bisa sekaligus di gunakan sebagai ns server oleh client maka harus di install daemon bind atau daemon nameserver yang lain
ataukalau sudah ada tinggal idupin Bind nya
[root@www root]# /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@www root]#chkconfig --level 2345 named on
[root@www root]#
misalnya ip ke client adalah :
192.168.0.1/24
IP : 192.168.0.1
netmask : 255.255.255.0
broadcast : 192.168.0.255
RANGE IP CLIENT : 192.168.0.2-192.168.0.254
Setting ip untuk eth1 (yang ke client)
1.memberi IP 192.168.0.1 di eth1
[root@mgw cachak]$ vi /etc/sysconfig/network-scripts/ifcfg-eth1
lalu isi dengan :
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.1
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
ONBOOT=yes
USERCTL=no
lalu simpen dengan menekan :wq
2.Restart networknya
[root@mgw root]$ /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]
3.Testing dengan cara ping ip eth1
[root@mgw cachak]$ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=63 time=0.356 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=63 time=0.269 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=63 time=0.267 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=63 time=0.268 ms
--- 192.168.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.267/0.290/0.356/0.038 ms
Tinggal Setting IP computer client dengan ketentuan di bawah ini :
IP : 192.168.0.2 - 192.168.0.254
GATEWAY : 192.168.0.1
NETMASK : 255.255.255.0
BROADCAST : 192.168.0.255
NAMESERVER : 192.168.0.1
misal :
Client01
===============================
IP : 192.168.0.2
GATEWAY : 192.168.0.1
NETMASK : 255.255.255.0
BROADCAST : 192.168.0.255
NAMESERVER : 192.168.0.1
Client02
===============================
IP : 192.168.0.3
GATEWAY : 192.168.0.1
NETMASK : 255.255.255.0
BROADCAST : 192.168.0.255
NAMESERVER : 192.168.0.1
dan seterusnya sesuai banyaknya client,yang berubah hanya IP
untuk client windows maka setting IP di bagian Start Menu/Setting/Control Panel/Network
setelah di setting ip client, maka coba ping ke 192.168.0.1 dari client,kalau berhasil berarti client dan MGW nya sudah tersambung.
Setting MGW supaya client bisa internat dengan menggunakan NAT
1.Matikan iptablesnya
[root@mgw root]# /etc/init.d/iptables stop
Flushing all chains: [ OK ]
Removing user defined chains: [ OK ]
Resetting built-in chains to the default ACCEPT policy: [ OK ]
[root@mgw root]#
2.Tambahkan iptables untuk Source NAt sesuai dengan ip di eth0
[root@mgw root]# /sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT --to-source 202.159.121.2
[root@mgw root]# /sbin/iptables-save > /etc/sysconfig/iptables
[root@mgw root]# /etc/init.d/iptables restart
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules: [ OK ]
[root@mgw root]# iptables-save
SNAT sudah,SNAT disini standar sekali dan gak ada proteksi
untuk mengetest nya kita browser di client lalau buka google.com, kalau jalan berati kita sudah berhasil :)
Tips N Trik Registry Network With Linux