Dengan Virtual IP , seolah olah kita mempunyai lebih dari 1
IP Address dalam 1 Interface, Virtual ip dan salah satu penggunaannya, serta tujuan diantaranya masalah cost and eficiency., untuk konfugurasinya berikut ini :
smkn2salatiga:~# nano
/etc/network/interfaces
# This file describes the network interfaces available on your
system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.114
netmask 255.255.255.0
network 192.168.1.0
broadcast
192.168.1.255
gateway 192.168.1.1
# dns-* options are
implemented by the resolvconf package, if installed
dns-nameservers
192.168.1.1
dns-search
smkn2salatiga.sch.id
auto
eth0:0
iface
eth0:0 inet static
address 192.168.2.114
netmask 255.255.255.0
dns-nameservers 192.168.1.114
Setelah
selesai, restart konfigurasi dengan :
smkn2salatiga:~#
/etc/init.d/networking restart
Kita
lihat konfigurasinya :
smkn2salatiga:~# ifconfig
eth0 Link
encap:Ethernet HWaddr 00:0c:29:b3:b9:86
inet
addr:192.168.1.114
Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr:
fe80::20c:29ff:feb3:b986/64 Scope:Link
UP BROADCAST RUNNING
MULTICAST MTU:1500 Metric:1
RX packets:29198
errors:0 dropped:0 overruns:0 frame:0
TX packets:3086
errors:0 dropped:0 overruns:0 carrier:0
collisions:0
txqueuelen:1000
RX bytes:2170906
(2.0 MiB) TX bytes:231781 (226.3 KiB)
Interrupt:19 Base
address:0x2000
eth0:0 Link encap:Ethernet HWaddr 00:0c:29:b3:b9:86
inet addr:192.168.2.114 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500
Metric:1
Interrupt:19 Base address:0x2000
lo Link encap:Local
Loopback
inet
addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128
Scope:Host
UP LOOPBACK
RUNNING MTU:16436 Metric:1
RX packets:1332
errors:0 dropped:0 overruns:0 frame:0
TX packets:1332
errors:0 dropped:0 overruns:0 carrier:0
collisions:0
txqueuelen:0
RX bytes:251135
(245.2 KiB) TX bytes:251135 (245.2 KiB)
smkn2salatiga:~#