La connessione internet del mio PC desktop, vista da Ubuntu

29 Gennaio, 2014 (16:24) | Linux | By: sargonsei

Verifica della connessione a Internet del PC fisso con Ubuntu 15.10 Mate
I comandi:

sudo lshw -c network # informazioni sulle schede di rete rilevate (PCI e USB)
lspci -knn | grep -iA2 net # Verifica la presenza di schede di rete integrate e relativo driver
lsusb

dmesg |grep -i ready # Visualizza il risultato dei tentativi di connettersi a Internet
cat /etc/NetworkManager/NetworkManager.conf # informazioni sul / dal Network Manager e sue connessioni configurate
cat /var/lib/NetworkManager/NetworkManager.state
ls -l /etc/NetworkManager/system-connections

nmcli device status # Status delle reti
cat /etc/network/interfaces # informazioni sulle schede di rete configurate “ignorate dal Network Manager”
ip addr
ifconfig
iwconfig # informazioni sulle schede di rete WIFI
rfkill list all
cat /etc/resolv.conf # informazioni sui server DNS configurati
route -n # tabella di routing
arp
ping -c 5 192.168.1.1 # raggiungibilità del proprio gateway (“router ADSL”)
ping -c 5 8.8.8.8 # raggiungibilità di un host su Internet (senza risoluzione via server DNS)
ping -c 5 google.it # raggiungibilità di un host su Internet (con risoluzione via server DNS)
sudo iwlist wlan0 scan | grep -i ssid # scansione delle reti WIFI nelle vicinanze
sudo iw wlan0 scan | grep -i ssid
nmcli device wifi list ifname DEVICE

