0

Without setting the IP to static I can easily connect to Pi. The untouched ip is 192.168.1.135 and works great.

How ever upon editing the /etc/dhcpcd.conf and adding

interface wlan0
static ip_address=192.168.0.10/24

I can't seem to connect to it anymore. When I run the ifconfig, it looks like wlan0 is set to that IP, but either way I cannot connect to it.

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.10  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 ***::***:****:****:****  prefixlen 64  scopeid 0x20<link>
        ether **:**:**:**:**:**  txqueuelen 1000  (Ethernet)
        RX packets 41  bytes 7129 (6.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 62  bytes 10058 (9.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

What could be the reason the static IP is non accessible?

Is adding static routers and domain_name_servers mandatory?

static routers=IP
static domain_name_servers=8.8.8.8
Dino
  • 373
  • 2
  • 3
  • 10
  • 2
    192.168.0.0/24 is a different subnet to 192.168.1.0/24. Do you have a route between those two subnets? Usually, if your router supports it, it's easier to assign static addresses using the configuration pages at http://192.168.1.1 or http://192.168.1.254 – Dougie Jan 19 '19 at 21:29

1 Answers1

0

"Without setting the IP to static I can easily connect to Pi."

The obvious answer is DON'T - it should not be necessary.

If your are determined to do so anyway How to set up Static IP Address explains how to do it properly.

Milliways
  • 59,890
  • 31
  • 101
  • 209