Re: Routing per access point WiFi creato su Debian

2017-10-04 Per discussione Lucio Marinelli
Il giorno 3 ottobre 2017 08:54, Mattia  ha scritto:

> > Sapete dirmi dove è l'inghippo e come posso risolvere il problema?
>
> Direi qui:
>
> > Chain FORWARD (policy DROP)
>
> Quella chain riguarda i pacchetti in ingresso ma non destinati
> all'host locale (e questo è il tuo caso). O decidi di fare forward di
> tutto (policy ACCEPT) oppure fai forward dei pacchetti da e verso la
> rete 192.168.8.0/24.
> Ci sarà qualcosa nella configurazione di ufw per abilitare il forward,
> non so indicartela perché non l'ho mai utilizzato.
>


Grazie Mattia, il comando
# iptables --policy FORWARD ACCEPT
ha risolto il problema!
Non c'è stato bisogno di modificare regole su ufw.
Saluti alla lista


-- 
Lucio Marinelli


Re: Routing per access point WiFi creato su Debian

2017-10-03 Per discussione Mattia
> Non vedo accenni al masquerading nella tua configurazione, o sbaglio?

Perché vediamo solo la configurazione della tabella filter. Il
masquerading è nella chain postrouting della tabella nat.

Ciao

-- 
Mattia



Re: Routing per access point WiFi creato su Debian

2017-10-03 Per discussione Felipe Salvador
On Mon, Oct 02, 2017 at 08:04:55PM +0200, Lucio Marinelli wrote:
> Ciao a tutti, ho un PC con Debian 9.1 collegato a internet via cavo
> (interfaccia enp2s0) che vorrei utilizzare come router wifi. Ho collegato
> un usb dongle Netgear che viene perfettamente riconosciuto (l'interfaccia
> di rete viene chiamata wlxe0469aa53965 invece che wlan0). Ho quindi seguito
> le istruzioni riportate qui per creare la rete wifi a cui collegare altri
> dispositivi utilizzando hostapd:
>
> https://seravo.fi/2014/create-wireless-access-point-hostapd
> 
> Di fatto ho creato una rete WiFi con indirizzi 192.168.8.0/24 che dovrebbe
> riuscire a fare routing dei pacchetti sull'indirizzo IP della macchina
> host. La rete funziona così come il DHCP e riesco quindi a collegarmi con
> il cellulare o altri dispositivi, tuttavia i pacchetti non sembrano
> entrare/uscire e quindi di fatto non funziona internet.

Non conosco ufw.
Non vedo accenni al masquerading nella tua configurazione, o sbaglio?
Se non intendi usare il NAT penso che il gateway a cui si allaccia enp2s0
dovrebbe esserne informato, aggiungendo la relativa route per
192.168.8.0/24.

Un consiglio; data la complessità della tua configurazione paragonata
al tutorial da cui hai preso spunto (e a molti altri tutorial simili)
e date le difficoltà che stai avendo per far funzionare il tutto,
cerca di tenere tutto il più semplice possibile.

