Jumat, 23 Januari 2015

Konfigurasi Router Debian 6 Squeeze


Konfigurasi Router Debian 6 Squeeze

Kita mulai dari menentukan IP,.
Untuk jaringan pertama : 192.178.3.11
Gateway : 192.178.3.1
Untuk jaringan ke2 : 192.168.4.11

1. Setting IP Address Debian 6 Squeeze.


#nano /etc/network/interfaces

kemudian edit filenya menjadi sebagai berikut: 
# The primary network interface

auto eth0
iface eth0 inet static
address 192.178.3.11
netmask 255.255.255.0
gateway 192.178.3.1
auto eth1
iface eth1 inet static
address 192.168.4.11
netmask 255.255.255.0
2. Kemudian kita edit file rc.local 
(digunakan untuk melakukan routing walaupun di restart) dengan perintah
#nano /etc/rc.local

sebelum baris exit 0 ditambahkan 

iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE

sehingga rc.local akan menjadi
#!/bin/sh -e
#
# 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.

iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
exit 0


3. Aktifkan ip forward
dengan perintah
#nano /etc/sysctl.conf

cari kata #net.ipv4.ip_forward=1
kemudian hilangkan tanda #

4. Restart network
perintah 
#/etc/init.d/networking restart

0 komentar