The Raspberry Pi Zero W is connected to the internet with wlan0 and it needs to share that internet with the computer via USB. The Raspberry Pi Zero W also needs internet access. I have gadget mode already set up.
So when I plug it in the computer recognizes as Ethernet but it doesn't connect properly.
The Raspberry Pi Zero W has internet and is running a nginx server.
Please comment if you need more information.
pi@raspberrypi:~ $ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 24 bytes 2158 (2.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24 bytes 2158 (2.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.7.1 netmask 255.255.255.0 broadcast 192.168.7.255
inet6 fe80::170:33e3:ade5:d88a prefixlen 64 scopeid 0x20<link>
ether c2:d0:fa:7a:ff:38 txqueuelen 1000 (Ethernet)
RX packets 1 bytes 96 (96.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 67 bytes 8888 (8.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.27 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::5982:2aea:a56:b63a prefixlen 64 scopeid 0x20<link>
inet6 fd00::746e:b5ce:9dcd:13a0 prefixlen 64 scopeid 0x0<global>
ether b8:27:eb:e0:c9:38 txqueuelen 1000 (Ethernet)
RX packets 141 bytes 14473 (14.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 150 bytes 22053 (21.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
So what I want is:
pi0w with internet --> usb --> computer with no wifi card but now it has internet over wifi from the pi0w