Pages

How to set static IP address on Ubuntu Server


Linux has a myriad of beauty, such as the absence of XWindows display on Ubuntu Server, although this feature may be added later, but the absence is not a deficiency, but is one of the advantages, the absence of the visual XWindows display means more resources are available to perform as a server, because with the window-based visual display will definitely use resources, both memory and processor resources used though relatively small, it still takes a bit of space for processing.
But when he first became acquainted with Ubuntu Server, the author had a small problem when going to setup the ip address, after a few minutes of looking and searching at one's favorite search engine (the GOOGLE of course), the problem disappear in a flash. This is the answer.


1. Login as root, or simply use the sudo command.
2. Edit the interface file inside folder /etc/network/interface using your favorite editor tools.
[root@mataramkluster mcg]#gedit /etc/network/interface
3. Enter the following configuration format, for the IP address, adjust with the network condition you have.
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address xxx.xxx.xxx.xxx (enter your IP address)
netmask xxx.xxx.xxx.xxx (add wih your netmask)
gateway xxx.xxx.xxx.xxx (your gateway IP)
broadcast xxx.xxx.xxx.xxx (the broadcast IP on your network)
network xxx.xxx.xxx.xxx (enter your network IP)
network address usualy same as that used by the IP network, the difference is the last column in the address is filled with zero number.
example for the network with IP 192.168.0.1 the network is 192.168.0.0.
4. Enter prefered DNS and DNS Alternate server
[root@mataramkluster mcg]#gedit /etc/resolv.conf
nameserver xxx.xxx.xxx.xxx (filled with IP DNS1)
nameserver xxx.xxx.xxx.xxx (filled with  IP DNS2)
nameserver xxx.xxx.xxx.xxx (filled with  IP DNS3)
5. Restart the network
[root@mataramkluster mcg]#/etc/init.d/networking restart
6. Check the IP using the following command.
[root@mataramkluster mcg]#ifconfig
7. Testing the connection can be done by pinging the web server located outside your network(if your network is connected to the internet), for example pinging to www.google.co.id.
8. For another Linux distributions, the configuration maybe almost the same as in this article.


Hopefully this article is useful.

0 comments:

Post a Comment