Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

470
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda