Skip to main content

205.1 Configurações básicas de Redes


Este tópico mostra algumas configurações básicas de Redes.



ifconfig


Veja aqui.

Uma curiosidade é que se não for declarado a máscara (opção MASK, como 255.255.255.0 por exemplo) ele usará a máscara padrão da classe do IP que estiver usando.



Interface Alias


Interface alias é uma forma de criar mais de uma interface lógica em uma mesma interface física. Para os testes instale o pacote abaixo:

$ sudo apt install net-tools

Agora vamos criar as interfaces lógicas:

# Agora adicione uma interface logica:
$ sudo ifconfig eth0:0 172.16.0.10

# Verifique se criou:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.121.105 netmask 255.255.255.0 broadcast 192.168.121.255
inet6 fe80::5054:ff:fe81:5dc2 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)
RX packets 10027 bytes 971337 (971.3 KB)
RX errors 0 dropped 4325 overruns 0 frame 0
TX packets 3389 bytes 374378 (374.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.0.10 netmask 255.255.0.0 broadcast 172.16.255.255
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)


# Usando o comando IP:
$ ip a
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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 52:54:00:81:5d:c2 brd ff:ff:ff:ff:ff:ff
inet 192.168.121.105/24 brd 192.168.121.255 scope global dynamic eth0
valid_lft 3297sec preferred_lft 3297sec
inet 172.16.0.10/16 brd 172.16.255.255 scope global eth0:0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe81:5dc2/64 scope link
valid_lft forever preferred_lft forever


# Usando outro método para criar:
$ sudo ifconfig eth0 add 172.16.1.10


# Verifique:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.121.105 netmask 255.255.255.0 broadcast 192.168.121.255
inet6 fe80::5054:ff:fe81:5dc2 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)
RX packets 10240 bytes 987248 (987.2 KB)
RX errors 0 dropped 4419 overruns 0 frame 0
TX packets 3444 bytes 380168 (380.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.0.10 netmask 255.255.0.0 broadcast 172.16.255.255
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)

eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.1.10 netmask 255.255.255.0 broadcast 192.168.121.255
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)

Link de como criar uma configuração dessa permanente. Caso queira fazer isso usando o comando IP: sudo ip addr add 192.168.1.100/24 brd + dev eth0 label eth0:0

$ sudo ip addr add 192.168.10.1/24 brd + dev eth0 label eth0:1

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.121.105 netmask 255.255.255.0 broadcast 192.168.121.255
inet6 fe80::5054:ff:fe81:5dc2 prefixlen 64 scopeid 0x20<link>
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)
RX packets 1060 bytes 105646 (105.6 KB)
RX errors 0 dropped 195 overruns 0 frame 0
TX packets 549 bytes 67495 (67.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)

eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.1 netmask 255.255.255.0 broadcast 192.168.10.255
ether 52:54:00:81:5d:c2 txqueuelen 1000 (Ethernet)


Interface MAC


É possível mudar o endereço MAC de uma placa, mas para isso ela precisa aceitar esse tipo de mudança:

# Mude o MAC:
$ sudo ifconfig eth0 hw ether 12:40:a2:18:5f:c9

