sharing internet ip forwarding iptables

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
NEW_BIE
Posts: 1
Joined: 16 Aug 2011, 09:20
Location: Indonesia

sharing internet ip forwarding iptables

Postby NEW_BIE » 14 Jun 2012, 19:26

om om yang udah mastah, saya mau tanya kalo ip forwarding sharing internet pake iptables gimana caranya ya? saya pake ubuntu 11.04.
eth0 (internet) = 192.168.0.23
eth1 (LAN ke client) = 192.168.5.1
saya udah konfigurasi sysctl.conf (net.ipv4.ip_forward=1).
saya jg udah sempet coba pake
iptables -t NAT -A POSTROUTING -o eth0 MASQUERADE
malah keluar warning
"cant initialize iptables table NAT. table does not exist...."
saya baru pertama pake ubuntu tolong yaa,makasih sebelumnya. :grin:
User avatar
yudiarbi
Posts: 627
Joined: 22 Mar 2011, 09:31
Location: Probolinggo, Jawa Timur
Contact:

Re: sharing internet ip forwarding iptables

Postby yudiarbi » 16 Jun 2012, 09:45

kalo modemnya mode bridge :

Code: Select all

iptables -t NAT -A POSTROUTING -o ppp0 -j MASQUERADE

kalo mode pppoe

Code: Select all

iptables -t NAT -A POSTROUTING -o eth0 -j MASQUERADE
User avatar
sayed
Posts: 137
Joined: 21 Jul 2011, 16:19
Location: Lhokseumawe, Aceh
Contact:

Re: sharing internet ip forwarding iptables

Postby sayed » 12 Jul 2012, 23:17

klo masquerading tu interface ke internet ya???

klo misal ga pake option network interfacenya kira2 bisa jalan ga masquerade nya?
User avatar
agungmitnick
Posts: 7
Joined: 12 Jan 2011, 10:48
Location: tangerang, indonesia
Contact:

Re: sharing internet ip forwarding iptables

Postby agungmitnick » 13 Jul 2012, 15:09

coba pake ini deh
# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

bisa gak bisanya kabarin ya hehe :D
User avatar
semut
Posts: 455
Joined: 05 Jul 2010, 19:15
Location: kendal,Indonesia
Contact:

Re: sharing internet ip forwarding iptables

Postby semut » 13 Jul 2012, 22:57

yudiarbi wrote:kalo modemnya mode bridge :

Code: Select all

iptables -t NAT -A POSTROUTING -o ppp0 -j MASQUERADE

kalo mode pppoe

Code: Select all

iptables -t NAT -A POSTROUTING -o eth0 -j MASQUERADE

kyk'e kebalik nih om..
User avatar
agus_sintang
Posts: 150
Joined: 28 Jun 2011, 16:47
Location: Surabaya, Indonesia
Contact:

Re: sharing internet ip forwarding iptables

Postby agus_sintang » 14 Jul 2012, 05:04

semut wrote:
yudiarbi wrote:kalo modemnya mode bridge :

Code: Select all

iptables -t NAT -A POSTROUTING -o ppp0 -j MASQUERADE

kalo mode pppoe

Code: Select all

iptables -t NAT -A POSTROUTING -o eth0 -j MASQUERADE

kyk'e kebalik nih om..

hehe, iya ada yang kebalik nih kayaknya,
User avatar
sayed
Posts: 137
Joined: 21 Jul 2011, 16:19
Location: Lhokseumawe, Aceh
Contact:

Re: sharing internet ip forwarding iptables

Postby sayed » 16 Jul 2012, 23:06

NEW_BIE wrote:iptables -t NAT -A POSTROUTING -o eth0 MASQUERADE
"cant initialize iptables table NAT. table does not exist...."


itu masalahnya cuma text "NAT" harus huruf kecil jd "nat"

iptables -t nat -A POSTROUTING -o (interface yang terhubung ke internet) -j MASQUERADE

Return to “Ubuntu Server”

Who is online

Users browsing this forum: No registered users and 6 guests