How to Configure Static IP Address on Ubuntu 11.10

During the installation, Ubuntu installer has configured this server to get it’s ip address via DHCP, then we have to change this because a server should have a static IP address. This post will guide you how to configure static ip address on Ubuntu 11.10 linux server. This steps may working on other versions of Ubuntu.

Edit /etc/network/interfaces as per below command :

root@ubuntu11:~# vi /etc/network/interfaces

Original network interface configuration on Ubuntu 11.10 server is as below :

# 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 dhcp

As an example, configure static ip address as below :

# 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.49
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

How to restart the network interface :

root@ubuntu11:~# /etc/init.d/networking restart
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee