Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

479
Visualizações
networking is not working on qemu guest (Malta Mips)

I am trying to configure networking on QEMU malta mips, which is running on vmware host (ubuntu) using tap/tun device and bridge interface. My qemu guest is unable to retrieve ip address from DHCP server. If i give it manually, it can just connect with its host. Using tcpdump i came to know that outgoing traffic is working perfectly but incoming is not working.

Can anyone suggest me how to solve this kind of issue? Thank You

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

If you use NAT mode, then your host machine will act as a router for your guest VM. This means you must enable routing on your host.

Assuming you start qemu and link it to tap0 interface and your outgoing internet interface is eth0, then you should:

  1. Create the tap0 virtual interface:

    tunctl -t tap0
    ifconfig tap0 192.168.0.1 netmask 255.255.255.0 up
    
  2. Activate routing

    # activate ip forwarding
    echo 1 > /proc/sys/net/ipv4/ip_forward
    
    # Create forwarding rules, where
    # tap0 - virtual interface
    # eth0 - net connected interface
    
    iptables -A FORWARD -i tap0 -o eth0 -j ACCEPT
    iptables -A FORWARD -i eth0 -o tap0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    
  3. Start your VM with somenthing like this:

    qemu [..] -net nic,model=e1000,vlan=0 -net tap,ifname=tap0,vlan=0,script=no
    
  4. In your VM, configure an interface with ip 192.168.0.2/24 and default gateway 192.168.0.1

over 4 years ago · Santiago Trujillo Relatório

0

In NAT mode you can't achieve this. You need to configure VM in bridge mode and I hope you know the steps to configure it; if not see the link here ;

over 4 years ago · Santiago Trujillo Relatório

0

Step #2 of catalin.me's answer could be even simpler:

# activate ip forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

First two iptables rules are needed only in case if default policy for FORWARD chain is DROP.

E.g.:

iptables -P FORWARD DROP
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda