Pertama masuk pada direktori cd /etc/network/,
Kemudian edit file pico interfaces seperti pada tampilan dibawah ini ;
# Used by ifup(8) and ifdown(8).
See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
# /usr/share/doc/ifupdown/examples for more information.
allow-hotplug eth0
iface eth0 inet static
address 192.168.4.1 (Untuk Client computer/local))
netmask 255.255.255.0
broadcast 192.168.4.255
network 192.168.4.0
gateway 192.168.80.100
iface eth0 inet static
address 192.168.4.1 (Untuk Client computer/local))
netmask 255.255.255.0
broadcast 192.168.4.255
network 192.168.4.0
gateway 192.168.80.100
auto eth1
iface eth1 inet static
address 192.168.80.130
netmask 255.255.255.0 (Untuk jaringan/public)
broadcast 192.168.80.255
network 192.168.80.0
gateway 192.168.80.100
iface eth1 inet static
address 192.168.80.130
netmask 255.255.255.0 (Untuk jaringan/public)
broadcast 192.168.80.255
network 192.168.80.0
gateway 192.168.80.100
Simpan konfigurasi tersebut,
Routingkan dengan perintah,
imron@debian:/# iptables –t nat –A POSTROUTING –s 192.168.80.0/24 –j MASQUERADE
imron@debian:/# iptables –t nat –A POSTROUTING –s 192.168.4.0/24 –j MASQUERADE
Simpan ,
imron@debian:/# iptables-save
Untuk melihat ip yang sudah kita routing kan sudah benar atau belum benar,kita ketikkan perintah,
imron@debian:/# iptables –t nat –n –L
imron@debian:/# iptables-save
Untuk melihat ip yang sudah kita routing kan sudah benar atau belum benar,kita ketikkan perintah,
imron@debian:/# iptables –t nat –n –L
Kemudian masuk ke pico
/etc/sysct1.conf
#net.ipv4.ip_forward=1
#net.ipv4.ip_forward=1
Hapus tanda (#)
Kemudian masuk ke pico
/etc/rc.local
Ketikkan setelah tulisan diantarat
“#By default this script does nothing” dan “exit 0”
iptables –t nat –A POSTROUTING –o
eth0 –d 0/0 –j MASQUERADE
iptables –t nat –A POSTROUTING –o
eth1 –d 0/0 –j MASQUERADE
Lalu simpan.
Restart networkNya,
imron@debian:/# /etc/init.d/networking restart
# reboot
Router telah selesai.
Tidak ada komentar:
Posting Komentar