Created
May 23, 2024 09:34
-
-
Save realyukii/ea3ae0a3d7afce7433dbe651acdc70e0 to your computer and use it in GitHub Desktop.
Make your laptop into a working repeater/hotspot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface=wlan1 | |
| ssid=file-sharing | |
| channel=6 | |
| hw_mode=g | |
| wpa=2 | |
| wpa_passphrase=password123 | |
| wpa_key_mgmt=WPA-PSK |
Author
Author
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
Author
Related link
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make your computer act as a router or repeater
to enable hotspot, start the following service as root:
helpful post, but there's an exception, the step on the post is not entirely accurate:
routecommand is unnecessary, and the listen address must be the same as gateaway to be able response to the client request.Debugging
list routing table:
route -norip route listmonitor network traffic:
tcpdump -vv -i wlan1 'port 67 or port 68'(seeman 7 pcap-filterfor more information about the expression)list used port
netstat -tulpnlist reserved port:
less /etc/servicesLink and Reference