Cara Membuat Virtual IP Ubuntu Server ?

Diskusi tentang Ubuntu Server baik webserver, database server, samba server dan service lainnya serta jaringan menggunakan Sistem Operasi Ubuntu.
User avatar
coker87
Posts: 82
Joined: 31 Jul 2012, 17:41
Location: /home/bekasi
Contact:

Cara Membuat Virtual IP Ubuntu Server ?

Postby coker87 » 16 May 2013, 11:58

Agan-agan sekalian numpang nanya donk, saya mau membuat dalam satu web server dengan dua aplikasi/website dengan ip yg berbeda... Sample web menggunakan (lampp/apache/mysql). nah yang saya ingin tanyakan bagaimana yah caranya?? apakah menggunakan virtual ip? bagaimana cara membuat vrtual ip di ubuntu server???
Terima Kasih.. mohon bimbingannya yah gan :D
User avatar
antoniusgenta
Posts: 103
Joined: 29 Dec 2011, 14:40
Location: jakarta

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby antoniusgenta » 16 May 2013, 15:18

coker87 wrote:Agan-agan sekalian numpang nanya donk, saya mau membuat dalam satu web server dengan dua aplikasi/website dengan ip yg berbeda... Sample web menggunakan (lampp/apache/mysql). nah yang saya ingin tanyakan bagaimana yah caranya?? apakah menggunakan virtual ip? bagaimana cara membuat vrtual ip di ubuntu server???
Terima Kasih.. mohon bimbingannya yah gan :D


berikut contoh ip static yg berada di dalam interface eth0

auto lo eth0
iface lo inet loopback
iface eth0 inet static
address xxx.xxx.xxx.xxx(masukan ip address disini)
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx(masukan gateway disini)
broadcast xxx.xxx.xxx.xxx

dan berikut contoh ip virtualnya

auto lo eth0:0
iface eth0:0 inet static
address xxx.xxx.xxx.xxx(masukan ip virtual disini)
netmask xxx.xxx.xxx.xxx

apabila sudah dientry secara benar restart interface networknya
lalu cek dengan ifconfig -a, kalo sudah muncul berarti sudah benar dan lakukan ping ke ip virtual tersebut

note: gateway yg dipakai hanya 1 gateway saja

salam
genta
User avatar
coker87
Posts: 82
Joined: 31 Jul 2012, 17:41
Location: /home/bekasi
Contact:

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby coker87 » 17 May 2013, 14:40

makasih bang genta tanggapannya.. :D sory bang genta... saya sudah lakukan seperti perintah yang diatas, tapi saya mengalami masalah error seperti ini setelah dilakukan restart service networknya :

Code: Select all

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                         
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]


hehehe...
User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby q_p » 17 May 2013, 15:00

Pastekan di sini saja isi file /etc/network/interfaces anda :)
User avatar
coker87
Posts: 82
Joined: 31 Jul 2012, 17:41
Location: /home/bekasi
Contact:

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby coker87 » 17 May 2013, 15:16

mirip kaya gtu bang sekarang... kaya yang dikasih bang genta...

uto lo eth0
iface lo inet loopback
iface eth0 inet static
address xxx.xxx.xxx.xxx(masukan ip address disini)
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx(masukan gateway disini)
broadcast xxx.xxx.xxx.xxx

dan berikut contoh ip virtualnya

auto lo eth0:0
iface eth0:0 inet static
address xxx.xxx.xxx.xxx(masukan ip virtual disini)
netmask xxx.xxx.xxx.xxx

nah errornya ini yg kaya diatas.. hehe
User avatar
antoniusgenta
Posts: 103
Joined: 29 Dec 2011, 14:40
Location: jakarta

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby antoniusgenta » 17 May 2013, 15:20

coker87 wrote:makasih bang genta tanggapannya.. :D sory bang genta... saya sudah lakukan seperti perintah yang diatas, tapi saya mengalami masalah error seperti ini setelah dilakukan restart service networknya :

Code: Select all

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                         
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]


hehehe...


Memang sy kasih hrs ada edit dikit hehehhe ini tapi udah googling belum
kalo ga nemu sy jawab

ga usah pake "lo" di virtual ip nya hapus saja..hy " lo "yg dihapus ya
kalo udah solve posting ya..

salam
genta
User avatar
coker87
Posts: 82
Joined: 31 Jul 2012, 17:41
Location: /home/bekasi
Contact:

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby coker87 » 17 May 2013, 15:26

antoniusgenta wrote:
coker87 wrote:makasih bang genta tanggapannya.. :D sory bang genta... saya sudah lakukan seperti perintah yang diatas, tapi saya mengalami masalah error seperti ini setelah dilakukan restart service networknya :

Code: Select all

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                         
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]


hehehe...


Memang sy kasih hrs ada edit dikit hehehhe ini tapi udah googling belum
kalo ga nemu sy jawab

ga usah pake "lo" di virtual ip nya hapus saja..hy " lo "yg dihapus ya

salam
genta


sudah saya hapus bang.. hehe, malah timbul error beda??
seperti ini errornya :

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces... RTNETLINK answers: File exists
Failed to bring up eth0.
RTNETLINK answers: File exists
Failed to bring up eth0:0.
User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby q_p » 17 May 2013, 15:51

