Posted by: M'Creative | 4 August 2011

Setting IP Address Ubuntu Via Command Line


Kahayan – 4 Ramadhan 1423 H
Menunggu datangnya adzan maghrib

Setting IP Address Ubuntu Via Command Line

1. Edit file /etc/network/interfaces

#nano /etc/networks/interfaces

2. Edit dan sesuaikan dengan IP yang akan dipakai.

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# eth1 saya gunankan ether primer
# eth0 saya gunakan untuk ip publik
auto eth1 eth0

# untuk dhcp stayic diganti dengan dhcp dan semua baris dibawahnya (address s/d gateway) dihapus

iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask 255.255.255.252
network xxx.xxx.xxx.xxx
broadcast xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx

iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.248
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

3. Setting DNS server

#nano /etc/resolv.conf

# isi dengan DNS server
# penulis menggunakan DNS Nawala
nameserver  180.131.144.144

4. Restart networking

#/etc/init.d/networking restart

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces…

5. Cek konfigurasi

#ifconfig

eth0  Link encap:Ethernet  HWaddr 00:15:17:49:06:5f
inet addr:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx  Mask:255.255.255.252
inet6 addr: fe80::215:17ff:fe49:65f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:234 errors:0 dropped:0 overruns:0 frame:0
TX packets:122 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:22136 (22.1 KB)  TX bytes:18777 (18.7 KB)
Interrupt:17 Memory:88180000-881a0000

eth1      Link encap:Ethernet  HWaddr 00:15:17:49:06:60
inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.248
inet6 addr: fe80::215:17ff:fe49:660/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:5654 errors:0 dropped:0 overruns:0 frame:0
TX packets:4490 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:980163 (980.1 KB)  TX bytes:950227 (950.2 KB)

6.  Tes ping ke gateway, tes ping ke DNS server, tes ping ke google.com atau web lain

Allhamdulillah. Konfigurasi IP Adress sudah selesai


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: