Merancang LAN


Pada Contoh Setting Lan :

1. Komputer Server :

  • Web Server : 192.168.4.98/255.255.255.224
  • Mail Server : 192.168.4.99/255.255.255.224
  • FTP Server : 192.168.4.100/255.255.255.224
  • Samba Server : 192.168.0.253/255.255.0

2. Komputer Router :

  • eth0
    • ip address : 192.168.4.97
    • netmask : 255.255.255.224
    • Deafult Gatmay : 192.168.4.126
    • DNS1 : 202.134.2.5
    • DNS2: : 202.134.0.155
  • eth1
    • ip address : 192.168.0.254
    • netmask : 255.255.255.0

2. Komputer Client 1:

  • Ip address : 192.168.0.1
  • netmask : 255.255.255.0
  • Deafult Getway : 192.168.0.254
  • DNS1 : 202.134.2.5
  • DNS2: : 202.134.0.155

KOMPUTER ROUTER
Komputer router berfungsi sebagai gateway bagi keluar masuknya data dalam jaringan 192.168.0.0/24.
Komputer ini mempunyai minimal 2 Ethernat cardt, Ethernat card pertama IP Address 192.168.4.97 dan Ethernar card kedua IP Address 192.168.0.254

Konfigurasi Ethernet :
1. Ethernet card pertama
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE= eth0
ONBOOT=yes
IPADDR=192.168.4.97
NETMASK= 255.255.255.224

2. Ethernet card kedua
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE= eth1
ONBOOT=yes
IPADDR=192.168.0.254
NETMASK= 255.255.255.0

3. Set Gateway
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=router.tkj.net
GATEWAY=192.168.4.126
GATEWAYDEV=eth0

untuk mengecek route : # route -n

3. Konfigurasi Host
# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.0.254 router.tkj.net router
192.168.4.97 gate.tkj.net gate
192.168.4.98 web.tkj.net web
192.168.4.99 mail.tkj.net mail
192.168.4.100 ftp.tkj.net ftp
192.168.0.253 samba.tkj.net samba

4. Konfigurasi Resolver
# vi /etc/resolv.conf
domain tkj,net
search tkj.net
namaserver 192.168.0.254

5. Cek insttalasi
restart konfigurasi :
# service network restart
# ping 192.168.4.126
#. ping yahoo.com

6. Bind
# /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: [ OK ]

#chkconfig –level 2345 named on
#

# /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down interface eth1: [ OK ]
Shutting down loopback interface: [ OK ]
Disabling IPv4 packet forwarding: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1: [ OK ]

7. Testing dengan cara ping ip eth1
# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=63 time=0.356 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=63 time=0.269 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=63 time=0.267 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=63 time=0.268 ms

— 192.168.0.1 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.267/0.290/0.356/0.038 ms

Tinggal Setting IP computer client dengan ketentuan di bawah ini :

IP: 192.168.0.2 – 192.168.0.254
GATEWAY: 192.168.0.1
NETMASK: 255.255.255.0
BROADCAST: 192.168.0.255
NAMESERVER: 192.168.0.1

misal :

Client01
===============================
IP: 192.168.0.2
GATEWAY: 192.168.0.1
NETMASK: 255.255.255.0
BROADCAST: 192.168.0.255
NAMESERVER: 192.168.0.1

Client02
===============================
IP: 192.168.0.3
GATEWAY: 192.168.0.1
NETMASK: 255.255.255.0
BROADCAST: 192.168.0.255
NAMESERVER: 192.168.0.1

dan seterusnya sesuai banyaknya client,yang berubah hanya IP
untuk client windows maka setting IP di bagian Start Menu/Setting/Control Panel/Network

setelah di setting ip client, maka coba ping ke 192.168.0.1 dari client,kalau berhasil berarti client dan serv nya sudah tersambung.

8. Setting serv supaya client bisa internat dengan menggunakan NAT

1.Matikan iptablesnya

# /etc/init.d/iptables stop
Flushing all chains: [ OK ]
Removing user defined chains: [ OK ]
Resetting built-in chains to the default ACCEPT policy: [ OK ]
#

2.Tambahkan iptables untuk Source NAt sesuai dengan ip di eth0
# /sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT –to-source 202.159.121.2
# /sbin/iptables-save > /etc/sysconfig/iptables
# /etc/init.d/iptables restart
Flushing all current rules and user defined chains: [ OK ]
Clearing all current rules and user defined chains: [ OK ]
Applying iptables firewall rules: [ OK ]
[root@serv root]# iptables-save

One thought on “Merancang LAN

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s