Ads

Rabu, 09 Maret 2011

Konfigurasi Router Debian Lenny

Setelah berhasil menginstall debian lenny 5.04. Selanjutnya kita akan mengkonfigurasi Router. Silahkan ikuti langkah berikut :

* Kata2 yang bercetak tebal adalah perintah yang dijalankan pada komputer server.
* Kata2 yang berwarna merah adalah yang harus anda ubah atau buat.

1) pico  /etc/network/interfaces
                   # The primary network interface
                  allow-hotplug eth0
                  iface eth0 inet static
                  address 192.168.1.1
                  netmask 255.255.255.192
                  network 192.168.1.0
                  broadcast 192.168.1.63
                  gateway 192.168.1.62
                  # dns-* options are implemented by the resolvconf package, if installed
                  dns-nameservers 192.168.1.62
                  dns-search situstkj.co.cc

                  # The secondary network interface
                  auto eth1
                  iface eth1 inet static
                  address                   172.16.1.62
                  netmask                   255.255.255.192
                  network                   72.16.1.0
                  broadcast                172.16.1.63

2) /etc/init.d/networking  restart

3) pico /etc/sysctl.conf

                  # Uncomment the next line to enable packet forwarding for IPv4
                  net.ipv4.ip_forward=1


4) iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
5) iptables -t nat -n –L

                 Chain PREROUTING (policy ACCEPT)
                 target prot opt source destination

                 Chain POSTROUTING (policy ACCEPT)
                 target prot opt source destination
                 MASQUERADE all -- 0.0.0.0/0 0.0.0.0/0

                 Chain OUTPUT (policy ACCEPT)
                 target prot opt source destination

6) iptables-save  >  /etc/network/iptables.conf
7) echo "iptables-restore  <  /etc/network/iptables.conf"  >>  /etc/network/if-up.d/iptables"
8) pico /etc/network/if-up.d/iptables

#!/bin/sh
iptables-restore < /etc/network/iptables.conf
9) chmod  +x  /etc/network/if-up.d/iptables


10) reboot
11) ifconfig | less
                 eth0 Link encap:Ethernet HWaddr 00:0c:29:32:97:44
                 inet addr:192.168.1.1 Bcast:192.168.1.63 Mask:255.255.255.192
                 inet6 addr: fe80::20c:29ff:fe32:9744/64 Scope:Link
                 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
                 RX packets:5 errors:0 dropped:0 overruns:0 frame:0
                 TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
                 collisions:0 txqueuelen:1000
                 RX bytes:400 (400.0 B) TX bytes:3660 (3.5 KiB)
                 Interrupt:19 Base address:0x2000

                 eth1 Link encap:Ethernet HWaddr 00:0c:29:32:97:4e
                 inet addr:172.16.1.62 Bcast:172.16.1.63 Mask:255.255.255.192
                 inet6 addr: fe80::20c:29ff:fe32:974e/64 Scope:Link
                 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
                 RX packets:148 errors:0 dropped:0 overruns:0 frame:0
                 TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
                 collisions:0 txqueuelen:1000
                 RX bytes:12617 (12.3 KiB) TX bytes:9610 (9.3 KiB)
                 Interrupt:16 Base address:0x2080

                 lo Link encap:Local Loopback
                 inet addr:127.0.0.1 Mask:255.0.0.0
                 inet6 addr: ::1/128 Scope:Host

12) iptables -t nat -n –L

                 Chain PREROUTING (policy ACCEPT)
                 target prot opt source destination
                 Chain POSTROUTING (policy ACCEPT)
                 target prot opt source destination
                 MASQUERADE all -- 0.0.0.0/0 0.0.0.0/0
                 Chain OUTPUT (policy ACCEPT)
                 target prot opt source destination





 (Jika terdapat kata Masquerade all berarti konfigurasi Anda Sudah Berhasil)

13) Kita check koneksinya. Pada windows ubah Settingan TCP/IP Menjadi Seperti ini:
                 IP Address                   : 172.16.1.2
                 Subnet Mask                : 255.255.255.192
                 Default Gateway           : 172.16.1.62
                 Preferred DNS Server  : 172.16.1.62

14) Setelah settingan diubah, Bukalah Command Prompt computer client dan cek koneksi ke server.
C:\Users\antoro>ping 172.16.1.62
Pinging 172.16.1.62 with 32 bytes of data:
Reply from 172.16.1.62: bytes=32 time<1ms TTL=64
Reply from 172.16.1.62: bytes=32 time<1ms TTL=64
Reply from 172.16.1.62: bytes=32 time<1ms TTL=64
Reply from 172.16.1.62: bytes=32 time=1ms TTL=64
Ping statistics for 172.16.1.62:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

C:\Users\antoro>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms

15) Jika Reply, Maka konfurasi router anda bisa dikatakan berhasil.
 

0 komentar: