This setup assumes the following setup.
- Any Linux Distribution (Debian/Ubuntu Preferred since it uses Iptables
- The Inteface wlo1 is connected to the Wan
- wlo1--> WAN
- The Interface enp3s0 is connected to the Local Network
- enp3s0-> LAN
Step 1
Enable IPv4 Forwarding
Assume super user privileges
sudo su
sysctl -w net.ipv4.ip_forward=1
Then issues the following commands
iptables -A FORWARD -o wlo1 -i enp3s0 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o wlo1 -j MASQUERADE
On the Client
- Provide an IP Address in the series of 192.168.0.X
- Provide the gateway 192.168.0.1
- Provide DNS Server 8.8.8.8
And that's it. It should connect