> Sapete dirmi dove è l'inghippo e come posso risolvere il problema?
> 
> 
> Riporto di seguito l'attuale configurazione di iptables:
> 
> Chain INPUT (policy DROP)
> target prot opt source   destination
> ufw-before-logging-input  all  --  anywhere anywhere
> ufw-before-input  all  --  anywhere anywhere
> ufw-after-input  all  --  anywhere anywhere
> ufw-after-logging-input  all  --  anywhere anywhere
> ufw-reject-input  all  --  anywhere anywhere
> ufw-track-input  all  --  anywhere anywhere
> 
> Chain FORWARD (policy DROP)
> target prot opt source   destination
> ufw-before-logging-forward  all  --  anywhere
> anywhere
> ufw-before-forward  all  --  anywhere anywhere
> ufw-after-forward  all  --  anywhere anywhere
> ufw-after-logging-forward  all  --  anywhere
> anywhere
> ufw-reject-forward  all  --  anywhere anywhere
> ufw-track-forward  all  --  anywhere anywhere
> ACCEPT all  --  anywhere anywhere ctstate
> RELATED,ESTABLISHED
> 
> Chain OUTPUT (policy ACCEPT)
> target prot opt source   destination
> ufw-before-logging-output  all  --  anywhere
> anywhere
> ufw-before-output  all  --  anywhere anywhere
> ufw-after-output  all  --  anywhere anywhere
> ufw-after-logging-output  all  --  anywhere anywhere
> ufw-reject-output  all  --  anywhere anywhere
> ufw-track-output  all  --  anywhere anywhere
> 
> Chain ufw-after-forward (1 references)
> target prot opt source   destination
> 
> Chain ufw-after-input (1 references)
> target prot opt source   destination
> ufw-skip-to-policy-input  udp  --  anywhere
> anywhere udp dpt:netbios-ns
> ufw-skip-to-policy-input  udp  --  anywhere
> anywhere udp dpt:netbios-dgm
> ufw-skip-to-policy-input  tcp  --  anywhere
> anywhere tcp dpt:netbios-ssn
> ufw-skip-to-policy-input  tcp  --  anywhere
> anywhere tcp dpt:microsoft-ds
> ufw-skip-to-policy-input  udp  --  anywhere
> anywhere udp dpt:bootps
> ufw-skip-to-policy-input  udp  --  anywhere
> anywhere udp dpt:bootpc
> ufw-skip-to-policy-input  all  --  anywhere
> anywhere ADDRTYPE match dst-type BROADCAST
> 
> Chain ufw-after-logging-forward (1 references)
> target prot opt source   destination
> LOGall  --  anywhere anywhere limit: avg
> 3/min burst 10 LOG level warning prefix "[UFW BLOCK] "
> 
> Chain ufw-after-logging-input (1 references)
> target prot opt source   destination
> LOGall  --  anywhere anywhere limit: avg
> 3/min burst 10 LOG level warning prefix "[UFW BLOCK] "
> 
> Chain ufw-after-logging-output (1 references)
> target prot opt source   destination
> 
> Chain ufw-after-output (1 references)
> target prot opt source   destination
> 
> Chain ufw-before-forward (1 references)
> target prot opt source   destination
> ACCEPT all  --  anywhere anywhere ctstate
> RELATED,ESTABLISHED
> ACCEPT icmp --  anywhere anywhere icmp
> destination-unreachable
> ACCEPT icmp --  anywhere anywhere icmp
> source-quench
> ACCEPT icmp --  anywhere anywhere icmp
> time-exceeded
> ACCEPT icmp --  anywhere anywhere

Re: Routing per access point WiFi creato su Debian

2017-10-03 Per discussione Mattia
> Sapete dirmi dove è l'inghippo e come posso risolvere il problema?

Direi qui:

> Chain FORWARD (policy DROP)

Quella chain riguarda i pacchetti in ingresso ma non destinati
all'host locale (e questo è il tuo caso). O decidi di fare forward di
tutto (policy ACCEPT) oppure fai forward dei pacchetti da e verso la
rete 192.168.8.0/24.
Ci sarà qualcosa nella configurazione di ufw per abilitare il forward,
non so indicartela perché non l'ho mai utilizzato.

Ciao

-- 
Mattia



Routing per access point WiFi creato su Debian

2017-10-02 Per discussione Lucio Marinelli
Ciao a tutti, ho un PC con Debian 9.1 collegato a internet via cavo
(interfaccia enp2s0) che vorrei utilizzare come router wifi. Ho collegato
un usb dongle Netgear che viene perfettamente riconosciuto (l'interfaccia
di rete viene chiamata wlxe0469aa53965 invece che wlan0). Ho quindi seguito
le istruzioni riportate qui per creare la rete wifi a cui collegare altri
dispositivi utilizzando hostapd:

https://seravo.fi/2014/create-wireless-access-point-hostapd

Di fatto ho creato una rete WiFi con indirizzi 192.168.8.0/24 che dovrebbe
riuscire a fare routing dei pacchetti sull'indirizzo IP della macchina
host. La rete funziona così come il DHCP e riesco quindi a collegarmi con
il cellulare o altri dispositivi, tuttavia i pacchetti non sembrano
entrare/uscire e quindi di fatto non funziona internet.

