#! /bin/bash
WIFIIFACE=wlx00c0ca1a03ef
OUTIFACE=eth0
ATK_PROXY_IP=192.168.0.2

echo 1 > /proc/sys/net/ipv4/ip_forward
hostapd ./hostapd.conf &
ip addr flush dev $WIFIIFACE
ip addr a 192.168.254.1/24 dev $WIFIIFACE
iptables -F
iptables -t nat -F
iptables -t nat -A POSTROUTING -o $OUTIFACE -j MASQUERADE
#iptables -t nat -A PREROUTING  -i $WIFIIFACE -j DNAT -p tcp --dport 80  --to-destination $ATK_PROXY_IP:8080 
#iptables -t nat -A PREROUTING  -i $WIFIIFACE -j DNAT -p tcp --dport 443 --to-destination $ATK_PROXY_IP:8443
dnsmasq --no-daemon --log-queries -C dnsmasq.conf &
