Scrivo in questa sezione perché non me la cavo molto bene con l'inglese.
Vorrei realizzare un access point che mi permetta di condividere la connessione GSM del mio Raspberry Pi 3 (sul quale gira
Raspbian Buster Lite, versione 2019-07-10) con altri dispositivi WiFi. Per connettermi al Raspberry anche via internet, inoltre, sto usando Hamachi.
Ho collegato il Raspberry a una scheda Waveshare SIM7600E-H, che sono riuscito a configurare e connettere a internet. Anche Hamachi è configurato e funziona correttamente.
Il problema è nella creazione dell'access point WiFi, dato che sono riuscito a rendere visibile la rete creata dal Raspberry, ma non riesco a collegarvici utilmente alcun dispositivo (un computer Windows 10 riesce a connettersi, ma mi dà un indirizzo IP "strano" e nessuna connessione né al Rasspberry, né a internet; gli smarphone Android invece non si collegano proprio e mi ripetono continuamente "Acquisizione indirizzo IP...").
Dopo essere riuscito a configurare la connessione a internet del modem e la connessione Hamachi, per la creazione dell'access point ho seguito inizialmente questa guida: https://www.raspberrypi.org/documentati ... s-point.md modificando i riferimenti a eth0 con wwan0.
Non essendo riuscito a far funzionare l'AP, ho iniziato a fare altre modifiche nella configurazione, attingendo da diverse altre guide e sperando sempre di non aver aumentato i danni. Con alcune impostazioni ho persino perso la connessione a internet del modem, ma sono riuscito a correggere questi errori.
Per permettervi di aiutarmi, vi posto il risultato di alcuni comandi (tutti dati da utente root):
Code: Select all
brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.b827eb828b19 no wlan0
=====-----=====
brctl showstp br0
br0
bridge id 8000.b827eb828b19
designated root 8000.b827eb828b19
root port 0 path cost 0
max age 20.00 bridge max age 20.00
hello time 2.00 bridge hello time 2.00
forward delay 15.00 bridge forward delay 15.00
ageing time 300.00
hello timer 0.00 tcn timer 0.00
topology change timer 0.00 gc timer 227.94
flags
wlan0 (1)
port id 8001 state forwarding
designated root 8000.b827eb828b19 path cost 100
designated bridge 8000.b827eb828b19 message age timer 0.00
designated port 8001 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
=====-----=====
brctl showmacs br0
port no mac addr is local? ageing timer
1 b8:27:eb:82:8b:19 yes 0.00
=====-----=====
ifconfig
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.4.1 netmask 255.255.255.0 broadcast 192.168.4.255
inet6 fe80::f037:7a4d:b670:f13 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:82:8b:19 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24 bytes 2998 (2.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:d7:de:4c txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ham0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1404
inet 25.102.234.249 netmask 255.0.0.0 broadcast 25.255.255.255
inet6 fe80::7879:19ff:fe66:eaf9 prefixlen 64 scopeid 0x20<link>
inet6 2620:9b::1966:eaf9 prefixlen 96 scopeid 0x0<global>
inet6 fe80::6837:eff:83b4:5fb8 prefixlen 64 scopeid 0x20<link>
ether 7a:79:19:66:ea:f9 txqueuelen 1000 (Ethernet)
RX packets 13127 bytes 1219775 (1.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1046 bytes 385972 (376.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 153 bytes 11896 (11.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 153 bytes 11896 (11.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.4.2 netmask 255.255.255.0 broadcast 192.168.4.255
ether b8:27:eb:82:8b:19 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 5392 (5.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wwan0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 1.172.141.19 netmask 255.255.255.248 destination 1.172.141.19
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 13397 bytes 2088014 (1.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1318 bytes 463653 (452.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
=====-----=====
ipmaddr
1: lo
inet 224.0.0.1
inet6 ff02::1
inet6 ff01::1
2: eth0
link 33:33:00:00:00:01
link 01:00:5e:00:00:01
inet 224.0.0.1
inet6 ff02::1
inet6 ff01::1
4: wlan0
link 33:33:00:00:00:01
link 01:00:5e:00:00:01
link 01:00:5e:00:00:fb
inet 224.0.0.251
inet 224.0.0.1
inet6 ff02::1
inet6 ff01::1
5: br0
link 33:33:00:00:00:01
link 01:00:5e:00:00:01
link 33:33:ff:70:0f:13
link 33:33:00:00:00:fb
link 01:00:5e:00:00:fb
inet 224.0.0.251
inet 224.0.0.1
inet6 ff02::fb
inet6 ff02::1:ff70:f13
inet6 ff02::1
inet6 ff01::1
7: wwan0
inet 224.0.0.1
inet6 ff02::1
inet6 ff01::1
8: ham0
link 33:33:00:00:00:01
link 01:00:5e:00:00:01
link 33:33:ff:66:ea:f9
link 01:00:5e:00:00:fb
link 33:33:00:00:00:fb
link 33:33:ff:b4:5f:b8
inet 224.0.0.251
inet 224.0.0.1
inet6 ff02::1:ffb4:5fb8
inet6 ff02::fb
inet6 ff02::1:ff66:eaf9 users 2
inet6 ff02::1
inet6 ff01::1
=====-----=====
ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:d7:de:4c brd ff:ff:ff:ff:ff:ff
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether b8:27:eb:82:8b:19 brd ff:ff:ff:ff:ff:ff
inet 192.168.4.2/24 brd 192.168.4.255 scope global noprefixroute wlan0
valid_lft forever preferred_lft forever
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b8:27:eb:82:8b:19 brd ff:ff:ff:ff:ff:ff
inet 192.168.4.1/24 brd 192.168.4.255 scope global noprefixroute br0
valid_lft forever preferred_lft forever
inet6 fe80::f037:7a4d:b670:f13/64 scope link
valid_lft forever preferred_lft forever
7: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/none
inet 1.172.141.19/29 scope global wwan0
valid_lft forever preferred_lft forever
8: ham0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1404 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 7a:79:19:66:ea:f9 brd ff:ff:ff:ff:ff:ff
inet 25.102.234.249/8 brd 25.255.255.255 scope global ham0
valid_lft forever preferred_lft forever
inet 169.254.232.22/16 brd 169.254.255.255 scope global noprefixroute ham0
valid_lft forever preferred_lft forever
inet6 2620:9b::1966:eaf9/96 scope global
valid_lft forever preferred_lft forever
inet6 fe80::6837:eff:83b4:5fb8/64 scope link
valid_lft forever preferred_lft forever
inet6 fe80::7879:19ff:fe66:eaf9/64 scope link
valid_lft forever preferred_lft forever
=====-----=====
netstat -tupl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:domain 0.0.0.0:* LISTEN 538/dnsmasq
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN 551/sshd
tcp6 0 0 [::]:ftp [::]:* LISTEN 625/proftpd: (accep
tcp6 0 0 [::]:domain [::]:* LISTEN 538/dnsmasq
tcp6 0 0 [::]:ssh [::]:* LISTEN 551/sshd
udp 0 0 1-172-141-19.dyna:39456 0.0.0.0:* 902/hamachid
udp 0 0 0.0.0.0:domain 0.0.0.0:* 538/dnsmasq
udp 0 0 0.0.0.0:bootps 0.0.0.0:* 538/dnsmasq
udp 0 0 0.0.0.0:bootpc 0.0.0.0:* 479/dhcpcd
udp 0 0 0.0.0.0:52809 0.0.0.0:* 902/hamachid
udp 0 0 0.0.0.0:56964 0.0.0.0:* 366/avahi-daemon: r
udp 0 0 0.0.0.0:mdns 0.0.0.0:* 366/avahi-daemon: r
udp6 0 0 [::]:domain [::]:* 538/dnsmasq
udp6 0 0 [::]:56376 [::]:* 366/avahi-daemon: r
udp6 0 0 [::]:mdns [::]:* 366/avahi-daemon: r
=====-----=====
netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 1.172.141.20 0.0.0.0 UG 0 0 0 wwan0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ham0
1.172.141.16 0.0.0.0 255.255.255.248 U 0 0 0 wwan0
25.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 ham0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 ham0
192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
=====-----=====
ip route show
default via 1.172.141.20 dev wwan0
default dev ham0 scope link src 169.254.232.22 metric 208
1.172.141.16/29 dev wwan0 proto kernel scope link src 1.172.141.19
25.0.0.0/8 dev ham0 proto kernel scope link src 25.102.234.249
169.254.0.0/16 dev ham0 scope link src 169.254.232.22 metric 208
192.168.4.0/24 dev br0 proto dhcp scope link src 192.168.4.1 metric 205
192.168.4.0/24 dev wlan0 proto dhcp scope link src 192.168.4.2 metric 304
=====-----=====
netstat -ln --tcp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::21 :::* LISTEN
tcp6 0 0 :::53 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
=====-----=====
netstat -l --inet
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
udp 0 0 1-172-141-19.dyna:39456 0.0.0.0:*
udp 0 0 0.0.0.0:domain 0.0.0.0:*
udp 0 0 0.0.0.0:bootps 0.0.0.0:*
udp 0 0 0.0.0.0:bootpc 0.0.0.0:*
udp 0 0 0.0.0.0:52809 0.0.0.0:*
udp 0 0 0.0.0.0:56964 0.0.0.0:*
udp 0 0 0.0.0.0:mdns 0.0.0.0:*
raw 0 0 0.0.0.0:icmp 0.0.0.0:* 7
=====-----=====
iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
=====-----=====
ip neigh
25.66.200.16 dev ham0 lladdr 7a:79:19:42:c8:10 REACHABLE
=====-----=====
arp
Address HWtype HWaddress Flags Mask Iface
25.66.200.16 ether 7a:79:19:42:c8:10 C ham0
=====-----=====
/home/pi/documenti/config/ip.sh
Connesso a internet. IP: 91.253.70.133
/etc/dnsmasq.conf
Code: Select all
interface=wlan0 # Use the require wireless interface - usually wlan0
dhcp-range=192.168.4.3,192.168.4.20,255.255.255.0,24h
/etc/dhcpcd.conf
Code: Select all
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# Most distributions have NTP support.
#option ntp_servers
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private
# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1
# fallback to static profile on eth0
#interface eth0
#fallback static_eth0
# Blocco wlan0
# Aggiungi denyinterfaces wlan0 e denyinterfaces eth0 alla fine del file
# (ma sopra ogni altra interface riga aggiunta ) e salva il file.
# Istruzioni da:
# https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md
# Vedere anche:
# https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=245820&p=1502816&hilit=wifi+bridge+buster&sid=e76d055495c78974824de260846c8e6a#p1502816
#denyinterfaces wlan0 wwan0 eth0
#denyinterfaces eth0
#denyinterfaces wwan0
# IP statico per il server
interface wlan0
static ip_address=192.168.4.2/24
# nohook wpa_supplicant
interface br0
static ip_address=192.168.4.1/24
nohook wpa_supplicant
/etc/hostapd/hostapd.conf
Code: Select all
# esempio da http://guide.debianizzati.org/index.php/Wireless_Access_Point_(WAP)_personalizzato
# poi sarà personalizzato
# altra guida utile: https://wireless.wiki.kernel.org/en/users/documentation/hostapd
# Wireless interface
interface=wlan0
driver=nl80211
bridge=br0
country_code=IT
# Wireless environment
ssid=xxxxxxxx # nome oscurato
hw_mode=g
channel=5
# 802.11n
wme_enabled=1
ieee80211n=0
ht_capab=[HT40+][RX-STBC1][SMPS-STATIC][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40]
# Authentication and encryption
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=xxxxxxxx # password oscurata
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Grazie per l'attenzione e per l'aiuto che potrete darmi.