Seting-Router-Linux-Standart

TOP del.icio.us

Pertama yang harus di lakukan adalah mensetting mgw(main gateway) supaya bisa connect ke internet. Sebelum Mensetting :

1. Minta IP public ke ISP lengkap dengan netmask,broadcast dan dns-nya misalnya :

RANGE : 202.159.121.0/29

IP : 202.159.121.2

GATEWAY : 202.159.121.1

Nemast : 255.255.255.248

Broadcast : 202.159.121.7

DNS1 : 202.159.0.10

DNS2 : 202.159.0.20

berarti kita mendapatkan ip 5 buah dari 202.159.121.2 - 202.159.121.6

2. Menentukan IP local yang akan kita gunakan buat client

Setting IP MGW : [root@mgw kiki]$ vi /etc/sysconfig/network

lalu isi dengan :

NETWORKING=yes

HOSTNAME=mgw.domain.com

GATEWAY=202.159.121.1

lalu simpen dengan menekan :wq

3. Menconfigurasi IP eth0(default)

[root@mgw root]$ vi /etc/sysconfig/network-scripts/ifcfg-eth0

lalu isi dengan :

DEVICE=eth0

BOOTPROTO=static

IPADDR=202.159.121.2

BROADCAST=202.159.121.7

NETMASK=255.255.255.249

onfiltered=yes

USERCTL=no

lalu simpen dengan menekan :wq

4. Setting dns resolve

[root@mgw root]$ vi /etc/resolve.conf

lalu isi dengan nameserver dari isp kita tadi :

nameserver 202.159.0.10

nameserver 202.159.0.20

lalu simpen dengan menekan :wq

5. Setting ip_forwarding

[root@mgw kiki]$ vi /etc/sysctl.conf

rubah net.ipv4.ip_forward = 0 menjadi net.ipv4.ip_forward = 1

atau kalau gak ada net.ipv4.ip_forward = 0 tambahin net.ipv4.ip_forward = 1

simpen dengan menekan :wq

6. Restart network

[root@mgw kiki]$ /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]#

7. Testing dengan ngeping ke default gateway 202.159.121.1

[root@mgw kiki]$ ping 202.159.121.1

PING 202.159.121.1 (202.159.121.1) 56(84) bytes of data.

64 bytes from 202.159.121.1: icmp_seq=1 ttl=63 time=0.356 ms

64 bytes from 202.159.121.1: icmp_seq=2 ttl=63 time=0.269 ms

64 bytes from 202.159.121.1: icmp_seq=3 ttl=63 time=0.267 ms

64 bytes from 202.159.121.1: icmp_seq=4 ttl=63 time=0.268 ms

— 202.159.121.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

8. 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 mgw dah 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. Nah bereskan sudah setting IP untuk mgw-nya, supaya mgw ini bisa sekaligus digunakan sebagai dns server oleh client maka harus di install daemon bind atau daemon nameserver yang lain atau kalau sudah ada tinggal hidupkan 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/24

IP : 192.168.0.1

Netmask : 255.255.255.0

Broadcast : 192.168.0.255

RANGE IP CLIENT : 192.168.0.2-192.168.0.254

1. Setting ip untuk eth1 (yang ke client)

[root@mgw kiki]$ 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

onfiltered=yes

USERCTL=no

lalu simpen dengan menekan :wq

2. Restart networknya

[root@mgw 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@mgw kiki]$ 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 MGW nya sudah tersambung.

Setting MGW supaya client bisa internet dengan menggunakan NAT

1. Matikan iptablesnya

[root@mgw root]# /etc/init.d/iptables stop

Flushing all chains: [ OK ]

Removing user defined chains: [ OK ]

Resetting built-in chains to the default ACCEPT policy: [ OK ]

[root@mgw root]#

2. Tambahkan iptables untuk Source NAt sesuai dengan ip di eth0

[root@mgw root]# /sbin/iptables -t nat -A POSTROUTING -o eth0 -s

192.168.0.0/24 -j SNAT –to-source 202.159.121.2

[root@mgw root]# /sbin/iptables-save > /etc/sysconfig/iptables

[root@mgw root]# /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@mgw root]# iptables-save

SNAT sudah,SNAT disini standar sekali dan gak ada proteksi untuk mengetestnya kita browser di client lalu buka google.com, kalau jalan berati kita sudah berhasil :) .

