IP Forward ubuntu 9.10

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
Harizst
Posts: 27
Joined: 13 Feb 2010, 13:45
Location: Parapat, Indonesia
Contact:

IP Forward ubuntu 9.10

Postby Harizst » 16 Oct 2010, 01:23

saya sudah bisa menshare koneksi internet dengan memasukkan perintah sbb:

ifconfig eth0 192.168.1.100
ifconfig eth1 192.168.1.101
/etc/init.d/networking restart
iptables -t nat POSTROUTING -o eth1 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
/etc/init.d/networking restart

tapi setiap kali server mati/restart, harus disetting lagi seperti itu, kalo tidak koneksinya tidak bisa dishare... apa yang salah ya??
mohon bantuannya ya...
User avatar
thrvers
Posts: 4458
Joined: 01 Jan 2010, 13:28
Location: Jombang, Indonesia
Contact:

Re: IP Forward ubuntu 9.10

Postby thrvers » 16 Oct 2010, 05:24

'
kalau mau auto waktu habis restart/turn off

jangan pakai ifconfig :D
$ sudo gedit /etc/network/interfaces
[spoiler]

Code: Select all

auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 auto eth1 iface eth1 inet static address 192.168.1.101 netmask 255.255.255.0
[/spoiler]
$ sudo /etc/init.d/networking restart

terus yang satunya iptable masukin startup :D
$ sudo gedit /etc/rc.local
[spoiler]

Code: Select all

...... iptables -t nat POSTROUTING -o eth1 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward exit 0
[/spoiler]
restart sudah bisa langsung share :D

CMIIW
User avatar
Harizst
Posts: 27
Joined: 13 Feb 2010, 13:45
Location: Parapat, Indonesia
Contact:

Re: IP Forward ubuntu 9.10

Postby Harizst » 20 Oct 2010, 17:37

nggak bisa bro... udah sy coba, tapi malah nggak bisa konek samasekali... cuma LANnya aja yg konek
sebagai info, pengaturan ip address server sy:

eth0
IP : 192.168.1.100
netmask : 255.255.255.0
gateway : 192.168.1.1
DNS : 202.152.5.36

eth1
IP : 192.168.1.101
netmask : 255.255.255.0
gateway : 192.168.1.1
DNS : 202.152.5.36

gimana solusinya yach..
User avatar
blackshirt
Posts: 2336
Joined: 02 Jan 2010, 17:00
Location: Solo dan Kebumen
Contact:

Re: IP Forward ubuntu 9.10

Postby blackshirt » 20 Oct 2010, 18:09

echo 1 > /proc/sys/net/ipv4/ip_forward
perintah tersebut memang hanya sementara, yang akan hilang "pengaruhnya" saat direboot. biar permanen, tambahkan di /etc/sysctl.conf
net.ipv4.ip_forward = 1
User avatar
thrvers
Posts: 4458
Joined: 01 Jan 2010, 13:28
Location: Jombang, Indonesia
Contact:

Re: IP Forward ubuntu 9.10

Postby thrvers » 20 Oct 2010, 18:37

'
nggak bisa bro... udah sy coba, tapi malah nggak bisa konek samasekali... cuma LANnya aja yg konek
sebagai info, pengaturan ip address server sy:
[spoiler]eth0
IP : 192.168.1.100
netmask : 255.255.255.0
gateway : 192.168.1.1
DNS : 202.152.5.36

eth1
IP : 192.168.1.101
netmask : 255.255.255.0
gateway : 192.168.1.1
DNS : 202.152.5.36[/spoiler]
gimana solusinya yach..

Ada DNS juga yah :confused:
selama ini q DNS selalu gagal kalau q masukkan startup (rc.local), biasanya q masukkan manual ke /etc/resolv.conf
$ sudo su
[sudo] password for thrvers:
# echo "nameserver 202.152.5.36" > /etc/resolv.conf


------------------------------------------------------------------------------------------------------------------------------------------------
solusi lain (otomatis startup) pakai dnsmasq (thx to mastah):
  • $ sudo aptitude install dnsmasq
  • $ sudo gedit /etc/dhcp3/dhclient.conf
    hilangkan '#': prepend domain-name-servers 127.0.0.1;
  • $ sudo gedit /etc/dnsmasq.conf
    [spoiler]resolv-file=/etc/resolv.dnsmasq.conf
    listen-address=127.0.0.1
    dhcp-leasefile=/var/lib/misc/dnsmasq.leases
    cache-size=150[/spoiler]
  • $ sudo gedit /etc/resolv.dnsmasq.conf
    [spoiler]## DNS saja
    nameserver 202.152.5.36

    ## Speedy
    nameserver 180.131.144.144
    nameserver 180.131.145.145
    nameserver 192.168.1.1
    nameserver 202.134.0.155
    nameserver 203.130.196.155
    nameserver 125.160.4.82
    nameserver 202.134.0.61
    nameserver 203.130.196.5
    nameserver 222.124.198.150
    nameserver 222.124.249.115

    ## Google
    nameserver 8.8.8.8
    nameserver 8.8.4.4[/spoiler]
  • $ sudo /etc/init.d/dnsmasq restart
CMIIW
User avatar
MasDjo
Posts: 1260
Joined: 03 Jan 2010, 17:38
Location: Bayuangga City
Contact:

Re: IP Forward ubuntu 9.10

Postby MasDjo » 20 Oct 2010, 21:10

Bro harizt pake Ubuntu server atau lainnya ?
Susunan jaringan seperti apa ? ( modem, server, client )
Coba file /etc/network/interfaces di-copas disini biar jelas masalahnya.
User avatar
Harizst
Posts: 27
Joined: 13 Feb 2010, 13:45
Location: Parapat, Indonesia
Contact:

Re: IP Forward ubuntu 9.10

Postby Harizst » 29 Oct 2010, 16:03

Bro harizt pake Ubuntu server atau lainnya ?
Susunan jaringan seperti apa ? ( modem, server, client )
Coba file /etc/network/interfaces di-copas disini biar jelas masalahnya.
saya pake ubuntu 9.10 desktop mas... susunan jaringannya:
internet >> modem >> PC server >> router >> client2

sudah saya coba berbagai cara kayak diatas, tapi nggak berhasil buat settingan auto... malah klo saya coba networknya jadi nggak kedetect... gmn solusi yg bagus ya?
User avatar
MasDjo
Posts: 1260
Joined: 03 Jan 2010, 17:38
Location: Bayuangga City
Contact:

Re: IP Forward ubuntu 9.10

Postby MasDjo » 29 Oct 2010, 19:04

Ada baiknya anda lihat di Ubuntu Internet Sharing DHCP3
User avatar
danz0
Posts: 140
Joined: 19 Jan 2010, 12:37
Location: Suroboyo

Re: IP Forward ubuntu 9.10

Postby danz0 » 02 Nov 2010, 21:31

nggak bisa bro... udah sy coba, tapi malah nggak bisa konek samasekali... cuma LANnya aja yg konek
sebagai info, pengaturan ip address server sy:

eth0
IP : 192.168.1.100
netmask : 255.255.255.0
gateway : 192.168.1.1
DNS : 202.152.5.36

eth1
IP : 192.168.1.101
netmask : 255.255.255.0
gateway : 192.168.1.1
DNS : 202.152.5.36

gimana solusinya yach..
ko masi satu network gtu ya beda eth
g mending dipisah aj tu bro biar gampang kedepannya
btw suka2 jg si :D

trus coba solusi ini
tambahkan :
post-up iptables-restore > modem >> PC server >> router >> client2
[/b]
sudah saya coba berbagai cara kayak diatas, tapi nggak berhasil buat settingan auto... malah klo saya coba networknya jadi nggak kedetect... gmn solusi yg bagus ya? [/quote]

bisa diperjelas lagi topologinya mas?
knapa router harus melewati pc server?
disini fungsi pc server sebagai ap?

Who is online

Users browsing this forum: agnesnl2 and 2 guests