Reputation: 1
i have a django server running on a desktop computer(linuxmint 18.3 64 bits), i use hostapd and dnsmasq to serve the django site in a local area via wifi(a room). desktop also have a regular Internet connection over Ethernet cable.(Internet access is NOT shared over wifi.) however while dnsmasq is running, the desktop is unable to connect to the Internet. i need to both serve the django site over wifi and been able to access the Internet at the same time. here are my configurations
cat dnsmasq.conf
except-interface=enp0s25
except-interface=lo
interface=wlp48s0
dhcp-range=10.0.0.10,10.0.0.250,12h
dhcp-option=3,10.0.0.1
dhcp-option=6,10.0.0.1
server=8.8.8.8
#log-queries
#log-dhcp
address=/#/10.0.0.1
listen-address=10.0.0.1
bind-interfaces
cat hostapd.conf
ap_isolate=1
interface=wlp48s0
#driver=nl80211
ssid=LOCALACCESSPOINT
channel=6#0 #1
auth_algs=1 # 1=wpa, 2=wep, 3=both
wpa=2 # WPA2 only
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=123456789
also run a service every boot
cat set_ip.service
[Unit]
Description=asignar ip a la tarjeta wifi
After=multi-user.target
[Service]
Type=idle
ExecStart=/bin/bash /home/mint/set_ip.sh
[Install]
WantedBy=multi-user.target
cat set_ip.sh
ifconfig wlp48s0 down
sleep 2
ifconfig wlp48s0 10.0.0.1 up
sleep 4
systemctl restart dnsmasq.service
iptables -i wlp48s0 -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8000
iptables -i wlp48s0 -A INPUT -p tcp --dport 22 -j DROP
as soon as i call sudo systemctl stop dnsmasq.service im able to browse the Internet again.
any help will be appreciated
Upvotes: 0
Views: 141