Sapete dirmi dove è l'inghippo e come posso risolvere il problema?


Riporto di seguito l'attuale configurazione di iptables:

Chain INPUT (policy DROP)
target prot opt source   destination
ufw-before-logging-input  all  --  anywhere anywhere
ufw-before-input  all  --  anywhere anywhere
ufw-after-input  all  --  anywhere anywhere
ufw-after-logging-input  all  --  anywhere anywhere
ufw-reject-input  all  --  anywhere anywhere
ufw-track-input  all  --  anywhere anywhere

Chain FORWARD (policy DROP)
target prot opt source   destination
ufw-before-logging-forward  all  --  anywhere
anywhere
ufw-before-forward  all  --  anywhere anywhere
ufw-after-forward  all  --  anywhere anywhere
ufw-after-logging-forward  all  --  anywhere
anywhere
ufw-reject-forward  all  --  anywhere anywhere
ufw-track-forward  all  --  anywhere anywhere
ACCEPT all  --  anywhere anywhere ctstate
RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT)
target prot opt source   destination
ufw-before-logging-output  all  --  anywhere
anywhere
ufw-before-output  all  --  anywhere anywhere
ufw-after-output  all  --  anywhere anywhere
ufw-after-logging-output  all  --  anywhere anywhere
ufw-reject-output  all  --  anywhere anywhere
ufw-track-output  all  --  anywhere anywhere

Chain ufw-after-forward (1 references)
target prot opt source   destination

Chain ufw-after-input (1 references)
target prot opt source   destination
ufw-skip-to-policy-input  udp  --  anywhere
anywhere udp dpt:netbios-ns
ufw-skip-to-policy-input  udp  --  anywhere
anywhere udp dpt:netbios-dgm
ufw-skip-to-policy-input  tcp  --  anywhere
anywhere tcp dpt:netbios-ssn
ufw-skip-to-policy-input  tcp  --  anywhere
anywhere tcp dpt:microsoft-ds
ufw-skip-to-policy-input  udp  --  anywhere
anywhere udp dpt:bootps
ufw-skip-to-policy-input  udp  --  anywhere
anywhere udp dpt:bootpc
ufw-skip-to-policy-input  all  --  anywhere
anywhere ADDRTYPE match dst-type BROADCAST

Chain ufw-after-logging-forward (1 references)
target prot opt source   destination
LOGall  --  anywhere anywhere limit: avg
3/min burst 10 LOG level warning prefix "[UFW BLOCK] "

Chain ufw-after-logging-input (1 references)
target prot opt source   destination
LOGall  --  anywhere anywhere limit: avg
3/min burst 10 LOG level warning prefix "[UFW BLOCK] "

Chain ufw-after-logging-output (1 references)
target prot opt source   destination

Chain ufw-after-output (1 references)
target prot opt source   destination

Chain ufw-before-forward (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere anywhere ctstate
RELATED,ESTABLISHED
ACCEPT icmp --  anywhere anywhere icmp
destination-unreachable
ACCEPT icmp --  anywhere anywhere icmp
source-quench
ACCEPT icmp --  anywhere anywhere icmp
time-exceeded
ACCEPT icmp --  anywhere anywhere icmp
parameter-problem
ACCEPT icmp --  anywhere anywhere icmp
echo-request
ufw-user-forward  all  --  anywhere anywhere

Chain ufw-before-input (1 references)
target prot opt source   destination
ACCEPT all  --  anywhere anywhere
ACCEPT all  --  anywhere anywhere ctstate
RELATED,ESTABLISHED
ufw-logging-deny  all  --  anywhere anywhere
ctstate INVALID
DROP   all  --  anywhere anywhere ctstate
INVALID
ACCEPT icmp --  anywhere anywhere icmp
destination-unreachable
ACCEPT icmp --  anywhere anywhere icmp
source-quench
ACCEPT icmp --  anywhere