Hey I'm trying to condense the softAP + internet commands in PwnStar into just the commands. I have pulled the following form the script but I must be missing something:

iptables --flush # delete all rules in default (filter) table
iptables -t nat --flush
iptables -t mangle --flush
iptables -X # delete user-defined chains
iptables -t nat -X
iptables -t mangle -X
echo "1" > /proc/sys/net/ipv4/ip_forward # enable kernel forwarding
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
airbase-ng -Z 4 -W 1 -c <channel> -e "SSID" -v mon0 2> /dev/null &
sleep 6
modprobe tun # probably not necessary
ifconfig at0 up 172.16.0.1 netmask 255.255.255.0
ifconfig at0 mtu 1400

echo > /var/lib/dhcp/dhcpd.leases # Clear any pre-existing dhcp leases
cat /dev/null > /tmp/dhcpd.conf

DHCP setup:
default-lease-time 300; > /tmp/dhcpd.conf
"max-lease-time 360;" >> /tmp/dhcpd.conf
"ddns-update-style none;" >> /tmp/dhcpd.conf
"authoritative;" >> /tmp/dhcpd.conf
"log-facility local7;" >> /tmp/dhcpd.conf
"subnet <subnet like 192.168.0.0> netmask <subnet mask like 255.255.255.0> {" >> /tmp/dhcpd.conf
"range <192.168.0.2 192.168.0.50>" >> /tmp/dhcpd.conf
"option routers $ap_ip;" >> /tmp/dhcpd.conf
"option domain-name-servers 8.8.8.8;" >> /tmp/dhcpd.conf
"}" >> /tmp/dhcpd.conf

dhcpd -cf /tmp/dhcpd.conf ********* ERROR HERE
route add -net <subnet like 192.168.0.0> netmask <subnet mask like 255.255.255.0> gw <gw IP like 192.168.1.1>
iptables -P FORWARD ACCEPT # probably not necessary 'coz we flushed the chains earlier


This however fails when I run the command `dhcpd -cf /tmp/dhcpd.conf` with:

No subnet declaration for at0 (172.16.0.1).
** Ignoring requests on at0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface at0 is attached. **

What am I missing? (dhcp.conf is set up correctly, I'm not just blindly copy/pasting there at least)