i found this command in official raspberry pi website.
sudo nmcli device wifi hotspot ssid <example-network-name> password <example-password>
but when i connect other devices with this ssid and password it does get connected but no internet. and somehow it disconnects my SSH session.
I enabled IP forwarding, checked Network manager status, made sure hostapd and dnsmasq is not enabled(not even installed) and verified DNS configuration.
This is my NAT(nftables)
#!/usr/sbin/nft -f
flush ruleset
table ip filter {
chain input
{
type filter hook input priority 0; policy accept;
}
chain forward
{
type filter hook forward priority 0; policy accept;
iifname "wlan0" oifname "wlan0" accept
}
chain output
{
type filter hook output priority 0; policy accept;
}
}
table ip nat {
chain prerouting {
type nat hook prerouting priority 0; policy accept;
}
chain postrouting {
type nat hook postrouting priority 100; policy accept;
oifname "wlan0" masquerade
}
}
I have connected raspberrypi with headless setup, configuring the device using SSH.
I coudn't figure out the problem.