2

I had set my rpi to static ip for my home network for a project but now the problem is whenever i try to connect the rpi to vnc on a different network that is any mobile hotspot or any other wifi network it is not able to connect to the vnc.It can only be seen in vnc viewer whenever the rpi and laptop is connected to my home internet.So how can i revert back to the dynamic ip settings where it is back to normal like before where the ip address is changed on every network? The changes that i had made in the dhcpd.conf is

interface eth0
static ip_address=192.168.43.49
static routers = 192.168.43.1
static domain_name_servers = 122.169.123.36 122.169.123.38

interface wlan0
static ip_address = 192.168.43.15
static routers = 192.168.43.1
static domain_name_servers = 122.169.123.36 122.169.123.38
Girish Pillai
  • 21
  • 1
  • 1
  • 2
  • not an answer, but it sounds like a "Fallback profile" as described here could be helpful for you to combine static and dynamic ip – Fabian Apr 27 '18 at 17:34

1 Answers1

3

By default in Raspbian there is dhcp enabled so it will get an ip address if there is a dhcp server on the network or will use a link-local address from address block 169.254.0.0/16. If you haven't changed any other entries in /etc/dhcpcd.conf then simply comment the 8 lines you have changed by setting a # at the first character in the line and reboot. Then you should have the default configuration.

Ingo
  • 42,107
  • 20
  • 85
  • 197