
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

## client WIFI ##
#auto wlan0
#iface wlan0 inet dhcp
#    wpa-ssid internet@ddel
#    wpa-psk  38602c7669927e0138c31af7a35795add7dd49883050e21bba8d5c7857fe879c

### wifi hotspot ##
auto wlan0
iface wlan0 inet static
    address 192.168.0.1
    netmask 255.255.255.255
    broadcast 192.168.0.255
    post-up /usr/sbin/hostapd -B /etc/hostapd.conf
    post-up /usr/sbin/service dnsmasq restart
    post-up sysctl -w net.ipv4.ip_forward=1
    post-up route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1
    post-up iptables -A POSTROUTING -t nat -o ppp0 -s 192.168.0.0/24 -d 0/0 -j MASQUERADE
    post-up iptables -A FORWARD -t filter -o ppp0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
    post-up iptables -A FORWARD -t filter -i ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    post-up iptables -A FORWARD -t filter -o wlan0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
    post-up iptables -A FORWARD -t filter -i wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    post-up iptables -A INPUT -d 192.168.0.1 -p tcp -i wlan0 --dport 80 -j DROP
    post-up iptables -A INPUT -d 192.168.0.1 -p tcp -i wlan0 --dport 2401 -j DROP
    allow-hotplug wlan0

# hostapd und dnsmasq neu starten
#    up /etc/init.d/hostapd restart
#    up /etc/init.d/dnsmasq restart

auto usb0
iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    network 192.168.7.0
    gateway 192.168.7.2

