Sharing Internet di Linux

Saya akan membagikan tutorial sharing internet di linux dengan menggunakan iptables. Media yang saya gunakan kali ini adalah kabel lan. Langsung aja ke TKP.

interface yang akan digunakan untuk sharing internet adalah eth0 (kabel lan)
kom1 = slack + koneksi internet dengan interface ppp0
kom2 = backtrack
–setting pada kom1 :
#ifconfig eth0 192.168.1.1
merubah ip pada interface eth0

#route
cek routing untuk eth0, biasanya langsung ada routing untuk eth1 192.168.1.0

#nano /etc/resolv.conf
disana terlihat dns yang dipakaimisalkan : nameserver 8.8.8.8 (save di otak)

#iiptables -t nat -A POSTROUTING -s 192.168.0.1/16 -j MASQUERADE
Inti dari sharing koneksi, setiap akses dari ip 192.168.1.0/24 (opsi -s) akan dilakukan masquerading. Pada beberapa system ada yang menggunakan SNAT. Sharing koneksi dengan SNAT umumnya digunakan untuk koneksi dengan IP Publik statis, jika menggunakan IP dinamis (dial – up) Masquerading adalah pilihan tepat.

#iptables -t nat -A POSTROUTING -s 192.168.1.1/24
mengaktifkan ip forward, dalam hal ini ip 1.1 masuk, karena doi sebai route default gateway

#echo 1 > /proc/sys/net/ipv4/ip_forward
merubah nilai ip_forward menjadi 1 (true), tujuannya mengaktifkan penggunaan ip versi 4 (ipv4)

–setting pada komp2 :
#ifconfig eth0 192.168.1.2
merubah ip biar samaan gtu depannya

#route add default gw 192.168.1.1
menjadikan komp1 default gatwaynya

#nano /etc/resolv.conf
tambahkan dnsnya, samakan dengan komp1

#ping google.com
test koneksi

Catatan : kalo windows yang jadi komputer 2 nya tinggal di edit di network connectionnya samain dnsnya dan setting ipnya sendiri.

Cukup sekian dan trimakasih.

60 thoughts on “Sharing Internet di Linux”

  1. It appears to me that this web site doesnt download on a Motorola Droid. Are other folks getting the same issue? I like this web site and dont want to have to miss it when Im gone from my computer.

  2. It appears to me that this web site doesnt load in a Motorola Droid. Are other folks getting the same problem? I like this blog and dont want to have to skip it any time Im away from my computer.

  3. Whenever I originally left a comment I clicked on the Notify me when new comments are added checkbox and currently every time a remark is added I receive 4 emails with the exact same comment.

  4. Have you given any kind of consideration at all with translating your main webpage into German? I know a couple of of translaters here which would help you do it for free if you wanna make contact with me.

  5. I was basically wanting to know if you ever thought of switching the layout of your web site? Its well written; I really like what you have got to say. But maybe you can include a a bit more in the way of written content so people might connect to it better. Youve got an awful lot of wording for only having one or two photographs. Maybe you could space it out better?

  6. As soon as I initially commented I clicked on the Notify me when new comments are added checkbox and now each time a comment is added I get four emails with the exact same comment.

  7. If you dont mind, where do you host your web page? I am hunting for a good quality host and your weblog appears to be extremely fast and up just about all the time

  8. Do youve a spam concern on this site; I also am a blogger, and I was asking yourself your scenario; weve created some great strategies and we are searching to trade solutions with other individuals, be certain to shoot me an e-mail if interested.

  9. Have you given any thought at all with converting your current site in to French? I know a couple of translaters right here that will would help you do it for no cost if you want to make contact with me personally.

  10. Have you given any kind of thought at all with converting your blog into Spanish? I know a small number of translaters here that will would certainly help you do it for free if you want to make contact with me personally.

  11. It seems to me that this website doesnt load on a Motorola Droid. Are other folks having the same problem? I like this site and dont want to have to skip it when Im away from my computer.

  12. This is the right webpage for everyone who wishes to find out about this topic. You know so much its almost hard to argue with you (not that I actually would want to…HaHa). You certainly put a brand new spin on a subject that’s been written about for ages. Excellent stuff, just great!

  13. Hi! I know this is kinda off topic but I’d figured I’d ask. Would you be interested in trading links or maybe guest writing a blog article or vice-versa? My blog goes over a lot of the same topics as yours and I feel we could greatly benefit from each other. If you might be interested feel free to send me an e-mail. I look forward to hearing from you! Great blog by the way!

  14. I like the valuable info you supply in your articles.
    I will bookmark your blog and check once more right
    here regularly. I’m rather certain I will be told plenty of new stuff proper here!
    Good luck for the next!

Leave a reply to investigate motorbike games Cancel reply