Connecting to a network with a static IP
When you install Ubuntu server, its network setting defaults to dynamic IP addressing, that is, the network management daemon in Ubuntu searches for a DHCP server on the connected network and configures the network with the IP address assigned by DHCP. Even when you start an instance in the cloud, the network is configured with dynamic addressing using the DHCP server setup by the cloud service provider. In this chapter, you will learn how to configure the network interface with static IP assignment.
Getting ready
You will need an Ubuntu server with access to the root account or an account with sudo
privileges. If network configuration is a new thing for you, then it is recommended to try this on a local or virtual machine.
How to do it…
Follow these steps to connect to the network with a static IP:
Get a list of available Ethernet interfaces using the following command:
$ ifconfig -a | grep eth
Open
/etc/network/interfaces
and find the following lines...