30 May 2009

Konfigurasi Alamat IP untuk ethernet di Ubuntu

Konfigurasi Network Menggunakan DHCP

Edit file /etc/network/interfaces :

sudo vi /etc/network/interfaces

# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp


Konfigurasi IP Static

sudo vi /etc/network/interfaces

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255

Restart network dengan menggunakan perintah :

sudo /etc/init.d/networking restart


Konfigurasi IP Virtual

Jika kita ingin men-set IP kedua pada ethernet yang sama, edit kembali file interfaces :

sudo vi /etc/network/interfaces

auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x



No comments: