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-304112

Kheldar Ambar's questions

Martin Hope
Kheldar Ambar
Asked: 2024-04-23 03:15:39 +0800 CST

Ponte roteada KVM para sub-rede adicional em Hetzner usando Netplan

  • 5

Eu tenho um servidor Ubuntu 22.04 dedicado na Hetzner rodando KVM. Atribuí endereços IP de uma sub-rede adicional às VMs convidadas. Posso acessar as VMs convidadas por meio de seus endereços IP públicos conforme pretendido.

Recebi um e-mail da Hetzner dizendo que estou usando endereços Mac "não permitidos" e ameaçando bloquear o servidor. Os endereços MAC "não permitidos" pertencem às VMs convidadas. O suporte da Hetzner diz "Você deve ter certeza de que nenhum endereço MAC de suas VMs ficará visível com o uplink público em seu dispositivo de rede." Alguém sabe como cumprir as regras de rede da Hetzner? Aqui está minha configuração:

  1. SERVIDOR FÍSICO
$ sudo cat /etc/netplan/01-netcfg.yaml
    ### Hetzner Online GmbH installimage
    network:
      version: 2
      renderer: networkd
      ethernets:
        enp98s0f0:
          match:
            macaddress: xx:xx:xx:xx:xx:fa
          dhcp4: no
          dhcp6: no
      bridges:
        br0:
          macaddress: xx:xx:xx:xx:xx:fa
          interfaces:
            - enp98s0f0
          dhcp4: no
          dhcp6: no
          addresses:
            - aa.bb.cc.108/32 # Physical NIC (Main IP)
            - aa.bb.cc.65/28 # First usable IP of the additional subnet
          routes:
            - to: 0.0.0.0/0
              via: aa.bb.cc.105 # Gateway for Main IP on physical NIC
              on-link: true
            - to: aa.bb.cc.64/28 # Additional subnet
              via: aa.bb.cc.65 # First usable IP of the additional subnet assigned to physical NIC above
              on-link: true
          nameservers:
            addresses:
              - 185.12.64.2
              - 185.12.64.1
          parameters:
            stp: false
            forward-delay: 0

$ cat /etc/sysctl.d/10-forwarding.conf 
net.ipv4.ip_forward=1
#net.ipv4.conf.enp98s0f0.send_redirects=0
net.ipv4.conf.all.proxy_arp=1
net.ipv4.conf.all.forwarding=1
$ cat br0.xml
<network>
    <name>br0</name>
    <forward mode='bridge'/>
    <bridge name='br0'/>
</network>
  1. VM CONVIDADA
$ sudo cat /etc/netplan/01-netcfg.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp1s0:
      addresses:
      - aa.bb.cc.67/28 # Additional subnet
      nameservers:
        addresses:
        - 185.12.64.2
        - 185.12.64.1
        search: []
      routes:
      - to: default
        via: aa.bb.cc.65 # First usable IP of the additional subnet assigned to physical NIC
  version: 2
kvm-virtualization
  • 1 respostas
  • 24 Views
Martin Hope
Kheldar Ambar
Asked: 2022-12-16 16:24:21 +0800 CST

O ping falha, mas o Nslookup funciona na VPN Wireguard

  • 5

Eu me deparei com uma situação estranha com minha configuração de proteção de arame.

My Setup: Wireguard túneis de acesso à minha rede. Os controladores de domínio do Active Directory fornecem DNS. Os clientes usam os servidores DNS no túnel. Os clientes Linux não têm problemas para resolver consultas DNS com um túnel wireguard usando os controladores de domínio como servidores DNS.

O problema: os clientes Windows não podem navegar com um túnel wireguard ativo. O ping falha, mas o nslookup funciona. Posso pingar os servidores DNS (por endereço IP). Posso pingar endereços IP externos (por exemplo, 1.1.1.1). O Wireshark mostra a consulta DNS saindo, mas sem respostas. O firewall no servidor wireguard não mostra as consultas sendo bloqueadas.

O que estou fazendo de errado?

Aqui está minha configuração:

Servidor Wireguard

# cat /etc/wireguard/wg0.conf
[Interface]
Address = 10.101.0.1/16
SaveConfig = true
PostUp = ufw route allow in on wg0 out on enp6s0
PostUp = ufw route allow in on enp6s0 out on wg0
PostUp = ufw route allow in on wg0 out on enp1s0
PostUp = ufw route allow in on enp1s0 out on wg0
PostUp = iptables -t nat -I POSTROUTING -o enp6s0 -j MASQUERADE
PostUp = iptables -t nat -I POSTROUTING -o enp1s0 -j MASQUERADE
PreDown = ufw route delete allow in on wg0 out on enp6s0
PreDown = ufw route delete allow in on wg0 out on enp1s0
PreDown = ufw route delete allow in on enp6s0 out on wg0
PreDown = ufw route delete allow in on enp1s0 out on wg0
PreDown = iptables -t nat -D POSTROUTING -o enp6s0 -j MASQUERADE
PreDown = iptables -t nat -D POSTROUTING -o enp1s0 -j MASQUERADE
ListenPort = 51820
PrivateKey = <snipped>

Tabela de roteamento no servidor Wireguard

# ip route
default via <wan_gateway> dev enp1s0 proto static 
10.0.0.0/16 dev enp6s0 proto kernel scope link src 10.0.25.20 
10.0.0.0/16 via 10.0.1.254 dev enp6s0 proto static metric 100 
10.101.0.0/16 dev wg0 proto kernel scope link src 10.101.0.1 
<wan_ip_block>/22 dev enp1s0 proto kernel scope link src <wireguard_public_ip>

Regras de firewall no WireguardServer

# ufw status
Status: active

To                         Action      From
--                         ------      ----
51820/udp                  ALLOW       Anywhere                  
22/tcp                     ALLOW       Anywhere                  
3389                       ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
443/tcp                    ALLOW       Anywhere                  
135/tcp                    ALLOW       Anywhere                  
389/tcp                    ALLOW       Anywhere                  
636/tcp                    ALLOW       Anywhere                  
3268/tcp                   ALLOW       Anywhere                  
3269/tcp                   ALLOW       Anywhere                  
53/tcp                     ALLOW       Anywhere                  
88/tcp                     ALLOW       Anywhere                  
445/tcp                    ALLOW       Anywhere                  
123/tcp                    ALLOW       Anywhere                  
464/tcp                    ALLOW       Anywhere                  
137/tcp                    ALLOW       Anywhere                  
138/tcp                    ALLOW       Anywhere                  
139/tcp                    ALLOW       Anywhere                  
135/udp                    ALLOW       Anywhere                  
137/udp                    ALLOW       Anywhere                  
138/udp                    ALLOW       Anywhere                  
389/udp                    ALLOW       Anywhere                  
445/udp                    ALLOW       Anywhere                  
1512/udp                   ALLOW       Anywhere                  
42/udp                     ALLOW       Anywhere                  
42/tcp                     ALLOW       Anywhere                  
1512/tcp                   ALLOW       Anywhere                  
500/udp                    ALLOW       Anywhere                  
49152:65535/tcp            ALLOW       Anywhere                  
49152:65535/udp            ALLOW       Anywhere                  
464                        ALLOW       Anywhere                  
5985:5986/tcp              ALLOW       Anywhere                  
53/udp                     ALLOW       Anywhere                  
51820/udp (v6)             ALLOW       Anywhere (v6)             
22/tcp (v6)                ALLOW       Anywhere (v6)             
3389 (v6)                  ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6)             
443/tcp (v6)               ALLOW       Anywhere (v6)             
135/tcp (v6)               ALLOW       Anywhere (v6)             
389/tcp (v6)               ALLOW       Anywhere (v6)             
636/tcp (v6)               ALLOW       Anywhere (v6)             
3268/tcp (v6)              ALLOW       Anywhere (v6)             
3269/tcp (v6)              ALLOW       Anywhere (v6)             
53/tcp (v6)                ALLOW       Anywhere (v6)             
88/tcp (v6)                ALLOW       Anywhere (v6)             
445/tcp (v6)               ALLOW       Anywhere (v6)             
123/tcp (v6)               ALLOW       Anywhere (v6)             
464/tcp (v6)               ALLOW       Anywhere (v6)             
137/tcp (v6)               ALLOW       Anywhere (v6)             
138/tcp (v6)               ALLOW       Anywhere (v6)             
139/tcp (v6)               ALLOW       Anywhere (v6)             
135/udp (v6)               ALLOW       Anywhere (v6)             
137/udp (v6)               ALLOW       Anywhere (v6)             
138/udp (v6)               ALLOW       Anywhere (v6)             
389/udp (v6)               ALLOW       Anywhere (v6)             
445/udp (v6)               ALLOW       Anywhere (v6)             
1512/udp (v6)              ALLOW       Anywhere (v6)             
42/udp (v6)                ALLOW       Anywhere (v6)             
42/tcp (v6)                ALLOW       Anywhere (v6)             
1512/tcp (v6)              ALLOW       Anywhere (v6)             
500/udp (v6)               ALLOW       Anywhere (v6)             
49152:65535/tcp (v6)       ALLOW       Anywhere (v6)             
49152:65535/udp (v6)       ALLOW       Anywhere (v6)             
464 (v6)                   ALLOW       Anywhere (v6)             
5985:5986/tcp (v6)         ALLOW       Anywhere (v6)             
53/udp (v6)                ALLOW       Anywhere (v6)             

Anywhere on enp6s0         ALLOW FWD   Anywhere on wg0           
Anywhere on wg0            ALLOW FWD   Anywhere on enp6s0        
Anywhere on enp1s0         ALLOW FWD   Anywhere on wg0           
Anywhere on wg0            ALLOW FWD   Anywhere on enp1s0        
Anywhere (v6) on enp6s0    ALLOW FWD   Anywhere (v6) on wg0      
Anywhere (v6) on wg0       ALLOW FWD   Anywhere (v6) on enp6s0   
Anywhere (v6) on enp1s0    ALLOW FWD   Anywhere (v6) on wg0      
Anywhere (v6) on wg0       ALLOW FWD   Anywhere (v6) on enp1s0

Cliente Windows

[Interface]
PrivateKey = <snipped>
Address = 10.101.0.4/32

[Peer]
PublicKey = <snipped>
AllowedIPs = 10.101.0.0/16, 10.0.0.0/16, <wan_ip_block>/22
Endpoint = <snipped>:51820
domain-name-system
  • 1 respostas
  • 19 Views

Sidebar

Stats

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

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

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