Wassallam

43 comments to “Seting-Router-Linux-Standart”

  1. Comment by Medley:

    WOW. experd bgt nieh kayanya. hehehe muantabs buangets dech.

    Share ke gw donk ilmunya ;))

    emang berat deh kl baca tulisannya kiki.

    btw visit ke my blog donk. Tapi jgn di hina cos masih tingkat teri nih ;))

  2. Comment by wowgold:

    wow gold tks

  3. Comment by cialis:

    Hello!
    cheap cialis ,

  4. Comment by CHARLES:

    < blockquote >< a href=”http://pillspot.org/”>PillSpot.org. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. High quality drugs. Buy drugs online< /a >…

    Buy:Nexium.Prevacid.Petcam (Metacam) Oral Suspension.Accutane.100% Pure Okinawan Coral Calcium.Synthroid.Zyban.Arimidex.Actos.Retin-A.Prednisolone.Lumigan.Valtrex.Human Growth Hormone.Zovirax.Mega Hoodia….

  5. Comment by loan:

    Your website is very great. I enjoyed your website a lot. Thank you.

  6. Comment by Goldvish:

    Whilst this topic is usually extremely touchy for most people, my opinion is the fact that there has being a middle or common ground that we all can uncover. I do appreciate that youve added relevant and intelligent commentary below though. Thank you!

  7. Comment by toronto payday loans:

    ciputnet.com is great! Payday loans for bad credit are offering financial help to the poor creditors The absence of credit checks makes the bad creditors eligible for the desired funds

  8. Comment by posyseagr:

    iii countries stabilization

  9. Comment by brookcover:

    warmer growth pattern ocean

  10. Comment by chanel handbags:

    You write very detailed,Pay tribute to you.Couldn’t be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!

  11. Comment by Marchelle Croson:

    This post is great.

  12. Comment by justin bieber converts to scientology:

    Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.

  13. Comment by http://davidvielmetter.com/?p=1196:

    Advantageously, the post is in reality the freshest topic on curing acne naturally. I concur with your conclusions and will thirstily look forward to your upcoming updates. Just saying thanks will not just be enough, for the phenomenal clarity in your writing. I will right away grab your rss feed to stay abreast of any updates.

  14. Comment by Obama Signs Unemployment Extension 2010:

    Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.

  15. Comment by Revenge Of The Bridesmaids ABC:

    I love reading and I am always searching for informative information like this! You are bookmarked!. . . . . .

  16. Comment by Amanda Bynes Hot:

    I wanted to thank you for this great read!! I definitely enjoying every little bit of it.I have you bookmarked to check out new stuff you post.

  17. Comment by Hong Kong Holidays – Hong Kong Hotels Cheap:

    I have some trouble to subscribe the rss feed, anyway I’ve bookmarked this site, is very useful and full of informations.

  18. Comment by Justin Bieber Arrested Video:

    Finding websites with as much information as this one is always a pleasure I wll be sure to come back and visit again real soon, keep up the good work.

  19. Comment by The Sorcerer's Apprentice The Movie:

    I really like your site and i really appreciate the excellent quality content you are posting here for free for your online readers. Can you tell us which blog platform you are using?

  20. Comment by tempe town lake dam break:

    Wow, very interesting article. It’s funny how history can be twisted in so many different ways. These photos certainly give us clues, but I guess we’ll never know the true story. . . .

  21. Comment by lenen:

    U wilt geld lenen zonder BKR toetsing? De opties hiervoor worden groter, kijk verder en ontdek hoe u wél geld kunt lenen, snel & eenvoudig.

  22. Comment by gardening for beginners:

    I am just making a blog related to this. If you allow, I would like to use some of your content. And with full refernce of course. Thanks in advance.

  23. Comment by difference between hiv and aids:

    Hi I found your site by mistake when i was searching yahoo for this acne issue, I must say your site is really helpful I also love the design, its amazing!. I don’t have the time at the moment to fully read your site but I have bookmarked it and also add your RSS feeds. I will be back in a day or two. thanks for a great site.

  24. Comment by gardening for beginners:

    This is a really good read for me. Must admit that you are one of the coolest bloggers I ever saw. Thanks for posting this informative article.

  25. Comment by folfox chemotherapy:

    I was just browsing for relevant blog posts for my project research and I happened to stumble upon yours. Thanks for the useful information!

  26. Comment by Jake Ruston:

    Cheers for this post, it was great to read.

  27. Comment by Electrostatic Air Purifier:

    Aw, this was a really quality post. In theory I’d like to write like this too - taking time and real effort to make a good article… but what can I say… I procrastinate alot and never seem to get something done.

  28. Comment by Filterless Air Purifier:

    I’ve read some good stuff here. Definitely worth bookmarking for revisiting.

  29. Comment by Honeywell HEPA air purifier:

    Thank you so much for this valuable information. Very useful indeed. . . . .

  30. Comment by Hunter Air Purifier Filters:

    I’ve read some good stuff here. Definitely worth bookmarking for revisiting.

  31. Comment by pletoully:

    I enjoyed reading your blog. Keep it that way.

  32. Comment by Junior Pattillo:

    This post is interesting.

  33. Comment by Autumn Newbury:

    This is a usefull post.

  34. Comment by Rosette Feldner:

    Hi, I wish to let all of you bloggers / internet users know about a whole new Search Engine called Braxea. Its pretty dam cool… It combines Google, Bing and Yahoo into one and in addition lets you search for videos on YouTube and News throughout the net. Maybe this will end up being the new Google ?

  35. Comment by online payday loans:

    Your web publication is very useful. Say thanks to you very much for providing a huge amount of beneficial critical information. I am going to bookmark your blog website and will be most definitely coming back. Yet again, I recognize the value of your work together with delivering much effective answers to the followers.

  36. Comment by UGG:

    Nice stuff. I will come back again soon to read some more.

  37. Comment by tiffany:

    interesting post, pretty much covered it all for me, thanks.

  38. Comment by Curtain:

    Cotton http://zasiangje.AUTOTECHGUIDE.INFO/tag/Cotton+Curtain+panel+wooden/ : Curtain…

    Curtain…

  39. Comment by mbt schuhe:

    Absolutely brilliant post guys, been following your blog for 3 days now and i should say i am starting to like your post. and now how do i subscribe to your blog?

  40. Comment by payday loans:

    Thanks for good news! Your site is very useful for me. I bookmarked your site!

  41. Comment by payday loans:

    Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.

  42. Comment by toronto loans:

    Find Payday Loan Bay Street, Toronto, ON M5H 2Y3 (416) 477-2742

  43. Comment by financial spread betting:

    If the underlying share price moved disastrously against you overnight, for example, you might lose the whole of your investment if you had bought the share. However, if you had placed a bet on the share and you had imposed a guaranteed stop-loss limit, you would limit your loss to a predetermined amount. A stop-loss is exactly what it is called - a limit to the amount you might lose. On the other hand, there is no limit to the amount you might win. Financial spread betting provides a simple, tax-free* way to profit from rising and falling prices on a range of different markets. As a world leader in spread betting for 35 years, IG Index is the UK’s largest and longest running financial spread betting company. With IG Index you can take positions on forex pairs, global stock indices, over 7000 shares, commodities, binary bets and more Financial Spread Betting is the most efficient leverage tool for traders, in the financial markets. Traders have the opportunity to trade with no real ownership in the market. Explore the Financial Spread Betting markets and learn how to trade successfully.As current or future investors you are well aware of the fact that in order to trade in the financial market you need to own or be a part of it as far as investment of money goes. With Financial Spread Betting the story is different.This is your chance to get involved in the stock market or in any other financial market with a value such as gas, oil gold and so on, without actually being invested. This is not only convenient financially but also requires less effort as far as bureaucracy goes.So what is Financial Spread Betting anyway?Financial Spread betting enables the trader to lay an over / under bet with the ability to minimize the risks and optimize the profits by ending the bet as soon as it goes the other way around from the bet (stop loss) or getting out while you are ahead.Financial Spread Betting is available for various products including shares, currency exchange, commodities and just about anything with a value.The spread is the difference between the bid and the offer price for example taking the apple stock and placing a bet that it will rise (go long) and it indeed rise, then you will get your bet times the number of points it went up.Financial spread betting is gaining popularity in Europe and mainly in the UK. Even though it existed for years, it is now becoming available online and much like other new trends online, many companies are seeking the opportunity of catching customers by offering lucrative incentive offers such as welcome bonus.

Leave a Reply