Jumat, 09 Maret 2012

Setting Router Di Ubuntu 9.10 (Karmic Koala)

topologirouter Ubuntu 9.10 (Karmic) : Setting Router
Sebelum Setting Router di Linux Ubuntu 9.10 (Karmic) : Setting Router Ubuntu 9.10,
persiapkan minimal 2 lancard di server.
Kita persiapkan prerequisitenya.
1. Konfigurasi Hosts
# sudo nano /etc/hosts
konfigurasi didalamnya :
127.0.0.1       it.dimas.com localhost   ##bisa disesuaikan
127.0.1.1       it.dimas.com             ##bisa disesuaikan
 
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
2. Konfigurasi sysctl.conf
fungsinya adalah untuk mengaktifkan IP Forwarding pada server
# sudo nano /etc/sysctl.conf
konfigurasi didalamnya :
net.ipv4.ip_forward=1
## Bila didepan nya ada tanda "#" hapus tanda tersebut dan pastikan bernilai 1
Lalu simpan file tersebut dengan menekan ctrl + x, lalu pilh Y untuk Yes
Lalu pada shell ketikan perintah berikut :
# sudo sysctl -p
3. Konfigurasi Hostname
it.dimas.com   ## Sesuaikan dengan HOSTS
4. Konfigurasi IP Address
# sudo nano /etc/network/interfaces
konfigurasi didalamnya :
auto lo
iface lo inet loopback
 
auto eth0   ## ethernet yang terhubung dengan internet luar
iface eth0 inet static
address 192.168.1.254
broadcast 192.168.1.255
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.1
 
auto eth1  ## ethernet yang terhubung dengan jaringan Local / LAN
address 10.0.0.1
broadcast 10.0.0.255
network 10.0.0.0
netmask 255.255.255.0
Lalu simpan file tersebut dengan menekan ctrl + x, lalu pilh Y untuk Yes
Setelah itu jangan lupa untuk setting DNS nya.
# sudo nano /etc/resolv.conf
Konfigurasi di dalamnya adalah :
nameserver 222.124.204.34  ##DNS dari providernya.kebetulan saya memakai speedy
konfigurasi IP Address bisa dilihat di tutorial sebelumnya.
Lalu simpan file tersebut dengan menekan ctrl + x, lalu pilh Y untuk Yes
Terakhir restart network.
# sudo /etc/init.d/networking restart
OK, sekarang ke setting IPTABBLES nya
Ketikkan perintah berikut di shell.
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
##Meneruskan Paket paket
iptables -I FORWARD -j ACCEPT
##SNAT (Static Network Address Translation)
iptables -t nat -I POSTROUTING -o eth0 -s 10.0.0.0/8 -j SNAT --to-source 192.168.1.254
Lalu simpan file tersebut dengan menekan ctrl + x, lalu pilh Y untuk Yes
Agar perintah tersebut tidak hilang ketika di restart komputer, simpan pertintah tersebut di
/etc/rc.local  
Rebesss dah gan. Silahkan coba.

Tidak ada komentar:

Posting Komentar