-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring Ubuntu to use a static IP Address
Christopher Hopkins edited this page Jan 1, 2014
·
1 revision
By default, most computers use DHCP to obtain their IP Address and other network configuration information to get on the internet, but there are some situations where a manual/static configuration is needed/desirable.
In this case we will use a 192.168.0.X block in our example:
# 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.0.101
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
You will probably also want to add 'nameserver's in this file so that you will be able to reach other devices over the internet using domain names (for example: github.com).
# /etc/resolve.conf
domain mydomain.com
nameserver 75.75.76.76
nameserver 75.75.75.75
The IP Addresses for the nameservers (you only need one, but two provides redundancy) can be found from another computer (already configured) on the network, or from another DNS provider.