I tried for weeks to get a Pi Zero Ethernet gadget to reliably work with Windows Internet connection sharing and failed.I am using the USB gadget. I haven't set a fixed MAC address yet. I saw your other post. and before I try it just wanted to make sure will this get me a fixed mac address? What should be the next step after this? Thanks!The Pi does not have any DHCP server running inside it. I am sharing the connection from my ethernet and it is set to autometic.
Screenshot 2024-06-07 202513.png
The Pi's address is autometically set by the DNS server if I understand it correctly.Screenshot 2024-06-07 202759.png
As of writing this, the Pi is not responding to DHCP server again.
What's weird is even though the screenshot says - 192.168.137.1 is the ip address
this is what I am getting from the PiCode:
pi@raspberrypi:~ $ hostname -I169.254.251.5
Looks to me like what you're seeing is the expected behaviour when no DHCP server responds. You get a self assigned, random IP address in the link local subnet (169.254.0.0/16)
Are you using the USB ethernet gadget? If so have you manually set MAC addresses for it? If you haven't you'll get new, random MAC addresses at each boot of the Pi which will result in new IP addresses even if a DHCP server is present on the PC.Code:
pi@raspberrypi:~ $ dmesg|grep MAC[ 6.025824] systemd[1]: systemd 247.3-7+rpi1+deb11u2 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified)[ 13.625443] usb0: HOST MAC aa:3b:81:0b:63:57[ 13.632970] usb0: MAC d2:1e:61:0d:d3:9epi@raspberrypi:~ $ modprobe dev_addr=aa:3b:81:0b:63:57 host_addr=d2:1e:61:0d:d3:9e
https://forums.raspberrypi.com/viewtopic.php?t=225768
As your description of the intermittent problems sounds very similar to my experience, it seems the minimal built-in NAT and DHCP servers haven't improved since Windows Vista.
My solution was to choose a static IP number at the end of the allocation block under hopes that Windows would never try to dynamically assign it. It would be nice if someone figured out what was going wrong and how to fix it.
Statistics: Posted by ejolson — Sun Jun 09, 2024 4:37 am