(Networking Tutorial)
Router adalah sebuah device yang berfungsi untuk meneruskan paket-paket dari sebuah
network ke network yang lainnya (baik LAN ke LAN atau LAN ke WAN) sehingga host-
host yang ada pada sebuah network bisa berkomunikasi dengan host-host yang ada pada
network yang lain. Jenis router ada yang diproduksi oleh vendor tertentu (cisco, juniper,
dst) atau yang dapat difungsikan menggunakan komputer (pc router).
PC (Personal Computer) Router adalah sebuah komputer yang berfungsi sebagai router.
PC Router dapat diterapkan dengan menggunakan spesifikasi minimal :
aka akan terlihat seperti berikut :
untuk ip static :
—————cut————–
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT 0 — 192.168.0.0/24 anywhere to:10.10.1.81
—————cut————–
untuk ip DHCP :
—————cut————–
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE 0 — 192.168.0.0/24 anywhere
Router adalah sebuah device yang berfungsi untuk meneruskan paket-paket dari sebuah
network ke network yang lainnya (baik LAN ke LAN atau LAN ke WAN) sehingga host-
host yang ada pada sebuah network bisa berkomunikasi dengan host-host yang ada pada
network yang lain. Jenis router ada yang diproduksi oleh vendor tertentu (cisco, juniper,
dst) atau yang dapat difungsikan menggunakan komputer (pc router).
PC (Personal Computer) Router adalah sebuah komputer yang berfungsi sebagai router.
PC Router dapat diterapkan dengan menggunakan spesifikasi minimal :
- Dua buah NIC
- OS *nix (BSD, Linux, Unix), OS Windows Server, Open Solaris, dst
Pada installasi kali ini, kita akan membuat PC Router dengan menggunakan OS Linux
Ubuntu Desktop 7.10 Punyanya “Om Gusty”.
Saat ini aku make dua buah lan cards yang satu buat ke luar dan yang atunya buat ke
dalam.
KONFIGURASI
1. Konfigurasi IP address
* eth0 : IP Address 10.10.1.81 Netmask 255.255.255.0
* eth1 : IP Address 192.168.0.1 Netmask 255.255.255.0
* DNS Server : 127.0.0.1 (disesuaikan dengan punya kita yang konek internet)
* Search Domains : perusahaan.com (boleh di isi boleh gak)
* IP address : 10.10.1.81
* Subnet mask : 255.255.255.0
* Gateway address : 10.10.1.1 (Gateway di isi sesuai dengan ip modem ato alat yg konek
internet tu pokoke)
Pilih bagian eth1 (network internal) lalu klik “Properties” . Uncheck pilihan “Enable
roaming mode” lalu ganti “Configuration” menjadi “Static IP Address“. Masukan :
* IP address : 192.168.0.1
* Subnet mask : 255.255.0.0
* Gateway address :
Atau “Generate random password“, apabila ingin menggunakan password yang dibuat
secara random. Lalu klik tombol “OK“.
Untuk mengaktifkan IP Forward, kita dapat mengklik panel Applications->Accecories-
>Terminal Setelah muncul terminalnya, ketik perintah :
* su -
* Password : password_root
Maka kita sudah masuk ke mode root, dengan ditandai oleh tanda “#” (tanda kress). Lalu
dilanjutkan dengan perintah berikut :
* sysctl net.ipv4.ip_forward
untuk ip DHCP :
—————cut————–
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE 0 — 192.168.0.0/24 anywhere
—————cut————–
* pico /etc/init.d/iptables
Isikan file tersebut dengan entry-an berikut :
—–start—–
#!/bin/sh
#
#This is a ubuntu adapted iptables script from gentoo
#(http://www.gentoo.org) which was originally distributed
# under the terms of the GNU General Public License v2
#and was Copyrighted 1999-2004 by the Gentoo Foundation
#
#This adapted version was intended for and ad-hoc personal
#situation and as such no warranty is provided.
IPTABLES_SAVE=”/etc/default/iptables-rules”
SAVE_RESTORE_OPTIONS=”-c”
SAVE_ON_STOP=”yes”
checkrules() {
if [ ! -f ${IPTABLES_SAVE} ]
then
echo “Not starting iptables. First create some rules then run”
echo “\”/etc/init.d/iptables save\””
return 1
fi
}
save() {
echo “Saving iptables state”
/sbin/iptables-save ${SAVE_RESTORE_OPTIONS} > ${IPTABLES_SAVE}
}
start(){
checkrules || return 1
echo “Loading iptables state and starting firewall”
echo -n “Restoring iptables ruleset”
start-stop-daemon –start –quiet –exec /sbin/iptables-restore — $
{SAVE_RESTORE_OPTIONS} &2
exit 1
;;
esac
exit 0