SkiBum326
Posts: 3
Joined: Sat Mar 23, 2019 5:40 am

Static IP address of Raspberry pi Zero W

Mon Sep 30, 2019 8:09 am

Hi Everyone,

I am trying to set up a static IP address for my Raspberry Pi Zero. Following instructions online, I added the following to the end of /etc/dhcpcd.conf

interface usb0
static ip_address=192.168.42.42/24
static routers=192.168.42.1
static domain_name_servers=102.168.42.1

After rebooting the pi, I see the following from ifconfig:

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.42.42 netmask 255.255.255.0 broadcast 192.168.42.255
inet6 fe80::8f00:84d:1c7b:fe22 prefixlen 64 scopeid 0x20<link>
ether f6:8b:8a:8c:6e:b5 txqueuelen 1000 (Ethernet)
RX packets 490 bytes 76712 (74.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 583 bytes 57833 (56.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

However, when I try to ping this IP address, I just see Request timeout for icmp_seq...

Does anything stand out that I could be doing wrong?
Thanks in advance for the help!

fruitoftheloom
Posts: 23549
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Static IP address of Raspberry pi Zero W

Mon Sep 30, 2019 8:12 am

SkiBum326 wrote:
Mon Sep 30, 2019 8:09 am
Hi Everyone,

I am trying to set up a static IP address for my Raspberry Pi Zero. Following instructions online, I added the following to the end of /etc/dhcpcd.conf

interface usb0
static ip_address=192.168.42.42/24
static routers=192.168.42.1
static domain_name_servers=102.168.42.1

After rebooting the pi, I see the following from ifconfig:

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.42.42 netmask 255.255.255.0 broadcast 192.168.42.255
inet6 fe80::8f00:84d:1c7b:fe22 prefixlen 64 scopeid 0x20<link>
ether f6:8b:8a:8c:6e:b5 txqueuelen 1000 (Ethernet)
RX packets 490 bytes 76712 (74.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 583 bytes 57833 (56.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

However, when I try to ping this IP address, I just see Request timeout for icmp_seq...

Does anything stand out that I could be doing wrong?
Thanks in advance for the help!

What is connected to the other end of the USB Cable you use for networking ?
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

SkiBum326
Posts: 3
Joined: Sat Mar 23, 2019 5:40 am

Re: Static IP address of Raspberry pi Zero W

Mon Sep 30, 2019 4:34 pm

Sorry, I forgot to include that detail.

I'm using a MacBook running Mojave 10.14.6.

Andyroo

Re: Static IP address of Raspberry pi Zero W

Mon Sep 30, 2019 5:46 pm

In networking (system preferences) have you set an IP address on the RNDIS adapter?

I find it best to have a separate network for Ethernet / WiFi on the Mac to that of the USB device.

e.g. 192.168.1.x is the normal house network with 192.168.2.x being the USB network present in dhcpcd.conf and the RNDIS adapter.

You also need to check the default route - it is possible this has gotten a bit mixed up and does not know about the Mac end of the network. Use the

Code: Select all

route
to check this on the Pi.

fruitoftheloom
Posts: 23549
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Static IP address of Raspberry pi Zero W

Mon Sep 30, 2019 5:57 pm

SkiBum326 wrote:
Mon Sep 30, 2019 4:34 pm
Sorry, I forgot to include that detail.

I'm using a MacBook running Mojave 10.14.6.

So you are running the RPi Zero in "Gadget Mode" ??
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

Return to “General discussion”