First, edit the following file:
- Code: Select all
sudo vi /etc/network/interfaces
The configuration in this file should look something like this:
- Code: Select all
# 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
You need to change it to something like this:
- Code: Select all
# 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 10.0.0.221
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.138
Okay you are almost done, you have now configured your computer for static ip.
But to connect to internet you need to specify one or more DNS servers.
You can do that by editing the following file:
- Code: Select all
sudo vi /etc/resolv.conf
Add the DNS server(s) provided by your ISP.
If you have a little more advanced network at home or work, and you have a local DNS server then you should add this server instead..
The servers that I use for this example is the ones specified by my mothers ISP (Telenor).
- Code: Select all
nameserver 130.67.15.198
nameserver 193.213.112.4

