Ubuntu: change inet addr:192.168.2.2



Question:

wlan0     Link encap:Ethernet  HWaddr 28:e3:47:81:6e:06              inet addr:192.168.2.2  Bcast:192.168.2.255  Mask:255.255.255.0            inet6 addr: fe80::2ae3:47ff:fe81:6e06/64 Scope:Link            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1            RX packets:1088 errors:0 dropped:0 overruns:0 frame:0            TX packets:1247 errors:0 dropped:0 overruns:0 carrier:0            collisions:0 txqueuelen:1000             RX bytes:905412 (905.4 KB)  TX bytes:245531 (245.5 KB)  

I want to change the inet addr:192.168.2.2 , because I think it makes internet connection problems, because I don't have internet access, while one the same system (dual boot) my WiFi works fine with Windows. Also when I enter 192.168.2.2 in my browser it redirects me to a project which I did a long time ago and I don't remember what configurations I changed.

Is there way to change my inet addr to something else?


Solution:1

You should simply stick with DHCP (which is default) and allow your router to assign the IP address to your PC, then you will not have any address issues or conflicts unless you have somehow wrongly configured other devices on the network, for example.

In:

/etc/network/interfaces  

You'll likely see something like:

auto eth0     iface eth0 inet static     address 192.168.2.2     netmask 255.255.255.0     network 192.168.2.0     broadcast 192.168.2.255     gateway 192.168.2.1  

Merely change it back to

auto eth0     iface eth0 inet dhcp  

Of course, if you don't see something like that, or if I misunderstood the question, don't just go around editing files for nothing and ask for clarification ;)


Solution:2

If 192.168.2.2 actually resolves something while running Linux, and Windows works fine with that IP, I suspect you have a VM or docker instance running which claims the IP address. I would figure out what is actually serving from 192.168.2.2 when you make a request, and stop that.

If you need consistent IP addresses, you can you DHCP, but set the router to always assign a certain IP to a particular host.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »