seting router ubutu permanen ok barlianno
Jika kedua LAN Card sudah terpasang, maka langkah selanjutnya yaitu:
1. Setup Device (LAN CARD)
2. Konfigurasi Router
1. SETUP DEVICE (LAN CARD)
Untuk sambung ke Internet, disetting seperti yg sudah dilakukan. Yang satunya yang akan digunakan untuk menghubungkan jaringan internal ke internet.
#*********perintah *******************************************
root@mdin: sudo vim /etc/network/interfaces
#******* setting device ***********
auto lo
iface lo inet loopback
# The primary network interface
# eth1 >> “ Jaringan Lokal “
auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
# eth2 >> “ Koneksi ke Internet “
auto eth2
iface eth2 inet static
address 102.168.1.5
netmask 255.255.255.0
network 102.168.1.0
broadcast 102.168.1.255
gateway 102.168.1.254
#*********** restart netwoking **************
root@mdin: sudo /etc/init.d/networking restart
* Reconfiguring network interfaces… [ OK ]
#********** mencek apakah setup sudah betul *********
root@mdin: ip addr
root@mdin: ifconfig
#********** mencek apakah koneksi internet lancar *********
root@mdin: ping google.com
2. KONFIGURASI ROUTER
#*************** Edit file sysctl.conf *****************
root@mdin: sudo nano /etc/sysctl.conf
#*************** Isi file sysctl.conf *****************
# *** asal: net.ipv4.conf.default.forwarding=1
# *** diubah menjadi :
net.ipv4.conf.default.forwarding=1
# **** simpan & keluar: ctrl+x
# *************** Edit file ip_forward ******
root@mdin: echo 1 > /proc/sys/net/ipv4/ip_forward
# *************** proses routing dr eth2 ke eth1 *****
root@mdin: sudo /sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
—————————————————– akhir konfigurasi ——————————-
Dah.. selesai proses setting pc router.
Bisa dites dari jaringan lokal, setting IP di PC dalam jaringan lokal yaitu:
address 192.168.0. XY (XY=antara 2 s.d. 254)
netmask 255.255.255.0
Gateway 192.168.0.1
DNS 192.168.0.1
TAMBAHAN:
Jika ingin PC router dapat berfungsi secara otomatis pada saat direstart maka perlu ditambahkan setting sbb:
#******************* setting permanent **************
root@mdin: sudo nano /etc/rc.local
# ** Hapus exit=0 dan ganti dg script berikut ****
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
# *** simpan rc.local ***********
# *** testing, dengan di reboot PC/L ***********
root@mdin: sudo reboot
#********************** selesai *********************
dibawah ini fail /etc/rc.local yang sudah berhasil di edit
Hapus exit=0 dan ganti dg script berikut
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
hasilnya seperti dibawah ini
===================================================
#!/bin/sh -e
#iptables -t nat -I POSTROUTING -j MASQUERADE
#echo 1 > /proc/sys/net/ipv4/ip_forward
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
===================================================
sewadpc.com
barlianno.blogspot.com
atikel terkait http://mdin.staff.uad.ac.id/2009/04/bikin-pc-router-dengan-ubuntu/comment-page-1/#comment-140
Jika kedua LAN Card sudah terpasang, maka langkah selanjutnya yaitu:
1. Setup Device (LAN CARD)
2. Konfigurasi Router
1. SETUP DEVICE (LAN CARD)
Untuk sambung ke Internet, disetting seperti yg sudah dilakukan. Yang satunya yang akan digunakan untuk menghubungkan jaringan internal ke internet.
#*********perintah *******************************************
root@mdin: sudo vim /etc/network/interfaces
#******* setting device ***********
auto lo
iface lo inet loopback
# The primary network interface
# eth1 >> “ Jaringan Lokal “
auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
# eth2 >> “ Koneksi ke Internet “
auto eth2
iface eth2 inet static
address 102.168.1.5
netmask 255.255.255.0
network 102.168.1.0
broadcast 102.168.1.255
gateway 102.168.1.254
#*********** restart netwoking **************
root@mdin: sudo /etc/init.d/networking restart
* Reconfiguring network interfaces… [ OK ]
#********** mencek apakah setup sudah betul *********
root@mdin: ip addr
root@mdin: ifconfig
#********** mencek apakah koneksi internet lancar *********
root@mdin: ping google.com
2. KONFIGURASI ROUTER
#*************** Edit file sysctl.conf *****************
root@mdin: sudo nano /etc/sysctl.conf
#*************** Isi file sysctl.conf *****************
# *** asal: net.ipv4.conf.default.forwarding=1
# *** diubah menjadi :
net.ipv4.conf.default.forwarding=1
# **** simpan & keluar: ctrl+x
# *************** Edit file ip_forward ******
root@mdin: echo 1 > /proc/sys/net/ipv4/ip_forward
# *************** proses routing dr eth2 ke eth1 *****
root@mdin: sudo /sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
—————————————————– akhir konfigurasi ——————————-
Dah.. selesai proses setting pc router.
Bisa dites dari jaringan lokal, setting IP di PC dalam jaringan lokal yaitu:
address 192.168.0. XY (XY=antara 2 s.d. 254)
netmask 255.255.255.0
Gateway 192.168.0.1
DNS 192.168.0.1
TAMBAHAN:
Jika ingin PC router dapat berfungsi secara otomatis pada saat direstart maka perlu ditambahkan setting sbb:
#******************* setting permanent **************
root@mdin: sudo nano /etc/rc.local
# ** Hapus exit=0 dan ganti dg script berikut ****
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
# *** simpan rc.local ***********
# *** testing, dengan di reboot PC/L ***********
root@mdin: sudo reboot
#********************** selesai *********************
dibawah ini fail /etc/rc.local yang sudah berhasil di edit
Hapus exit=0 dan ganti dg script berikut
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
hasilnya seperti dibawah ini
===================================================
#!/bin/sh -e
#iptables -t nat -I POSTROUTING -j MASQUERADE
#echo 1 > /proc/sys/net/ipv4/ip_forward
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -d 0/0 -j MASQUERADE
===================================================
Itu pengalaman dan semoga bemanfaat….
telah di uji coba ulang di labnetwork barlianno
kunjugitelah di uji coba ulang di labnetwork barlianno
sewadpc.com
barlianno.blogspot.com
atikel terkait http://mdin.staff.uad.ac.id/2009/04/bikin-pc-router-dengan-ubuntu/comment-page-1/#comment-140
Komentar
Posting Komentar