As redes Debian WIFI não estão disponíveis não podem se conectar à internet

1

Instalei o debian 9 e tudo funcionou perfeitamente - consegui descobrir redes e conectar-me à Internet. O problema surgiu quando decidi mudar de atribuir um endereço IP automaticamente via DHCP a um IP estático alterando este arquivo /etc/network/interfaces . Percebendo que não consegui me conectar à internet após a reinicialização, tentei "consertar" isso e outras "correções" que não consigo lembrar e agora o arquivo se parece com isso:

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
auto enp0s31f6
allow-hotplug enp0s31f6

iface enp0s31f6 inet dhcp

auto wlp2s0
allow-hotplug wlp2s0
iface wlp2s0 inet dhcp

**EDIT**
address 10.0.0.163
netmask 255.255.255.0
gateway 10.0.0.1

Aqui está a saída de ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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: enp0s31f6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 14:b3:1f:17:c8:36 brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether f8:59:71:a6:57:4d brd ff:ff:ff:ff:ff:ff

e finalmente é isso que eu recebo     sudo systemctl status networking.service

networking.service - Raise network interfaces
 Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor 
 preset: enabled)
 Active: active (exited) since Tue 2017-09-26 12:23:50 EAT; 34s ago
 Docs: man:interfaces(5)
 Process: 5293 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo    (code=exited, status=0/SUCCESS)

 Process: 5419 ExecStart=/sbin/ifup -a --read-environment (code=exited,     status=0/SUCCESS)

Process: 5413 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ]          && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=exited, status=0/SUCCESS)

Main PID: 5419 (code=exited, status=0/SUCCESS)
Tasks: 2 (limit: 4915)
CGroup: /system.slice/networking.service
       ├─5473 /sbin/dhclient -4 -v -pf /run/dhclient.enp0s31f6.pid -lf   /var/lib/dhcp/dhclient.enp0s31f6.leases -I -df /var/lib/dhcp/dhclient6.enp0s31f6.leases enp0s31f6
       └─5581 /sbin/dhclient -4 -v -pf /run/dhclient.wlp2s0.pid -lf /var/lib/dhcp/dhclient.wlp2s0.leases -I -df /var/lib/dhcp/dhclient6.wlp2s0.leases wlp2s0
    
por Bantu 26.09.2017 / 12:05

1 resposta

1

Edite seu /etc/network/interfaces da seguinte forma:

auto lo
iface lo inet loopback

Configure um IP estático para sua interface ethernet: método dhcpcd

Instale dhcpcd :

sudo apt install dhcpcd5

Edite seu arquivo /etc/dhcpcd.conf :

sudo nano /etc/dhcpcd.conf

Após as seguintes linhas:

# define static profile 
profile static_enp0s31f6 
static ip_address=10.0.0.163 /24 
static routers=10.0.0.1 
static domain_name_servers=10.0.0.1 

# fallback to static profile on enp0s31f6 
interface enp0s31f6 
fallback static_enp0s31f6

Em seguida, desative o daemon dhcpcd :

sudo update-rc.d -f dhcpcd remove

ativar a rede:

sudo systemctl enable networking 

Reinicie e execute:

 sudo iptables -t nat -A POSTROUTING -o enp0s31f6 -j MASQUERADE
 sudo dhcpcd

wiki do Archlinux dhcpcd

    
por 26.09.2017 / 17:16