From 648fb6918b35ede6cefdda646d6c4772ceeda050 Mon Sep 17 00:00:00 2001 From: Gary Williams Date: Sat, 23 Dec 2017 20:06:27 +0800 Subject: [PATCH] fix dns_port hard code --- create_ap | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/create_ap b/create_ap index b7c332d..8fa6671 100755 --- a/create_ap +++ b/create_ap @@ -612,6 +612,7 @@ ADDN_HOSTS= DHCP_DNS=gateway NO_DNS=0 NO_DNSMASQ=0 +DNS_PORT= HIDDEN=0 MAC_FILTER=0 MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept @@ -760,12 +761,12 @@ _cleanup() { if [[ "$SHARE_METHOD" != "bridge" ]]; then if [[ $NO_DNS -eq 0 ]]; then - iptables -w -D INPUT -p tcp -m tcp --dport 5353 -j ACCEPT - iptables -w -D INPUT -p udp -m udp --dport 5353 -j ACCEPT + iptables -w -D INPUT -p tcp -m tcp --dport $DNS_PORT -j ACCEPT + iptables -w -D INPUT -p udp -m udp --dport $DNS_PORT -j ACCEPT iptables -w -t nat -D PREROUTING -s ${GATEWAY%.*}.0/24 -d ${GATEWAY} \ - -p tcp -m tcp --dport 53 -j REDIRECT --to-ports 5353 + -p tcp -m tcp --dport 53 -j REDIRECT --to-ports $DNS_PORT iptables -w -t nat -D PREROUTING -s ${GATEWAY%.*}.0/24 -d ${GATEWAY} \ - -p udp -m udp --dport 53 -j REDIRECT --to-ports 5353 + -p udp -m udp --dport 53 -j REDIRECT --to-ports $DNS_PORT fi iptables -w -D INPUT -p udp -m udp --dport 67 -j ACCEPT fi