How to fix my local ip address [duplicate]

Solution 1:

Yes it is possible to static your IP

The following steps describes how to configure static IP address on Ubuntu 14.04.

You need to edit the file /etc/network/interfaces.

I have used gedit as an editor. If you don't have it installed you can replace it with vim or whichever you have.

sudo  gedit /etc/network/interfaces

Then change to include the following:

# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
#iface lo inet interface
iface eth0 inet static
address 192.168.1.122
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
~

eth0 is the regular ethernet interface
address is the static IP address you choose
gateway is usually the router's IP address
dns-nameservers is the dns server IP address, this is needed for domain name resolution

After the change you can either reboot or run

sudo ifdown eth0

sudo  ifup  eth0

Check now. Run terminal and type:

ifconfig

Solution 2:

In the dash search for "Network Connections" and open the application, from here select the interface you want and click on the edit button:

Network Settings

From here click on the IPv4 Settings tab and change the method from Automatic DHCP to Manual and enter your network setting to something like this:

Network Settings 2

Now all you need to do is save the settings and restart the network connection and the ip should be statically set.

Please bare in mind that these settings are specific to Ubuntu and if, for example another device on the network connects using your static IP through DHCP you won't be able to connect using your static IP because it would have already been assigned.