# Verifique:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.121.105 netmask 255.255.255.0 broadcast 192.168.121.255
inet6 fe80::5054:ff:fe81:5dc2 prefixlen 64 scopeid 0x20<link>
ether 12:40:a2:18:5f:c9 txqueuelen 1000 (Ethernet)
RX packets 572 bytes 66757 (66.7 KB)
RX errors 0 dropped 223 overruns 0 frame 0
TX packets 228 bytes 26704 (26.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


### Usando o comando IP

# Mude o MAC usando o comando IP:
$ sudo ip link set dev eth0 address 00:40:a2:18:5f:c0

# Verifique:
$ ip a
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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:40:a2:18:5f:c0 brd ff:ff:ff:ff:ff:ff
inet 192.168.121.105/24 brd 192.168.121.255 scope global dynamic eth0
valid_lft 3598sec preferred_lft 3598sec
inet6 fe80::5054:ff:fe81:5dc2/64 scope link
valid_lft forever preferred_lft forever


Detalhes do Ifconfig


Na saída do comando ifconfig é possível notar alguns campos contendo informações, vejamos abaixo.

InformaçõesDescrição
ErrorsErros na formação do pacote (não é erro de interface).
DroppedFalha na comunicação com com o SW ou Host.
OverrunsDescarte por sobrecarga.
FramePacote mal formatado (padrão incorreto).
CarrierProblemas no cabeamento, pode ser energia causando interferência.
CollisionsMuito difícil de acontecer.


Router


O comando route é usado para ver a tabela de roteamento, mas já é um comando antigo e não vem mais por padrão nas distribuições Linux.


$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.121.1 0.0.0.0 UG 100 0 0 eth0
192.168.121.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.121.1 0.0.0.0 255.255.255.255 UH 100 0 0 eth0

O Destino apontando para 0.0.0.0 significa que temos uma rota default (rota padrão) saindo pelo GW (Gateway) 192.168.121.1. Isso quer dizer que sempre que a máquina não conhecer a rota, ele vai mandar para a rota default (normalmente é o gateway da Rede).


Podemos adicionar uma rota default com o comando abaixo:

$ sudo route add -net 0.0.0.0/0 gw IP

# Ou simplesmente adicionar uma rota:
$ sudo route add -net IP/MASK gw IP


IP


Veja aqui.



ARP - Address Resolution Protocol


Usado para mapear endereços físicos (MAC) em endereços lógicos (IP). Em redes Ethernet quando um host vai se comunicar com outro, principalmente no mesmo enlace é usado o usado o ARP para endereçar o pacote (camada 2), mesmo que o destino esteja em outro enlace, é usado o ARP para endereçar o pacote para o Gateway da Rede.


$ arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.121.1 ether 52:54:00:4c:21:ac C eth0

Adicione a entrada da tabela:

$ sudo arp -s 192.168.121.2 52:54:AA:4c:AA:AA

# Verifique novamente:
$ arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.121.2 ether 52:54:aa:4c:aa:aa CM eth0
192.168.121.1 ether 52:54:00:4c:21:ac C eth0

Remova a entrada da tabela:

$ sudo arp -d 192.168.121.2

# Verifique novamente:
$ arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.121.1 ether 52:54:00:4c:21:ac C eth0

Ainda é possível adicionar usando um arquivo, para isso o arquivo deve serguir a sintaxe de IP MAC.

# Adicione o mapeamento a partir do arquivo:
$ sudo arp -f macs.txt

Se não for informado o arquivo, o ARP vai tentar pegar do arquivo /etc/ethers.



ARPwatch


Ferramenta de monitoração que fica de olho no mapeamento de IP para MAC, caso mude esse mapemaento ele irá notificar por email ou log (ou ambos).

$ sudo arpwatch -e email@example.br -i eth0

Para deixar persistente veja o arquivo /etc/default/arpwatch.



Rede Wireless


Vamos ver como configurar uma rede Wireless. Primeiro desative o Network Manager para que ele não tente ficar conectando na rede.



IW


Vamos ver com o uso do comando iw.

# Primeiro verifique se está conectado:
$ iw dev wlp58s0 link
Not connected.

## Caso esteja conectado vai mostrar assim:
$ iw dev wlp58s0 link
Connected to e0:b9:e5:e3:e1:43 (on wlp58s0)
SSID: XXXX
freq: 2462
RX: 37427046 bytes (312940 packets)
TX: 3008274 bytes (25731 packets)
signal: -37 dBm
rx bitrate: 1.0 MBit/s
tx bitrate: 65.0 MBit/s MCS 7

bss flags: short-slot-time
dtim period: 1
beacon int: 100

# Faça o Scan para ver os Wifi disponíveis:
$ sudo iw dev wlp58s0 scan
BSS e0:b9:e5:e3:e1:43(on wlp58s0)
last seen: 825495.766s [boottime]
TSF: 2142275065076 usec (24d, 19:04:35)
freq: 2462
beacon interval: 100 TUs
capability: ESS Privacy ShortSlotTime RadioMeasure (0x1411)
signal: -29.00 dBm
last seen: 3996 ms ago
Information elements from Probe Response frame:
SSID: XXXXX
Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0
DS Parameter set: channel 11
ERP: Barker_Preamble_Mode
Extended supported rates: 6.0 9.0 12.0 48.0
RSN: * Version: 1
* Group cipher: TKIP
* Pairwise ciphers: CCMP
* Authentication suites: PSK
* Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)
HT capabilities:
Capabilities: 0x81c
HT20
SM Power Save disabled
RX Greenfield
No RX STBC
Max AMSDU length: 7935 bytes
No DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 8 usec (0x06)
HT RX MCS rate indexes supported: 0-15
HT TX MCS rate indexes are undefined
HT operation:
* primary channel: 11
* secondary channel offset: no secondary
* STA channel width: 20 MHz
* RIFS: 1
* HT protection: no
* non-GF present: 1
* OBSS non-GF present: 0
* dual beacon: 0
* dual CTS protection: 0
* STBC beacon: 0
* L-SIG TXOP Prot: 0
* PCO active: 0
* PCO phase: 0
Extended capabilities:
* Extended Channel Switching
* BSS Transition
* Operating Mode Notification
WPA: * Version: 1
* Group cipher: TKIP
* Pairwise ciphers: TKIP
* Authentication suites: PSK
WMM: * Parameter version 1
* BE: CW 15-1023, AIFSN 3
* BK: CW 15-1023, AIFSN 7
* VI: CW 7-15, AIFSN 2, TXOP 3008 usec
* VO: CW 3-7, AIFSN 2, TXOP 1504 usec
BSS 60:32:b1:b9:cb:c0(on wlp58s0)
last seen: 825495.239s [boottime]
TSF: 118515674718 usec (1d, 08:55:15)
freq: 2412
beacon interval: 100 TUs
capability: ESS Privacy ShortSlotTime (0x0411)
signal: -84.00 dBm
last seen: 4524 ms ago
Information elements from Probe Response frame:
SSID: MARCENARIA 3
Supported rates: 1.0* 2.0* 5.5* 11.0* 9.0 18.0 36.0 54.0
DS Parameter set: channel 1
ERP: Barker_Preamble_Mode
Extended supported rates: 6.0 12.0 24.0 48.0
HT capabilities:
Capabilities: 0x11ee
HT20/HT40
SM Power Save disabled
RX HT20 SGI
RX HT40 SGI
TX STBC
RX STBC 1-stream
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 4 usec (0x05)
HT RX MCS rate indexes supported: 0-15, 32
HT TX MCS rate indexes are undefined
HT operation:
* primary channel: 1
* secondary channel offset: above
* STA channel width: any
* RIFS: 0
* HT protection: no
* non-GF present: 0
* OBSS non-GF present: 0
* dual beacon: 0
* dual CTS protection: 0
* STBC beacon: 0
* L-SIG TXOP Prot: 0
* PCO active: 0
* PCO phase: 0
WPA: * Version: 1
* Group cipher: CCMP
* Pairwise ciphers: CCMP
* Authentication suites: PSK
RSN: * Version: 1
* Group cipher: CCMP
* Pairwise ciphers: CCMP
* Authentication suites: PSK
* Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
Extended capabilities:
BSS Load:
* station count: 0
* channel utilisation: 0/255
* available admission capacity: 31250 [*32us]
WMM: * Parameter version 1
* BE: CW 15-1023, AIFSN 3
* BK: CW 15-1023, AIFSN 7
* VI: CW 7-15, AIFSN 2, TXOP 3008 usec
* VO: CW 3-7, AIFSN 2, TXOP 1504 usec
Overlapping BSS scan params:
* passive dwell: 20 TUs
* active dwell: 10 TUs
* channel width trigger scan interval: 300 s
* scan passive total per channel: 200 TUs
* scan active total per channel: 20 TUs
* BSS width channel transition delay factor: 5
* OBSS Scan Activity Threshold: 0.25 %
WPS: * Version: 1.0
* Wi-Fi Protected Setup State: 2 (Configured)
* Response Type: 3 (AP)
* UUID: 00000000-0000-1000-0000-6032b1b9cbc0
* Manufacturer: TP-Link
* Model: Archer C21
* Model Number: 1.0
* Serial Number: 1.1.1.3
* Primary Device Type: 6-0050f204-1
* Device name: Archer C21
* Config methods: Label, Display, PBC
* RF Bands: 0x3
* Unknown TLV (0x1049, 6 bytes): 00 37 2a 00 01 20

