Manual Network Connections
# Generate a configuration file and connecting to the AP
wpa_passphrase $ssid $passphrase > wifi-client.conf
sudo wpa_supplicant -i wlan0 -c wifi-client.conf # -B for background
# Get & verify the IP address
sudo dhclient wlan2
ip addr show wlan2Setting up an Access Point
1. Configure Internet access on the system.
2. Set up a static IP for the wireless interface.
3. DHCP server set up, to provide automatic IP configuration for Wi-Fi clients.
4. Add routing to provide Internet access to the Wi-Fi clients.
5. Configure the Wi-Fi interface in AP mode.
=> # 1. Internet Access :
sudo iw list # search for Supported interface modes: * AP
=> # 2. Static IP on Access Point Wireless Interface
sudo ip link set wlan0 up
sudo ip addr add 10.0.0.1/24 dev wlan0
=> # 3. DHCP Server
sudo dnsmasq --conf-file=dnsmasq.conf
sudo tail /var/log/syslog | grep dnsmasq # Checking for dnsmasq in syslog
=> # 4. Routing
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward # Enabling IP forwarding
sudo nft add table nat
sudo nft 'add chain nat postrouting { type nat hook postrouting priority 100 ; }'
sudo nft add rule ip nat postrouting oifname "eth0" ip daddr != 10.0.0.1/24 masquerade
=> # 5. Access Point Mode
sudo hostapd hostapd.confLast updated