share internet in ubuntu

Sharing Internet di Ubuntu – bahan dari pojokpradna.wordpress.com
1) Komputer Gateway pake Ubuntu 7.10 dengan 2 Ethernet card
Ethernet Card:
– eth0 tersambung ke swicth / LAN
IP 192.168.0.1 netmask 255.255.255.0
– eth1 tersambung ke ISP
IP dhcp
2) Klien dengan OS Ubuntu Desktop 7.04 (dan sebagian Xubuntu 7.10 dan UBuntu 7.10) dengan aturan IP:
– IP mulai 192.168.0.2 s/d 192.168.0.254
netmask 255.255.255.0
gateway 192.168.0.1
3) Setting Server:
– Eth0
Di menu System => Network => Wired Connection (eth0) => Properties => Hilangkan tanda check di”Enable Roaming” => Configuration diisi dengan “Static IP Addres” => IP Address 192.168.0.1 => Subnet Mask => 255.255.255.0 => Gateway Addres 192.168.1.1
– Eth1
Di menu System => Network => Wired Connection (eth1) => Properties => Hilangkan tanda check di”Enable Roaming” => Configuration diisi dengan “Automatic Configuration (DHCP)”
– Di Tab DNS => DNS Server di”Add” dengan 192.168.1.1
4) Kemudian mengaktifkan ip_forward, dengan perintah di Terminal:
$echo 1 > /proc/sys/net/ipv4/ip_forward
5) Mengaktifkan NAT dengan iptables
$iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
6) Memasang IPMASQ dan DNSMASQ untuk caching NS:

$sudo apt-get install dnsmasq ipmasq
Untuk mengkonfigurasi IPMASQ:
$dpkg-reconfigure ipmasq
8) DNSMASQ dijalankan:
$/etc/init.d/dnsmasq start
9) Restart network:
$/etc/init.d/networking restart
10) Setting for Client:
-Eth0
Di menu System => Network => Wired Connection (eth0) => Properties => Hilangkan tanda check di”Enable Roaming” => Configuration diisi dengan “Static IP Addres” => IP Address 192.168.0.2 (dan seterusnya untuk masing2 Client) => Subnet Mask => 255.255.255.0 => Gateway Addres 192.168.0.1
– Di Tab DNS => DNS Server di”Add” dengan 192.168.1.1
the end.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.