Deixei 2 redes disponíveis, uma é minha e a outra não.




IWLIST


O primeiro comando possui muitas limitações, vamos ver com um comando mais atual.

$ iwlist wlp58s0 scanning
wlp58s0 Scan completed :
Cell 01 - Address: E0:B9:E5:E3:E1:43
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=70/70 Signal level=-31 dBm
Encryption key:on
ESSID:"XXXX"
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=000001f2d93283e8
Extra: Last beacon: 5528ms ago
IE: Unknown: 0005456E747261
IE: Unknown: 010882848B962430486C
IE: Unknown: 03010B
IE: Unknown: 2A0104
IE: Unknown: 32040C121860
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: 46053208010000
IE: Unknown: 2D1A1C081BFFFF000000000000000000000000000000000000000000
IE: Unknown: 3D160B080400000000000000000000000000000000000000
IE: Unknown: 7F080400080000000040
IE: Unknown: DD090010180205000C0000
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD180050F2020101040003A4000027A4000042435E0062322F00
Cell 02 - Address: 18:0D:2C:99:F9:8D
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=20/70 Signal level=-90 dBm
Encryption key:on
ESSID:"CassioMurilo"
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=000001859b94d17e
Extra: Last beacon: 5516ms ago
IE: Unknown: 000C43617373696F4D7572696C6F
IE: Unknown: 010882848B960C121824
IE: Unknown: 03010B
IE: Unknown: 050400010000
IE: Unknown: 2A0104
IE: Unknown: 32043048606C
IE: Unknown: 2D1A2C181FFFFF000000000000000000000000000000000000000000
IE: Unknown: 3D160B000100000000000000000000000000000000000000
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
IE: Unknown: DD1E00904C332C181FFFFF000000000000000000000000000000000000000000
IE: Unknown: DD1A00904C340B000100000000000000000000000000000000000000
IE: Unknown: DD0600E04C020160