Isi file /etc/network/interfaces pastekan di sini saja mas
User avatar
antoniusgenta
Posts: 103
Joined: 29 Dec 2011, 14:40
Location: jakarta

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby antoniusgenta » 17 May 2013, 15:54

coker87 wrote:
antoniusgenta wrote:
coker87 wrote:makasih bang genta tanggapannya.. :D sory bang genta... saya sudah lakukan seperti perintah yang diatas, tapi saya mengalami masalah error seperti ini setelah dilakukan restart service networknya :

Code: Select all

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                         
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:17: interface lo declared allow-auto twice
ifup: couldn't read interfaces file "/etc/network/interfaces"
[fail]


hehehe...


Memang sy kasih hrs ada edit dikit hehehhe ini tapi udah googling belum
kalo ga nemu sy jawab

ga usah pake "lo" di virtual ip nya hapus saja..hy " lo "yg dihapus ya

salam
genta


sudah saya hapus bang.. hehe, malah timbul error beda??
seperti ini errornya :

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces... RTNETLINK answers: File exists
Failed to bring up eth0.
RTNETLINK answers: File exists
Failed to bring up eth0:0.



coba lampirkan disini confignya mas utk interfacenya biar saya bantu, disaya berjalan normal soalnya,,
ganti pake eth0:1
dicoba dulu dech

kl gak bisa gelar confignya disini

salam
genta
User avatar
coker87
Posts: 82
Joined: 31 Jul 2012, 17:41
Location: /home/bekasi
Contact:

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby coker87 » 17 May 2013, 16:12

ini dalem isi dalam /etc/network/interface

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The primary network interface
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 10.x.x.x
netmask 255.255.255.0
network 10.x.x.0
broadcast 10.x.x.255
gateway 10.x.x.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.x.x.x
dns-search x.com

auto eth0:0
iface eth0:0 inet static
address 10.x.x.x
netmask 255.255.255.0
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.x.x.x
dns-search x.com
User avatar
q_p
Posts: 3109
Joined: 14 Oct 2012, 13:01
Contact:

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby q_p » 17 May 2013, 17:03

Coba Anda cek lagi isi file =
[color:#000099]/etc/network/interfaces[/color]
bukan =
[color:#3366FF]/etc/network/interface[/color]

Kemudian pada file [color:#000099]/etc/network/interfaces[/color], ubah seperti di bawah ini. Jangan lupa 'x' di-edit.

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The primary network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
     address 10.1.0.1
     netmask 255.255.255.0
     network 10.1.0.0
     broadcast 10.1.0.255
     gateway 10.1.0.254
     # dns-* options are implemented by the resolvconf package, if installed
     dns-nameservers 10.1.0.1
     dns-search x.com

Restart network, lalu cek dengan perintah ifconfig. Lanjtkan dengan perintah =

Code: Select all

ifconfig eth0:0 10.1.0.2 netmask 255.255.255.0

Cek lagi dengan perintah ifconfig, lihat perbedaannya dengan output ifconfig yang pertama.
Untuk membuat permanen, tambahkan ke rc.local sebelum baris exit 0

Code: Select all

touch /var/lock/subsys/local
ifconfig eth0:0 10.1.0.2 netmask 255.255.255.0

##PS
Dalam lingkungan linux, dikenal istilah case-sensitive. Apalagi kurang satu huruf, beda huruf besar/kecil bisa jadi 'perkara'
User avatar
antoniusgenta
Posts: 103
Joined: 29 Dec 2011, 14:40
Location: jakarta

Re: Cara Membuat Virtual IP Ubuntu Server ?

Postby antoniusgenta » 17 May 2013, 21:48

Pragola_Pati wrote:Coba Anda cek lagi isi file =
[color:#000099]/etc/network/interfaces[/color]
bukan =
[color:#3366FF]/etc/network/interface[/color]

Kemudian pada file [color:#000099]/etc/network/interfaces[/color], ubah seperti di bawah ini. Jangan lupa 'x' di-edit.

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The primary network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
     address 10.1.0.1
     netmask 255.255.255.0
     network 10.1.0.0
     broadcast 10.1.0.255
     gateway 10.1.0.254
     # dns-* options are implemented by the resolvconf package, if installed
     dns-nameservers 10.1.0.1
     dns-search x.com

Restart network, lalu cek dengan perintah ifconfig. Lanjtkan dengan perintah =

Code: Select all

ifconfig eth0:0 10.1.0.2 netmask 255.255.255.0

Cek lagi dengan perintah ifconfig, lihat perbedaannya dengan output ifconfig yang pertama.
Untuk membuat permanen, tambahkan ke rc.local sebelum baris exit 0

Code: Select all

touch /var/lock/subsys/local
ifconfig eth0:0 10.1.0.2 netmask 255.255.255.0

##PS
Dalam lingkungan linux, dikenal istilah case-sensitive. Apalagi kurang satu huruf, beda huruf besar/kecil bisa jadi 'perkara'


hahaha bner sekali mas pati,,salah entry dia sepertinya,,,

salam
genta

Return to “Ubuntu Server”

Who is online

Users browsing this forum: No registered users and 16 guests