I connected my Pi Zero to my PC ( Linux LMDE 3 Cindy) via USB port successfully, SO i want to connect to internet via my laptop which is connected to internet by its WIFI.
I found this instruction or this question via raspberrypi.stackexchange but those are working for window or MAC OS,but i don’t find it for Linux!!!!
SO i need the similar instruction for enabling sharing my internet via USB
enp0s20f0u1 device (PI Zero) in Linux. for example in windows we need to :
In the WiFi Properties window, click on the “Sharing” tab : similar to this photo:
i could assist one IP (
192.168.7.2) for my raspberry by running this code in my raspberry based this instructions :
sudo nano /etc/network/interfaces allow-hotplug wlan1 iface wlan1 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf allow-hotplug usb0 iface usb0 inet static address 192.168.7.2 netmask 255.255.255.0 network 192.168.7.0 broadcast 192.168.7.255 gateway 192.168.7.1
I have this (
sudo ifconfig) in my Linux:
enp0s20f0u2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 169.254.27.126 netmask 255.255.0.0 broadcast 169.254.255.255 inet6 fe80::cff5:f703:7327:dd9 prefixlen 64 scopeid 0x20<link> ether 6e:2f:15:92:bd:a8 txqueuelen 1000 (Ethernet) RX packets 2936 bytes 244294 (238.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2113 bytes 174942 (170.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.105 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::373d:1b7f:5b9e:8ddc prefixlen 64 scopeid 0x20<link> ether c8:3d:d4:3c:23:63 txqueuelen 1000 (Ethernet) RX packets 33305 bytes 31322783 (29.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 26405 bytes 4264995 (4.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s20f0u2i2 is my Raspberry zero which is using
IPV4 Link-local only method but i could change its IP to static IP like
192.168.7.2 as described above.
And in my raspberry:
pi@raspberrypi:~ $ ifconfig -a 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 72 bytes 6840 (6.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 72 bytes 6840 (6.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 169.254.183.232 netmask 255.255.0.0 broadcast 169.254.255.255 inet6 fe80::d7db:e53b:407d:8d65 prefixlen 64 scopeid 0x20<link> ether ee:70:24:ba:2d:57 txqueuelen 1000 (Ethernet) RX packets 182 bytes 28198 (27.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 172 bytes 15872 (15.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
so when i do this site instruction I run this code in my Linux:
# Bring both interfaces into promiscuous mode sudo ip link set wlp2s0 promisc on
and this code in my raspberry:
sudo ip link set usb0 promisc on
when i run this code in my LINUX OS (laptop):
# Creating a new bridge interface sudo brctl addbr br0 # Set the forwarding delay to 0. # While this is not necessary, I learned that it help with faster configuration sudo brctl setfd br0 0
SO when running next step (
sudo brctl addif br0 wlp2s0 enp0s20f0u2) i get this error:
can't add wlp2s0 to bridge br0: Operation not supported
so i doing this :
sudo iw dev wlp2s0 set 4addr on from here to solve this bug, but i lose my internet connection :
so@notebook:~$ ping www.google.com ping: www.google.com: Name or service not known
ans also lose my connection with my Raspberry zero (USB Ethernet).
SO what i must t to do to make a bridge for sharing my laptop internet with raspberry zero?
- I have this kind of question in raspberrypi.stackexchange site and based on those comments,I asked this question here
Thanks a lot.