sudo iwlist scan # Elenco Reti Wifi disponibili e relative caratteristiche
sudo cat /etc/NetworkManager/system-connections/* # Elenco Reti Wifi configurate e relative caratteristiche
nmcli device list iface wlan0 # Elenco Reti Wifi configurate e relative caratteristiche

L’output:

[email protected]:~$ sudo lshw -c network # informazioni sulle schede di rete rilevate (PCI e USB)

[sudo] password di ubuntu15m4: 
  *-network               
       description: Wireless interface
       physical id: 1
       bus info: [email protected]:2
       logical name: wlan0
       serial: f0:7d:68:6f:9f:7e
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rt2800usb driverversion=3.19.0-31-generic firmware=0.29 ip=192.168.1.101 link=yes multicast=yes wireless=IEEE 802.11bgn

[email protected]:~$ lspci -knn | grep -iA2 net # Verifica la presenza di schede di rete integrate e relativo driver

00:07.0 Bridge [0680]: NVIDIA Corporation MCP61 Ethernet [10de:03ef] (rev a2)
	Subsystem: ASRock Incorporation 939NF6G-VSTA Board [1849:03ef]
	Kernel driver in use: forcedeth

[email protected]:~$ lsusb

Bus 002 Device 002: ID 0bc2:3312 Seagate RSS LLC SRD00F2 Expansion Desktop Drive (STBV)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 07d1:3c0a D-Link System DWA-140 RangeBooster N Adapter(rev.B2) [Ralink RT3072]
Bus 003 Device 007: ID 0603:00f2 Novatek Microelectronics Corp. Keyboard (Labtec Ultra Flat Keyboard)
Bus 003 Device 006: ID 045e:0024 Microsoft Corp. Trackball Explorer
Bus 003 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 003 Device 002: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 05d8:4002 Ultima Electronics Corp. Artec Ultima 2000 (GT6801 based)/Lifetec LT9385/ScanMagic 1200 UB Plus Scanner
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

[email protected]:~$


[email protected]:~$ dmesg |grep -i ready # Visualizza il risultato dei tentativi di connettersi a Internet

[   27.356424] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   27.357727] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   27.361938] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   27.675164] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   30.045833] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   31.424710] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

[email protected]:~$ cat /etc/NetworkManager/NetworkManager.conf # informazioni sul / dal Network Manager e sue connessioni configurate

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=false

[email protected]:~$ cat /var/lib/NetworkManager/NetworkManager.state

[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true
WimaxEnabled=true

[email protected]:~$ ls -l /etc/NetworkManager/system-connections

totale 8
-rw------- 1 root root 268 set  7 17:20 HUAWEI Y330-U01
-rw------- 1 root root 276 set  9 17:40 TP-LINK_2.4GHz_928511

[email protected]:~$ nmcli device status # Status delle reti

DEVICE             TIPO      STATO            CONNESSIONE           
wlan0              wifi      collegato        TP-LINK_2.4GHz_928511 
90:5F:2E:0E:A6:92  bt        scollegato       --                    
eth0               ethernet  non disponibile  --                    
lo                 loopback  non gestito      --                    

[email protected]:~$ cat /etc/network/interfaces # informazioni sulle schede di rete configurate “ignorate dal Network Manager”

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

[email protected]:~$ ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    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 00:19:66:30:48:b2 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether f0:7d:68:6f:9f:7e brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.101/24 brd 192.168.1.255 scope global dynamic wlan0
       valid_lft 84716sec preferred_lft 84716sec
    inet6 fe80::f27d:68ff:fe6f:9f7e/64 scope link 
       valid_lft forever preferred_lft forever

[email protected]:~$ ifconfig

eth0      Link encap:Ethernet  IndirizzoHW 00:19:66:30:48:b2  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:1000 
          Byte RX:0 (0.0 B)  Byte TX:0 (0.0 B)

lo        Link encap:Loopback locale  
          indirizzo inet:127.0.0.1  Maschera:255.0.0.0
          indirizzo inet6: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:807 errors:0 dropped:0 overruns:0 frame:0
          TX packets:807 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:0 
          Byte RX:76938 (76.9 KB)  Byte TX:76938 (76.9 KB)

wlan0     Link encap:Ethernet  IndirizzoHW f0:7d:68:6f:9f:7e  
          indirizzo inet:192.168.1.101  Bcast:192.168.1.255  Maschera:255.255.255.0
          indirizzo inet6: fe80::f27d:68ff:fe6f:9f7e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3009 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2213 errors:0 dropped:0 overruns:0 carrier:0
          collisioni:0 txqueuelen:1000 
          Byte RX:1453614 (1.4 MB)  Byte TX:301900 (301.9 KB)

[email protected]:~$ iwconfig # informazioni sulle schede di rete WIFI

wlan0     IEEE 802.11bgn  ESSID:"TP-LINK_2.4GHz_928511"  
          Mode:Managed  Frequency:2.447 GHz  Access Point: 30:B5:C2:92:85:11   
          Bit Rate=130 Mb/s   Tx-Power=20 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=70/70  Signal level=-27 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:166   Missed beacon:0

lo        no wireless extensions.

eth0      no wireless extensions.

[email protected]:~$ rfkill list all

0: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

[email protected]:~$ cat /etc/resolv.conf # informazioni sui server DNS configurati

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

[email protected]:~$ route -n # tabella di routing

Tabella di routing IP del kernel
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    600    0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlan0

[email protected]:~$ arp

Indirizzo TipoHW IndirizzoHW Flag Maschera Interfaccia
192.168.1.1              ether   30:b5:c2:92:85:11   C                     wlan0

[email protected]:~$ ping -c 5 192.168.1.1 # raggiungibilità del proprio gateway (“router ADSL”)

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.66 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.20 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.589 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.772 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.817 ms

--- 192.168.1.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.589/1.010/1.666/0.385 ms

[email protected]:~$ ping -c 5 8.8.8.8 # raggiungibilità di un host su Internet (senza risoluzione via server DNS)

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=43 time=49.1 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=43 time=45.2 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=43 time=49.0 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=43 time=47.2 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=43 time=48.8 ms

--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 45.281/47.919/49.142/1.503 ms

[email protected]:~$ ping -c 5 google.it # raggiungibilità di un host su Internet (con risoluzione via server DNS)

PING google.it (173.194.116.151) 56(84) bytes of data.
64 bytes from fra02s28-in-f23.1e100.net (173.194.116.151): icmp_seq=1 ttl=53 time=1119 ms
64 bytes from fra02s28-in-f23.1e100.net (173.194.116.151): icmp_seq=2 ttl=53 time=110 ms
64 bytes from fra02s28-in-f23.1e100.net (173.194.116.151): icmp_seq=3 ttl=53 time=35.9 ms
64 bytes from fra02s28-in-f23.1e100.net (173.194.116.151): icmp_seq=4 ttl=53 time=36.2 ms
64 bytes from fra02s28-in-f23.1e100.net (173.194.116.151): icmp_seq=5 ttl=53 time=36.5 ms

--- google.it ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4012ms
rtt min/avg/max/mdev = 35.905/267.833/1119.603/426.866 ms, pipe 2

[email protected]:~$ sudo iwlist wlan0 scan | grep -i ssid # scansione delle reti WIFI nelle vicinanze

                    ESSID:"TP-LINK_2.4GHz_928511"
                    ESSID:"FASTWEB2013"
                    ESSID:"WIND WiFi-8f4c"

[email protected]:~$ sudo iw wlan0 scan | grep -i ssid

	SSID: TP-LINK_2.4GHz_928511
	SSID: FASTWEB2013
	SSID: WIND WiFi-8f4c
	SSID: FASTWEB-1-iNeBPCl6TyeG
	SSID: Extender Netgear

[email protected]:~$ nmcli device wifi list ifname wlan0

*  SSID                    MODALITÀ  CHAN  VELOCITÀ   SEGNALE  BARS  SICUREZZA 
   FASTWEB2013             Infra     1     54 Mbit/s  39       ▂▄__  WPA1      
*  TP-LINK_2.4GHz_928511   Infra     8     54 Mbit/s  95       ▂▄▆█  WPA2      
   WIND WiFi-8f4c          Infra     1     54 Mbit/s  19       ▂___  WPA1 WPA2 
   Extender Netgear        Infra     11    54 Mbit/s  19       ▂___  WPA2      
   FASTWEB-1-iNeBPCl6TyeG  Infra     11    54 Mbit/s  12       ▂___  WPA1 WPA2 

[email protected]:~$


[email protected]:~$ sudo iwlist scan # Elenco Reti Wifi disponibili e relative caratteristiche

wlan0     Scan completed :
          Cell 01 - Address: 30:B5:C2:92:85:11
                    Channel:8
                    Frequency:2.447 GHz (Channel 8)
                    Quality=70/70  Signal level=-27 dBm  
                    Encryption key:on
                    ESSID:"TP-LINK_2.4GHz_928511"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=000000c6215e67e8
                    Extra: Last beacon: 32ms ago
                    IE: Unknown: 001554502D4C494E4B5F322E3447487A5F393238353131
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030108
                    IE: Unknown: 2A0100
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2D1AEF111BFFFFFF00000000000000000001000000000406E6470D00
                    IE: Unknown: 3D1608080000000000000000000000000000000000000000
                    IE: Unknown: 4A0E14000A002C01C800140005001900
                    IE: Unknown: 7F080100000000000040
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
                    IE: Unknown: DD920050F204104A0001101044000101103B000103104700100000000000001000000030B5C29285101021000754502D4C494E4B1023000941726368657220443710240003312E301042000C3330423543323932383531311054000800060050F204000110110009417263686572204437100800020086103C000100104900140024E26002000101600000020001600100020001
          Cell 02 - Address: 00:14:7F:09:89:B6
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=31/70  Signal level=-79 dBm  
                    Encryption key:on
                    ESSID:"FASTWEB2013"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000020b00745917
                    Extra: Last beacon: 32ms ago
                    IE: Unknown: 000B4641535457454232303133
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 030101
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: Unknown: 32040C121860
                    IE: Unknown: DD060010180200F0
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
          Cell 03 - Address: 0C:37:DC:27:8F:4C
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=23/70  Signal level=-87 dBm  
                    Encryption key:on
                    ESSID:"WIND WiFi-8f4c"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000004025a3ebbf
                    Extra: Last beacon: 29440ms ago
                    IE: Unknown: 000E57494E4420576946692D38663463
                    IE: Unknown: 010882848B0C12961824
                    IE: Unknown: 030101
                    IE: Unknown: 0706495420010D14
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2D1A2C0000FF00000000000000000000008000000000000000000000
                    IE: Unknown: 3D1601000100000000000000000000000000000000000000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
          Cell 04 - Address: F0:84:2F:AB:D0:13
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=17/70  Signal level=-93 dBm  
                    Encryption key:on
                    ESSID:"FASTWEB-1-iNeBPCl6TyeG"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=00000028492d1980
                    Extra: Last beacon: 32ms ago
                    IE: Unknown: 0016464153545745422D312D694E654250436C3654796547
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 03010B
                    IE: Unknown: 2A0104
                    IE: Unknown: 2F0104
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1A3C181BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160B080400000000000000000000000000000000000000
                    IE: Unknown: 7F080400000000000040
                    IE: Unknown: DD940050F204104A00011010440001021041000100103B00010310470010AE45656080545EB4AE2378CA1510D4C21021000D4144422042726F616462616E64102300065656323232321024000D353237303149303035353439361042000D35323730314930303535343936105400080006D4D18404000110110006565632323232100800020000103C0001011049000600372A000120
                    IE: Unknown: DD090010180201000C0000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101840003A4000027A4000042435E0062322F00
                    IE: Unknown: 46057200010000
          Cell 05 - Address: E4:F4:C6:DB:49:44
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=21/70  Signal level=-89 dBm  
                    Encryption key:on
                    ESSID:"Extender Netgear"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s
                              18 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000002847fae194
                    Extra: Last beacon: 32ms ago
                    IE: Unknown: 0010457874656E646572204E657467656172
                    IE: Unknown: 010882848B961224486C
                    IE: Unknown: 03010B
                    IE: Unknown: 2A0100
                    IE: Unknown: 32040C183060
                    IE: Unknown: 2D1AEC0117FFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160B000000000000000000000000000000000000000000
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
                    IE: Unknown: 0B0500000E127A
                    IE: Unknown: DD07000C4303000000
                    IE: Unknown: 0706444520010D10
                    IE: Unknown: DD8D0050F204104A0001101044000102103B000103104700102880288028801880A880E4F4C6DB4944102100044E54475210230008574E3330303052501024000256321042000C6534663463366462343934341054000800060050F204000110110017574E333030305250763228576972656C6573732041502910080002210C103C0001011049000600372A000120

lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

[email protected]:~$ sudo cat /etc/NetworkManager/system-connections/* # Elenco Reti Wifi configurate e relative caratteristiche

[connection]
id=HUAWEI Y330-U01
uuid=94644c69-126f-4e1b-b003-2a045fa1233b
type=wifi

[wifi]
ssid=HUAWEI Y330-U01
mode=infrastructure
mac-address=F0:7D:68:6F:9F:7E

[wifi-security]
key-mgmt=wpa-psk
auth-alg=open
psk=39f773b31d1d

[ipv4]
method=auto

[ipv6]
method=auto
[connection]
id=TP-LINK_2.4GHz_928511
uuid=5afe6c96-6df5-4606-8987-d891bcf6dc3d
type=wifi

[wifi]
ssid=TP-LINK_2.4GHz_928511
mode=infrastructure
mac-address=F0:7D:68:6F:9F:7E

[wifi-security]
key-mgmt=wpa-psk
auth-alg=open
psk=49778410

[ipv4]
method=auto

[ipv6]
method=auto

[email protected]:~$