Ubuntu 11.10 is a version of the popular Linux-based operating system that was released in October 2011. One of the most common tasks that network administrators need to perform is configuring a static IP address on a Ubuntu server or desktop. A static IP address ensures that the computer always has the same IP address, making it easier to manage and connect to the network.
In this step-by-step guide, we will explain how to configure a static IP address on Ubuntu 11.10 and ensure that it remains persistent after reboot.
Step 1: Check the Current IP Configuration
Before we start, we need to check the current IP configuration of the Ubuntu 11.10 machine. To do this, open a terminal and type the following command:
This will display the current IP address of the machine, along with other network configuration details. Take note of the IP address, netmask, and gateway, as we will need these later.
Step 2: Edit the Network Interface Configuration File
Next, we need to edit the network interface configuration file. To do this, type the following command in the terminal:
sudo nano /etc/network/interfaces
This will open the configuration file in the nano text editor. Look for the line that starts with “iface eth0 inet dhcp” (assuming your network interface is named “eth0”), and replace it with the following lines:
iface eth0 inet static address X.X.X.X # Replace with desired static IP address netmask X.X.X.X # Replace with netmask gateway X.X.X.X # Replace with gateway address
Make sure to replace the “X.X.X.X” placeholders with the desired values that you noted earlier.
# 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
Step 3: Restart the Networking Service
After editing the configuration file, we need to restart the networking service for the changes to take effect. To do this, type the following command in the terminal:
sudo service networking restart
This will restart the networking service and apply the new network configuration.
Step 4: Verify the New IP Configuration
To verify that the new IP configuration has been applied, type the following command in the terminal:
This will display the updated network configuration, including the new static IP address. You can also check if the machine is connected to the network by pinging the gateway or another machine on the network.
Step 5: Make the Configuration Persistent
By default, Ubuntu 11.10 will reset the network configuration on reboot, so we need to make the changes persistent. To do this, open the “/etc/rc.local” file in the nano text editor:
sudo nano /etc/rc.local
Add the following line before the “exit 0” line:
This will ensure that the networking service is restarted and the new IP configuration is applied on every boot.
- ifconfig – displays current IP configuration details.
- sudo nano /etc/network/interfaces – opens the network interface configuration file for editing.
- sudo service networking restart – restarts the networking service.
- sudo nano /etc/rc.local – opens the rc.local file for editing.
In this guide, we have explained how to configure a static IP address on Ubuntu 11.10. By following the steps outlined above, you can ensure that your Ubuntu machine always has the same IP address, making it easier to manage and connect to the network. We also showed you how to make the changes persistent, so they remain in effect after a reboot. We hope that this guide has been helpful to you, and please feel free to leave any comments or suggestions for improvements.