Setting ip address, dan NAT di linux fedora core 6:
Setting IP
#Setting ip public di eth0
[root@codar ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0A:5E:53:E3:5D
ONBOOT=yes
IPADDR=203.84.137.19
NETMASK=255.255.255.192
GATEWAY=203.84.137.1
Tekan “I” untuk insert dan “:wq!” untuk save dan quit
Setting DNS
-isi resolv.conf dengan dns dari isp
[root@codar ~]# vi /etc/resolv.conf
nameserver 203.84.136.2
nameserver 203.84.140.4
Tekan “I” untuk insert dan “:wq!” untuk save dan quit
-restart network
[root@codar ~]# /etc/init.d/network restart
-test ping yahoo-seharusnya sudah bisa tuh-
#setting ip local di eth1
-setting ip
[root@codar ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
HWADDR=00:80:48:42:E2:56
ONBOOT=yes
IPADDR=192.168.0.1
NETMASK=255.255.255.0
#setting nat
-matikan iptables dulu
[root@codar ~]# /etc/init.d/iptables stop
-lalu tambahkan iptables untuk source NAT
[root@codar ~]# iptables -t nat -A POSTROUTING -j MASQUERADE
---atau kalo itu ga bisa, tambahin command menjadi ---
[root@codar ~]# iptables -t nat -A POSTROUTING –o eth0 -j MASQUERADE
-terus save iptables nya
[root@codar ~]# /etc/init.d/iptables save
-kemudian ubah ip_forward
[root@codar ~]# vi /etc/sysctl.conf
-== semula ==-
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
-==menjadi==-
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
-terus disabled selinux nya
[root@codar ~]# vi /etc/sysconfig/selinux
SELINUX=disabled
-terahir restart networknya
[root@codar ~]# /etc/init.d/network restart
-setting ip untuk di komp klient
IP : 192.168.0.2 - 192.168.0.254
GATEWAY : 192.168.0.1
NETMASK : 255.255.255.0
NAMESERVER1 : 203.84.136.2
NAMESERVER2 : 203.84.140.4
--sampe disini komp klient sudah bisa koneksi —
SETTING DHCP CLIENT
# install dhcp
- apus dhcp sebelumnya [kalo ada]
-kita liat dulu
[root@codar ~]# rpm -qa |grep dhcp
dhcpv6_client-0.10-32.fc6
dhcp-3.0.5-4.fc6
-kita apus aja
[root@codar ~]# rpm -e dhcp-3.0.5-4.fc6
-baru install ulang [biar mulai dari nol ]
[root@codar ~]# yum -y install dhcp
-copy dhcp ke dir /etc/dhcp.conf
[root@codar ~]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
- edit dhcp.conf
[root@codar ~]# vi /etc/dhcpd.conf
ddns-update-style none;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.0.1; <-- sesuai ip eth1
option subnet-mask 255.255.255.0;
option nis-domain "codar.org";
option domain-name "codar.org";
option domain-name-servers 203.84.136.2, 203.84.140.4; <- sesuai dns isp
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
#[baris yg lain nya di kasih tanda pagar(#) aja di awal baris]
-terus idupin dhcp nya
[root@codar ~]# /etc/init.d/dhcpd start
-=kalo settingan dhcp.conf nya dah bner, seharus nya dah ok tuh bro=-
0 comments:
Post a Comment