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.
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 use this code to have one specific IP for my USB Ethernet (enp0s20f0u1 find from ``ifconfig -a` for USB Connection) :
sudo ip a add 192.168.7.1/24 dev enp0s20f0u1 sudo ip link set dev enp0s20f0u1 up sudo ifconfig enp0s20f0u1 192.168.7.1 up sudo ssh email@example.com sudo avahi-autoipd -D enp0s20f0u1
but connecting to PI via ssh (
sudo ssh firstname.lastname@example.org) dont working.
I also try using
iptable like this (enp0s20f0u1 find from ``ifconfig -a` for USB Connection):
# select correct interfaces from "ifconfig": BBGW_IFACE=enp0s20f0u1 # Ethernet PC_IFACE=wlp2s0 # Wireless #PC_IFACE=todo sudo sysctl net.ipv4.ip_forward=1 sudo iptables --table nat --append POSTROUTING --out-interface $PC_IFACE -j MASQUERADE sudo iptables --append FORWARD --in-interface $BBGW_IFACE -j ACCEPT
but the result is only when i run
ping www.google.com i get this:
so@notebook:~$ ping www.google.com PING www.google.com (22.214.171.124) 56(84) bytes of data. From notebook (192.168.7.2) icmp_seq=1 Destination Host Unreachable
So i understand i need to have one IP for my raspberry and share that IP with my WiFi setting as you could see here:
So in Linux version what is the similar instruction to share my PC internet with the PI?