Laptop anda = 10.0.0.2 ( gatewaye 10.0.0.1 iaitu ETH1 )
ETH1 = 10.0.0.1
perkara pertama, kita perlu enablekan ip forwarding di dalam Linux. edit fail /etc/systcl.conf dan ubah mengikut konfigurasi di bawah.
[root@hotspot ~]# vi /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
# ubah jadi 1 ( default =0 )
net.ipv4.ip_forward = 1
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
Kemudian, create satu script bernama route.sh dan masukkan data berikut :
route.sh
# firewall.sh
/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t mangle -F
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Kemudian laksanakan arahan berikut
sh route.sh
kemudian cuba ping google.com melalui Laptop anda. sepatutnya anda boleh ping ke Google.com
route.sh tuh nk save kat ne??
ReplyDeleteletak dalam /root/route.sh
ReplyDeletekemudian chmod +x /root/route.sh
kemudian sh /root/route.sh
last sekali cuba tengok /sbin/service iptables status
bro..
ReplyDeletetutorial 1st aku dah berjaya..
tp bab 2 tak lepas..
command taktau nak edit cmne..
file tu dah bkk..nak ubah ape command nak edit nye..
kena pakai ctrl+(hruf) ke utk write out,save,edit,dll..
ajar bro..
bukan ke bila dah set
ReplyDeletenet.ipv4.ip_forward = 1
dalam /etc/sysctl.conf maka router dah set sebagai router.
rasanya tak perlu lagi utk masukkan
echo 1 > /proc/sys/net/ipv4/ip_forward
ke dalam file route.sh.
kenapa tak edit je file /etc/sysconfig/iptables?
ReplyDeletemasukkan rules ni:
*nat
:PREROUTING ACCEPT [41:3192]
:POSTROUTING ACCEPT [28:1680]
:OUTPUT ACCEPT [31:1904]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
*filter
......
......
asyik nak kena masukkan
ReplyDelete~]#sh run route.sh
bila restart comp..
Ada cara nak kekalkan tak???
cara lain selepas running route.sh
ReplyDeleteboleh guna /sbin/service/uptables save
atau
letak dalam /etc/rc.d/rc.local
#!/bin/sh
sh /root/route.sh
spam...spam..spam..spam..spam...spam.spam..spam..spam...spam
ReplyDeleteaku sebenarnya boring...
spam...spam..spam..spam..spam...spam.spam..spam..spam...spam
ReplyDeleteaku sebenarnya boring...
redtube.com
ReplyDeleteredtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
redtube.com
www.utusan.com.my
ReplyDeletewww.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my
www.utusan.com.my