Skip to content

Instantly share code, notes, and snippets.

@RealYukiSan
Created May 23, 2024 09:34
Show Gist options
  • Save RealYukiSan/ea3ae0a3d7afce7433dbe651acdc70e0 to your computer and use it in GitHub Desktop.
Save RealYukiSan/ea3ae0a3d7afce7433dbe651acdc70e0 to your computer and use it in GitHub Desktop.
Make your laptop into a working repeater/hotspot
bind-interfaces
no-resolv
dhcp-range=192.168.33.2,192.168.33.20,12h
dhcp-option=3,192.168.33.1 # Gateway (gw)
dhcp-option=6,192.168.33.1 # DNS
log-queries
log-dhcp
listen-address=192.168.33.1
interface=wlan1
ssid=file-sharing
channel=6
hw_mode=g
wpa=2
wpa_passphrase=password123
wpa_key_mgmt=WPA-PSK
@RealYukiSan
Copy link
Author

RealYukiSan commented May 23, 2024

To enable internet access, use the following command:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.33.0/24 ! -d 192.168.33.0/24 -j MASQUERADE

make sure it's applied:

iptables -t nat -S

flush or delete the rule:

iptables -t nat -F

Link and Reference

@RealYukiSan
Copy link
Author

Related link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment