1.Minta IP public ke ISP lengkap dengan netmask,broadcast dan dns nyamisalnya :
IP: 202.169.229.25 GATEWAY : 202.169.229.1 Netmask: 255.255.255.192
broadcast : 202.192.224.63 DNS1: 202.169.224.3 DNS2: 202.169.224.42
Menentukan IP local yang akan kita gunakan buat client Setting IP server :
1.[root@serv root]$ vi /etc/sysconfig/networklalu isi dengan :
NETWORKING=yes
HOSTNAME=serv.domain.com
GATEWAY=202.169.229.1
lalu simpan dengan menekan :wq
2.Menconfigurasi IP eth0(default)[root@serv root]$ vi /etc/sysconfig/network-scripts/ifcfg-eth0lalu isi dengan: DEVICE=eth0 BOOTPROTO=static IPADDR=202.169.229.25 BROADCAST=202.169.229.63 NETMASK=255.255.255.192 ONBOOT=yes USERCTL=no.
lalu simpan dengan menekan :wq
3.Setting dns resolve[root@serv root]$ vi /etc/resolve.conf lalu isi dengan name server dari isp kita tadi: name server 202.169.224.3 name server 202.169.224.4 lalu simpan dengan menekan :wq
4.Setting ip_forwarding[root@serv cachak]$ vi /etc/sysctl.conf rubah net.ipv4.ip_forward = 0 menjadi net.ipv4.ip_forward = 1 atau kalau tidak ada net.ipv4.ip_forward = 0 tambahin net.ipv4.ip_forward = 1 simpan dengan menekan :wq
5.Restart network[root@serv cachak]$ /etc/init.d/network restart
Shutting down interface eth0: [ 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 ]
[root@www root]#chkconfig –level 2345 network on[root@www root]#
6.Testing dengan ping ke default gateway 202.169.229.1 [root@serv root]
ping 202.159.121.1
Pinging 202.169.229.1
with 32 bytes of data:
Reply from 202.169.229.1 : bytes=32 time=10ms TTL=63
Reply from 202.169.229.1: bytes=32 time=10ms TTL=63
Reply from 202.169.229.1: bytes=32 time=10ms TTL=63
Reply from 202.169.229.1: bytes=32 time=10ms TTL=63
Ping statistics for 202.169.229.1:Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 10ms, Average = 10ms7.
Testing untuk ngeping google.com untuk ngecek dns-nya kalau muncul :
PING google.com (216.239.39.99) 56(84) bytes of data, berarti dns kita untuk server sudah bekerja, tapi kalau muncul :
ping: unknown host google.com. berarti dns yang kita isikan di /etc/resolve.conf masih salah, silahkan cek lagi ke ISP-nya (bereskan sudah setting IP untuk servernya) supaya server ini bisa sekaligus di gunakan sebagai dns server oleh client maka harus di install daemon bind atau daemon name server yang lain atau kalau sudah ada tinggal dinyalakan
Bind nya [root@www root]# /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: [ OK ][root@www root]#chkconfig –level 2345
named on[root@www root]#
misalnya ip ke client adalah :192.168.0.1/24IP : 192.168.0.1
netmask : 255.255.255.0broadcast : 192.168.0.255
RANGE IP CLIENT : 192.168.0.2-192.168.0.254
Setting ip untuk eth1 (yang ke client) :
1.memberi IP 192.168.0.1 di eth1[root@serv cachak]$ vi /etc/sysconfig/network-scripts/ifcfg-eth1 lalu isi dengan :
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.1
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
ONBOOT=yes
USERCTL=no
lalu simpan dengan menekan :wq
2.Restart networknya [root@serv root]$ /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 ]
3.Testing dengan cara:
ping ip eth1[root@serv cachak]$ 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 ms64
bytes from 192.168.0.1: icmp_seq=2 ttl=63 time=0.269 ms64
bytes from 192.168.0.1: icmp_seq=3 ttl=63 time=0.267 ms64
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 2997msrtt 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.3GATEWAY: 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 servernya sudah tersambung.
Setting server supaya client bisa internet dengan menggunakan NAT.
1.Matikan ip tablesnya[root@serv root]# /etc/init.d/iptables stopFlushing all chains: [ OK ]Removing user defined chains: [ OK ] Resetting built-in chains to the default ACCEPT policy: [ OK ][root@serv root]#
2.Tambahkan iptables untuk Source NAt sesuai dengan ip di eth0[root@serv root]# /sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT –to-source 202.159.121.2[root@serv root]# /sbin/iptables-save > /etc/sysconfig/iptables[root@serv root]# /etc/init.d/iptables restartFlushing 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.
Sekian dari saya. Trima Kasih .
0 komentar:
Posting Komentar