IWCONFIG


Similar ao ifconfig, mas é usado para redes Wireless. Com a saída acima vamos configurar nosso Wifi:

# Conecte no Wifi:
$ sudo iwconfig wlp58s0 essid fulano key s:123456789 ap DE:67:6F:62:EE:38

# Pegue IP:
$ sudo dhclient wlp58s0

Vale notar que esse comando não suporta o uso de WPA/WPA2. Mas pode ser usado para conectar num Wifi que já foi conectado anteriormente.



WPA_SUPPLICANT


É usado para conectar em redes Wireless WPA.


Primeiro crie o hash contendo a senha do Wifi.

# O SSID é 'fulano' e a senha é '123456789'
$ sudo bash -c 'wpa_passphrase fulano 123456789 > /etc/wpa_supplicant.conf'

# Veja a senha criada:
$ cat /etc/wpa_supplicant.conf
network={
ssid="fulano"
#psk="123456789"
psk=c1fcb064bb94d2f451d4d29efed503b684daef2dbaeb7edc849d4d3c6ffb0a18
}

Agora conecte no Wifi.

## -B = Run daemon in the background;
## -d = Verbose;
## -i = Interface;
$ sudo wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0 -B -d
wpa_supplicant v2.9
random: getrandom() support available
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
Priority group 0
id=0 ssid='fulano'
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Supported cipher 00-0f-ac:13
nl80211: Supported cipher 00-0f-ac:11
nl80211: Supported cipher 00-0f-ac:12
nl80211: Supports Probe Response offload in AP mode
nl80211: Using driver-based off-channel TX
nl80211: Driver-advertised extended capabilities (default) - hexdump(len=8): 04 00 00 00 00 00 00 40
nl80211: Driver-advertised extended capabilities mask (default) - hexdump(len=8): 04 00 00 00 00 00 00 40
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x55f44c348130
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0104
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 01 04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=040a
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=040b
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=040c
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=040d
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=090a
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=090b
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=090c
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=090d
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 09 0d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0409506f9a09
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=7f506f9a09
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=5): 7f 50 6f 9a 09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0409506f9a1a
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 1a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0801
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 08 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=12
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=1): 12
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=06
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=1): 06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0a07
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 07
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0a11
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0a1a
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 0a 1a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=1101
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 01
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=1102
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 11 02
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0505
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 05 05
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c348130 match=0500
nl80211: kernel reports: Match already configured
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 05 00
nl80211: Failed to register Action frame processing - ignore for now
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
Add interface wlan0 to a new radio phy0
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz 20 mBm
nl80211: 2457-2482 @ 20 MHz 20 mBm (no IR)
nl80211: 2474-2494 @ 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 @ 80 MHz 20 mBm (no IR)
nl80211: 5250-5330 @ 80 MHz 20 mBm (DFS) (no IR)
nl80211: 5490-5730 @ 160 MHz 20 mBm (DFS) (no IR)
nl80211: 5735-5835 @ 80 MHz 20 mBm (no IR)
nl80211: 57240-63720 @ 2160 MHz 0 mBm
nl80211: Added 802.11b mode based on 802.11g information
nl80211: Mode IEEE 802.11g: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467[DISABLED] 2472[DISABLED] 2484[DISABLED]
nl80211: Mode IEEE 802.11a: 5180[NO_IR] 5200[NO_IR] 5220[NO_IR] 5240[NO_IR] 5260[NO_IR][RADAR] 5280[NO_IR][RADAR] 5300[NO_IR][RADAR] 5320[NO_IR][RADAR] 5500[NO_IR][RADAR] 5520[NO_IR][RADAR] 5540[NO_IR][RADAR]
nl80211: Mode IEEE 802.11b: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467[DISABLED] 2472[DISABLED] 2484[DISABLED]
wlan0: Own MAC address: 9c:b6:d0:ef:5b:ff
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=4 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=5 set_tx=0 seq_len=0 key_len=0
wlan0: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
wlan0: Setting scan request: 0.100000 sec
TDLS: TDLS operation not supported by driver
TDLS: Driver uses internal link setup
TDLS: Driver does not support TDLS channel switching
wlan0: WPS: UUID based on MAC address: b5b90042-c16e-5c45-b27c-dcb55b3a884f
ENGINE: Loading builtin engines
ENGINE: Loading builtin engines
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
nl80211: Skip set_supp_port(unauthorized) while not associated
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
wlan0: Added interface wlan0
wlan0: State: DISCONNECTED -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
nl80211: Create interface iftype 10 (P2P_DEVICE)
nl80211: New P2P Device interface p2p-dev-wlan0 (0xb) created
Initializing interface 'p2p-dev-wlan0' conf '/etc/wpa_supplicant.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
Priority group 0
id=0 ssid='fulano'
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Supported cipher 00-0f-ac:13
nl80211: Supported cipher 00-0f-ac:11
nl80211: Supported cipher 00-0f-ac:12
nl80211: Supports Probe Response offload in AP mode
nl80211: Using driver-based off-channel TX
nl80211: Driver-advertised extended capabilities (default) - hexdump(len=8): 04 00 00 00 00 00 00 40
nl80211: Driver-advertised extended capabilities mask (default) - hexdump(len=8): 04 00 00 00 00 00 00 40
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface p2p-dev-wlan0 in phy phy0
nl80211: Set mode ifindex 0 iftype 10 (P2P_DEVICE)
nl80211: Failed to set interface 0 to mode 10: -22 (Invalid argument)
nl80211: Subscribe to mgmt frames with non-AP handle 0x55f44c373f10
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0104
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=040a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=040b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=040c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=040d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=090a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=090b
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=090c
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=090d
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0409506f9a09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=7f506f9a09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0409506f9a1a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0801
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=12
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0a07
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0a11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0a1a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=1101
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=1102
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0505
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x55f44c373f10 match=0500
nl80211: Use (wlan0) to initialize P2P Device rfkill
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
nl80211: Start P2P Device p2p-dev-wlan0 (0xb): Device or resource busy
nl80211: Could not set interface 'p2p-dev-wlan0' UP
nl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=0 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Stop P2P Device p2p-dev-wlan0 (0xb): Network is down
nl80211: Unsubscribe mgmt frames handle 0x8888dd7cc4bfb799 (deinit)
nl80211: Delete P2P Device p2p-dev-wlan0 (0xb): Success
p2p-dev-wlan0: Failed to initialize driver interface
Failed to add interface p2p-dev-wlan0
p2p-dev-wlan0: Cancelling scan request
p2p-dev-wlan0: Cancelling authentication timeout
Off-channel: Clear pending Action frame TX (pending_action_tx=(nil)
P2P: Failed to add P2P Device interface
P2P: Failed to enable P2P Device interface
Daemonize..

# Veja se conectou:
$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wlan0 IEEE 802.11 ESSID:"fulano"
Mode:Managed Frequency:2.437 GHz Access Point: DE:67:6F:62:EE:38
Bit Rate=39 Mb/s Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=70/70 Signal level=-39 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:13 Missed beacon:0

virbr3 no wireless extensions.

virbr3-nic no wireless extensions.

# Pegue IP:
$ sudo dhclient wlan0

# Verifique se pegou IP:
$ ip addr show wlan0 ↵ 1
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 9c:b6:d0:ef:5b:ff brd ff:ff:ff:ff:ff:ff
altname wlp58s0
inet 192.168.100.107/24 brd 192.168.100.255 scope global dynamic wlan0
valid_lft 3288sec preferred_lft 3288sec
inet6 fe80::9eb6:d0ff:feef:5bff/64 scope link
valid_lft forever preferred_lft forever


# Tente pingar:
$ ping -c2 8.8.8.8 ↵ 130
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes de 8.8.8.8: icmp_seq=1 ttl=114 tempo=235 ms
64 bytes de 8.8.8.8: icmp_seq=2 ttl=114 tempo=107 ms

--- 8.8.8.8 estatísticas de ping ---
2 pacotes transmitidos, 2 recebidos, 0% perda de pacote, tempo 1001ms
rtt mín/méd/máx/mdev = 107.337/171.360/235.383/64.023 ms