Last active
January 25, 2021 12:35
-
-
Save venkateshshukla/9744327 to your computer and use it in GitHub Desktop.
Make a access point hotspot in Fedora
This file contains 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
#!/bin/bash | |
#Initial wifi interface configuration | |
ifconfig wlp8s0 up 10.20.30.1 netmask 255.255.255.0 | |
sleep 2 | |
###########Start dnsmasq, modify if required########## | |
if [ -z "$(ps -e | grep dnsmasq)" ] then | |
dnsmasq | |
fi | |
########### | |
#Enable NAT | |
iptables --flush | |
iptables --table nat --flush | |
iptables --delete-chain | |
iptables --table nat --delete-chain | |
iptables --table nat --append POSTROUTING --out-interface tun0 -j MASQUERADE | |
iptables --append FORWARD --in-interface wlp8s0 -j ACCEPT | |
#iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu | |
sysctl -w net.ipv4.ip_forward=1 | |
#start hostapd | |
echo Starting hotspot. | |
hostapd /etc/hostapd/hostapd-minimal.conf 1> /dev/null | |
killall dnsmasq | |
echo Hotspot Closed |
This file contains 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
#disables dnsmasq reading any other files like /etc/resolv.conf for nameservers | |
no-resolv | |
# Interface to bind to | |
interface=wlp8s0 | |
# Specify starting_range,end_range,lease_time | |
dhcp-range=10.20.30.3,10.20.30.5,12h | |
# dns addresses to send to the clients | |
server=8.8.8.8 |
This file contains 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
conf-dir=/etc/dnsmasq.d |
This file contains 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
#change wlan0 to your wireless device | |
interface=wlp8s0 | |
driver=nl80211 | |
ssid=VenkateshFedora | |
channel=3 | |
hw_mode=g | |
macaddr_acl=0 | |
auth_algs=1 | |
ignore_broadcast_ssid=0 | |
wpa=3 | |
wpa_passphrase=FedoraAwesome | |
wpa_key_mgmt=WPA-PSK | |
wpa_pairwise=TKIP | |
rsn_pairwise=CCMP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment