GNU Nano is at the easy-to-use end of command-line editors.It’s similar like TeamViewer and it can be used to connect your desktop remotely to Linux, MAC and Windows machines to provide collaborate. AnyDesk is probably cross-platform fastest, remote desktop connection software that is used to share your desktop with others.And Terminal is an essential tool for most maker projects. With Linux commands you can take full control of Rasbpian OS.
To make it persistent, we need to export running iptables configuration to a file and configure RPI in restoring this ip routing settings at each reboot.Learning how to use Terminal and enter command line commands on a Raspberry Pi is an essential skill to master. This routing command will run until reboot. This configuration is similar to the one used for a ethernet-to-wifi RPI Access Point, just changing usb0 with eth0 (only for boards with cable connection and only if you want to share router ethernet internet connection instead of usb connection). “192.168.2.1” will become the IP address your Raspberry PI will use inside its WiFi LAN.īefore setting traffic routing in RPI, we need to enable IP forwarding process: sudo nano /etc/nfĪll routing capabilities will be set with a single command line, thus allowing traffic from all Rasapberry PI external clients, which will consider usb0 interface as exit gateway: sudo iptables -t nat -A POSTROUTING -o usb0 -j MASQUERADE “nohook wpa_supplicant” will disable the usage of wpa supplicat configuration file from next reboot. From terminal, edit dhcpd configuration file: sudo nano /etc/nfĪnd append at the end the following: interface wlan0 Even if it can lead to misunderstandings, in linux the dhcpcd service identify for RPI its client IP configuration. Start defining a static configuration for Raspberry PI WiFi interface.
Install required packages: sudo apt install hostapd dnsmasq Configure Routing
From terminal: sudo apt update -y & sudo apt upgrade -y You can also use Raspberry PI OS Desktop (in this case, you will use its internal terminal). I suggest to install Raspberry PI OS Lite to have an headless, fast OS. Start preparing Raspberry PI operating system.
Last command in this procedure will restart Raspberry PI telling it to not consider client wifi configuration, as it will become an Access Point.
Finally, WiFI hotspot settings will complete our installation.Īll of these setting can be performed with a classic headless installation, with Raspberry PI connected to your home WiFi by wpa_supplicant. Then routing and dhcp server will be configure to correctly drive traffic and assign dynamic IPs to clients. All connection will be routed to usb0 interface, which is usb port connected to smartphone in tethering mode (you can see it with ipconfig terminal command when USB tethering is enabled). Then we’ll configure a static IP for wireless interface (wlan0), as it will be used from client devices as default gateway. Please find in following picture wiring diagram in case of Raspberry PI Zero W: Step-by-Step Procedure