Indice   FAQ  
Iscriviti  Login
Indice RouterOS RouterOS

[hotspot] Limitare navigazione solo su porta 80

Tutto su questo sistema operativo linux based - Configurazioni, dubbi, problematiche &....

[hotspot] Limitare navigazione solo su porta 80

Messaggioda femetal » mar 19 apr 2011, 12:19

Salve a tutti.

ho un hotspot con autenticazione su Radius esterno.

Vorrei limitare gli utenti alla sola navigazione attraverso porte 80 e 443 (http e https); in pratica vorrei droppare tutte le restanti porte.

è un Mikrotik RB750
10.1.1.254/24 è il lato HotSpot
172.18.255.248/24 è il lato WAN

ip firewall filter print all
Codice: Seleziona tutto
0   chain=forward action=accept protocol=tcp dst-port=8001

1   chain=forward action=accept protocol=tcp dst-port=8002

2   chain=forward action=accept protocol=tcp dst-port=8003

3 D chain=forward action=jump jump-target=hs-unauth hotspot=from-client,!auth

4 D chain=forward action=jump jump-target=hs-unauth-to hotspot=to-client,!aut>

5 D chain=input action=jump jump-target=hs-input hotspot=from-client

6 I chain=hs-input action=jump jump-target=pre-hs-input

7 D chain=hs-input action=accept protocol=udp dst-port=64872

8 D chain=hs-input action=accept protocol=tcp dst-port=64872-64875

9 D chain=hs-input action=jump jump-target=hs-unauth hotspot=!auth

10 D chain=hs-unauth action=return dst-address=172.18.255.14

11 D chain=hs-unauth action=reject reject-with=tcp-reset protocol=tcp

12 D chain=hs-unauth action=reject reject-with=icmp-net-prohibited

13 D chain=hs-unauth-to action=return src-address=172.18.255.14

14 D chain=hs-unauth-to action=reject reject-with=icmp-host-prohibited

15 X ;;; place hotspot rules here
     chain=unused-hs-chain action=passthrough




ip firewall nat print all

Codice: Seleziona tutto
0   chain=dstnat action=dst-nat to-addresses=10.1.1.241 to-ports=8001
     protocol=tcp dst-port=8001

1   chain=dstnat action=dst-nat to-addresses=10.1.1.242 to-ports=8002
     protocol=tcp dst-port=8002

2   chain=dstnat action=dst-nat to-addresses=10.1.1.243 to-ports=8003
     protocol=tcp dst-port=8003

3 D chain=dstnat action=jump jump-target=hotspot hotspot=from-client

4 I chain=hotspot action=jump jump-target=pre-hotspot

5 D chain=hotspot action=redirect to-ports=64872 protocol=udp dst-port=53

6 D chain=hotspot action=redirect to-ports=64872 protocol=tcp dst-port=53

7 D chain=hotspot action=redirect to-ports=64873 protocol=tcp
     hotspot=local-dst dst-port=80

8 D chain=hotspot action=redirect to-ports=64875 protocol=tcp
     hotspot=local-dst dst-port=443

9 D chain=hotspot action=jump jump-target=hs-unauth protocol=tcp hotspot=!aut>

10 D chain=hotspot action=jump jump-target=hs-auth protocol=tcp hotspot=auth

11 D chain=hs-unauth action=return dst-address=172.18.255.14

12 D chain=hs-unauth action=redirect to-ports=64874 protocol=tcp dst-port=80

13 D chain=hs-unauth action=redirect to-ports=64874 protocol=tcp dst-port=3128

14 D chain=hs-unauth action=redirect to-ports=64874 protocol=tcp dst-port=8080

15 D chain=hs-unauth action=redirect to-ports=64875 protocol=tcp dst-port=443

16 I chain=hs-unauth action=jump jump-target=hs-smtp protocol=tcp dst-port=25

17 D chain=hs-auth action=redirect to-ports=64874 protocol=tcp hotspot=http

18 I chain=hs-auth action=jump jump-target=hs-smtp protocol=tcp dst-port=25

19 X ;;; place hotspot rules here
     chain=unused-hs-chain action=passthrough



Le prime tre regole nel firewall e nel nat mi consentono di raggiungere le antenne che "emanano" il segnale wireless.

Le altre regole sono quelle create automaticamente al setup dell hotspot

Ho provato a creare una regola di firewall dopo la num. 15 con chain=forward dest-port= 80,443 action = accept
e subito dopo una con chain=forward action=drop

ma cosi facendo non riesco a navigare.

le ho provate ad inserire tra la #2 e la #3 ma è uguale..

Lo so che mi sto perdendo in un bicchiere d'acqua....
femetal
Mikrotik Curious User
Mikrotik Curious User
 
Messaggi: 9
Iscritto il: mer 27 ott 2010, 12:30

Re: [hotspot] Limitare navigazione solo su porta 80

Messaggioda femetal » mar 19 apr 2011, 21:42

come dicevo era un bicchiere d'acqua..

dimenticavo di specificare nelle regole di firewall le interfacce di entrata e uscita..

senza quelle bloccava tutto.

ad ogni modo ho aggiunto:
Codice: Seleziona tutto
ip firewall filter add chain=hs-input src-address=10.1.1.0/24 dst-address=10.1.1.254 protocol=tcp dst-port=8291 in-interface=bridge1-HS action=drop comment="blocco Winbox dalla rete HotSpot"

ip firewall filter add chain=forward protocol=tcp dst-port=80,801,443,8080 hotspot=auth action=accept

ip firewall filter add chain=forward in-interface=bridge1-HS out-interface=ether1-Aitec hotspot=auth action=drop

femetal
Mikrotik Curious User
Mikrotik Curious User
 
Messaggi: 9
Iscritto il: mer 27 ott 2010, 12:30

Re: [hotspot] Limitare navigazione solo su porta 80

Messaggioda figheras » mar 19 apr 2011, 22:16

Perfettoo!!....Come si dice, a volte il problema è "tra la sedia e la scrivania" :lol:
Questo post potrebbe servire ad altri...grazie per la tua esperienza
:beer:
Siamo tutti ignoranti. Ma non tutti ignoriamo le stesse cose! - Einstein -
Avatar utente
figheras
Staff rosIT
Staff rosIT
 
Messaggi: 1218
Iscritto il: sab 19 set 2009, 20:09
Uso routerOS dalla Versione: v2.9.x
Certificazioni Mikrotik: MTCNA, MTCRE, MTCWE
Altre certificazioni: Cisco CCNA, KalliopePBX
Preferred Training Centre: Grifonline



Torna a RouterOS

Chi c’è in linea

Visitano il forum: Nessuno e 19 ospiti