How to completely reset ubuntu networking settings?

Try this:

sudo nano /etc/network/interfaces

Enter:

auto eth0
iface eth0 inet dhcp

eth0 is assuming that you are using an Ethernet labeled "eth0". You can confirm that with ifconfig.


I found a good command which has helped me to fix my problems.

sudo iptables -F

It reset my network settings and my network started to work. I hope this would help someone who had a similar problem.

Source:- Ask Ubuntu


The -r flag explicitly releases the current lease...

$ sudo dhclient -r

Now obtain fresh IP address using DHCP on Linux:

$ sudo dhclient