How to configure a static IP Address in Ubuntu linux

FREQUENTLY ASKED QUESTIONS  (Linux)
Q: How to configure a static ip address in ubuntu linux?
Q: How to change ipaddress from dhcp to static ip address in Ubuntu?


After installing Ubuntu server, the ip address(s) for the interfaces will be set to default DHCP option. And you may need to change it to a static ip address especially for a Server. This post is based on command line configuration of setting a static ip address in Ubuntu operating systems.


Only thing you need to do is add your interface's ip address information to interface configuration file located in "/etc/network/interfaces"
Here i used "vi" tool to editing configuration file. Use your most comfortable one.

[root@server ~#]vi /etc/network/interfaces
#Add the below lines
auto eth0
#iface eth0 inet dhcp         <= (must disable or remove this line if present)
iface eth0 inet static
address 192.168.10.50
network 192.168.10.0
netmask 255.255.255.0
broadcast 192.168.10.255
gateway 192.168.10.1
# And now save the file.


[root@server ~#]vi /etc/resolv.conf               (Add DNS server address in Ubuntu)
nameserver 192.168.10.20
nameserver 192.168.10.30


Now restart the network for effect the changes.
[root@server ~#]/etc/init.d/networking restart

0 comments:

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons