AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / user-2707061

Tech21101's questions

Martin Hope
Tech21101
Asked: 2025-03-14 10:33:58 +0800 CST

O Wireguard Peer não consegue acessar a Internet com ou sem entrada DNS

  • 7

Para começar, não sou muito versado em redes ou gerenciamento de servidores, então tenham paciência se isso parecer elementar para alguns de vocês.

Eu configurei uma instância do Wireguard rodando em um VPS, usando Debian. Minha intenção é usá-lo para privacidade na internet, pois as opções atuais à minha disposição são inadequadas.

Eu tentei e falhei várias vezes para fazer o Wireguard funcionar corretamente, pois meu(s) dispositivo(s) cliente(s) não conseguem se conectar à internet. Eu consigo me conectar ao servidor sem problemas, o Wireguard mostra o cliente conectado e, sempre que ele está conectado, eu consigo fazer SSH no servidor sem problemas a partir do dispositivo cliente. Eu tentei adicionar um DNS, especificamente o do Google (8.8.8.8, 8.8.4.4), mas isso também não ajuda. Eu não consigo nem fazer ping no DNS quando ele está definido.

Abaixo está minha configuração atual de servidor e cliente:

Cliente:

[Interface]
PrivateKey = [redacted]
Address = 10.0.0.2/32

[Peer]
PublicKey = [redacted]
Endpoint = [redacted]:51820
AllowedIPs = 0.0.0.0/0

Servidor:

PrivateKey = [redacted]
Address = 10.0.0.1/24
ListenPort = 51820

[Peer]
PublicKey = [redacted]
AllowedIPs = 10.0.0.2/32

Qualquer ajuda sobre isso seria apreciada. Já faz um tempo que estou batendo a cabeça na parede sobre isso.

Tabela de roteamento do servidor:

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 [redacted]/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether [redacted] brd ff:ff:ff:ff:ff:ff
    inet [redacted]/25 brd [redacted] scope global dynamic enp1s0
       valid_lft 73624sec preferred_lft 73624sec
    inet6 [redacted]/64 scope link
       valid_lft forever preferred_lft forever
5: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
    link/none
    inet 10.0.0.1/24 scope global wg0
       valid_lft forever preferred_lft forever

Saída das tabelas de IP do servidor:

Chain INPUT (policy DROP 989 packets, 54363 bytes)
 pkts bytes target     prot opt in     out     source               destination
 630K  320M ufw-before-logging-input  0    --  *      *       0.0.0.0/0
   0.0.0.0/0
 630K  320M ufw-before-input  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 213K   12M ufw-after-input  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 212K   12M ufw-after-logging-input  0    --  *      *       0.0.0.0/0
  0.0.0.0/0
 212K   12M ufw-reject-input  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 212K   12M ufw-track-input  0    --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  eth0   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  eth1   *       0.0.0.0/0            0.0.0.0/0
         state RELATED,ESTABLISHED
Chain FORWARD (policy DROP 5286 packets, 1038K bytes)
 pkts bytes target     prot opt in     out     source               destination
 7518 1184K ufw-before-logging-forward  0    --  *      *       0.0.0.0/0
     0.0.0.0/0
 7518 1184K ufw-before-forward  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 5286 1038K ufw-after-forward  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 5286 1038K ufw-after-logging-forward  0    --  *      *       0.0.0.0/0
    0.0.0.0/0
 5286 1038K ufw-reject-forward  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 5286 1038K ufw-track-forward  0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain OUTPUT (policy ACCEPT 225 packets, 20892 bytes)
 pkts bytes target     prot opt in     out     source               destination
 370K   75M ufw-before-logging-output  0    --  *      *       0.0.0.0/0
    0.0.0.0/0
 370K   75M ufw-before-output  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 3564  350K ufw-after-output  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 3564  350K ufw-after-logging-output  0    --  *      *       0.0.0.0/0
   0.0.0.0/0
 3564  350K ufw-reject-output  0    --  *      *       0.0.0.0/0            0.0.0.0/0
 3564  350K ufw-track-output  0    --  *      *       0.0.0.0/0            0.0.0.0/0
  363 36318 ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-after-input (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ufw-skip-to-policy-input  17   --  *      *       0.0.0.0/0
   0.0.0.0/0            udp dpt:137
    0     0 ufw-skip-to-policy-input  17   --  *      *       0.0.0.0/0
   0.0.0.0/0            udp dpt:138
    2    84 ufw-skip-to-policy-input  6    --  *      *       0.0.0.0/0
   0.0.0.0/0            tcp dpt:139
    6   308 ufw-skip-to-policy-input  6    --  *      *       0.0.0.0/0
   0.0.0.0/0            tcp dpt:445
    0     0 ufw-skip-to-policy-input  17   --  *      *       0.0.0.0/0
   0.0.0.0/0            udp dpt:67
    0     0 ufw-skip-to-policy-input  17   --  *      *       0.0.0.0/0
   0.0.0.0/0            udp dpt:68
    4  8908 ufw-skip-to-policy-input  0    --  *      *       0.0.0.0/0
   0.0.0.0/0            ADDRTYPE match dst-type BROADCAST
Chain ufw-after-logging-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
  327 46259 LOG        0    --  *      *       0.0.0.0/0            0.0.0.0/0
         limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
Chain ufw-after-logging-input (1 references)
 pkts bytes target     prot opt in     out     source               destination
  219 11136 LOG        0    --  *      *       0.0.0.0/0            0.0.0.0/0
         limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
Chain ufw-before-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
 1927  126K ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ctstate RELATED,ESTABLISHED
    0     0 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 3
    0     0 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 11
    0     0 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 12
  305 19540 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 8
 5286 1038K ufw-user-forward  0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-before-input (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     0    --  lo     *       0.0.0.0/0            0.0.0.0/0
 211K  188M ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ctstate RELATED,ESTABLISHED
   56 19597 ufw-logging-deny  0    --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate INVALID
   56 19597 DROP       0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ctstate INVALID
    0     0 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 3
    0     0 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 11
    0     0 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 12
   11   626 ACCEPT     1    --  *      *       0.0.0.0/0            0.0.0.0/0
         icmptype 8
    0     0 ACCEPT     17   --  *      *       0.0.0.0/0            0.0.0.0/0
         udp spt:67 dpt:68
20848 1252K ufw-not-local  0    --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     17   --  *      *       0.0.0.0/0            224.0.0.251
         udp dpt:5353
    0     0 ACCEPT     17   --  *      *       0.0.0.0/0            239.255.255.250      udp dpt:1900
20848 1252K ufw-user-input  0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-before-output (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     0    --  *      lo      0.0.0.0/0            0.0.0.0/0
 193K   42M ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ctstate RELATED,ESTABLISHED
 1960  219K ufw-user-output  0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-logging-allow (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 LOG        0    --  *      *       0.0.0.0/0            0.0.0.0/0
         limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW ALLOW] "
Chain ufw-logging-deny (2 references)
 pkts bytes target     prot opt in     out     source               destination
   56 19597 RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ctstate INVALID limit: avg 3/min burst 10
    0     0 LOG        0    --  *      *       0.0.0.0/0            0.0.0.0/0
         limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "
Chain ufw-not-local (1 references)
 pkts bytes target     prot opt in     out     source               destination
20844 1243K RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ADDRTYPE match dst-type LOCAL
    0     0 RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ADDRTYPE match dst-type MULTICAST
    4  8908 RETURN     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         ADDRTYPE match dst-type BROADCAST
    0     0 ufw-logging-deny  0    --  *      *       0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10
    0     0 DROP       0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-skip-to-policy-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-skip-to-policy-input (7 references)
 pkts bytes target     prot opt in     out     source               destination
   12  9300 DROP       0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-skip-to-policy-output (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0
Chain ufw-track-output (1 references)
 pkts bytes target     prot opt in     out     source               destination
   10   600 ACCEPT     6    --  *      *       0.0.0.0/0            0.0.0.0/0
         ctstate NEW
 1362  162K ACCEPT     17   --  *      *       0.0.0.0/0            0.0.0.0/0
         ctstate NEW
Chain ufw-user-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
Chain ufw-user-input (1 references)
 pkts bytes target     prot opt in     out     source               destination
19757 1175K ACCEPT     6    --  *      *       0.0.0.0/0            0.0.0.0/0
         tcp dpt:22
   90 13764 ACCEPT     17   --  *      *       0.0.0.0/0            0.0.0.0/0
         udp dpt:51820
Chain ufw-user-limit (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 LOG        0    --  *      *       0.0.0.0/0            0.0.0.0/0
         limit: avg 3/min burst 5 LOG flags 0 level 4 prefix "[UFW LIMIT BLOCK]
"
    0     0 REJECT     0    --  *      *       0.0.0.0/0            0.0.0.0/0
         reject-with icmp-port-unreachable
Chain ufw-user-limit-accept (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0

Por sugestão do usuário Davidgo, adicionar iptables -t nat -A POSTROUTING -o [YOUR ETHERNET INTERFACE] -j MASQUERADE(interface foi enp1s0no meu caso) e adicionar iptables -I FORWARD -j ACCEPTcorrigiu temporariamente o problema. Após a reinicialização do servidor, essas alterações são revertidas. Tentarei trabalhar em como adicionar essas regras permanentemente.

networking
  • 2 respostas
  • 75 Views

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Como posso reduzir o consumo do processo `vmmem`?

    • 11 respostas
  • Marko Smith

    Baixar vídeo do Microsoft Stream

    • 4 respostas
  • Marko Smith

    O Google Chrome DevTools falhou ao analisar o SourceMap: chrome-extension

    • 6 respostas
  • Marko Smith

    O visualizador de fotos do Windows não pode ser executado porque não há memória suficiente?

    • 5 respostas
  • Marko Smith

    Como faço para ativar o WindowsXP agora que o suporte acabou?

    • 6 respostas
  • Marko Smith

    Área de trabalho remota congelando intermitentemente

    • 7 respostas
  • Marko Smith

    O que significa ter uma máscara de sub-rede /32?

    • 6 respostas
  • Marko Smith

    Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows?

    • 1 respostas
  • Marko Smith

    O VirtualBox falha ao iniciar com VERR_NEM_VM_CREATE_FAILED

    • 8 respostas
  • Marko Smith

    Os aplicativos não aparecem nas configurações de privacidade da câmera e do microfone no MacBook

    • 5 respostas
  • Martin Hope
    Vickel O Firefox não permite mais colar no WhatsApp web? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke Por que os arquivos tar.xz são 15x menores ao usar a biblioteca tar do Python em comparação com o tar do macOS? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh Como posso reduzir o consumo do processo `vmmem`? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Pesquisa do Windows 10 não está carregando, mostrando janela em branco 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 Área de trabalho remota congelando intermitentemente 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney Por que colocar um ponto após o URL remove as informações de login? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension Ponteiro do mouse movendo-se nas teclas de seta pressionadas no Windows? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca Todos os meus complementos do Firefox foram desativados repentinamente, como posso reativá-los? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK É possível criar um código QR usando texto? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 Altere o nome da ramificação padrão do git init 2019-04-01 06:16:56 +0800 CST

Hot tag

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve