lundi 25 août 2014

Hotspot (Whitelist) - iptables problem

Liebe Community,



Ich arbeite derzeit an einem kleinen Projekt um einen Raspberry PI "Hotspot" zu ermöglichen. Die Regelung sieht vor das jedoch nur eine einzige Domain besucht werden darf.



Mein derzeitiger Stand.



Hotspot mit hostapd läuft.

Squid(transparent) mit ACL rule läuft.


Zitat:








acl site dstdomain .domain.org

http_access allow site

deny_info http://domain.org/de/ all

http_access deny all



DHCP mit udhcpd eingerichtet - läuft

iptables routing.


Code:



iptables -t nat -A POSTROUTING -j MASQUERADE

iptables -I INPUT -p udp -i wlan0 --dport 53 -j ACCEPT

iptables -I INPUT -p tcp -i wlan0 --dport 53 -j ACCEPT

iptables -I INPUT -p udp -i wlan0 --dport 67 -j ACCEPT

iptables -I INPUT -p udp -i wlan0 --dport 68 -j ACCEPT

iptables -I INPUT -p tcp -i wlan0 --dport 3128 -j ACCEPT

iptables -t nat -I PREROUTING -i wlan0 -p tcp --dport 80 -j REDIRECT --to-ports 3128

iptables -A INPUT -p tcp -i wlan0 -j DROP

iptables -A INPUT -p udp -i wlan0 -j DROP



Im Grunde funktioniert das Konzept bereits auch, ABER ich habe mit iptables paar Probleme.



Ich schaffe es einfach nicht sämtlichen anderen Traffic ausser PORT 80 zu blockieren.



z.b. SSL über 443 ist möglich, und einige Apps(Spiele) können trotzdem Ihre Verbindung zum Server aufbauen.



Ich glaube ich habe irgendwo einen kleinen Denkfehler gemacht.



Über eure Hilfe wäre ihr sehr dankbar.



Mit freundlichen Grüßen

Andre




Aucun commentaire:

Enregistrer un commentaire