Skip to content

Instantly share code, notes, and snippets.

@giuseppe998e
Last active May 13, 2022 12:45
Show Gist options
  • Save giuseppe998e/aab59d5a5a0ff6daf5dead600b5320cf to your computer and use it in GitHub Desktop.
Save giuseppe998e/aab59d5a5a0ff6daf5dead600b5320cf to your computer and use it in GitHub Desktop.
KVM - User mode network port forwarding
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<devices>
<!-- ... -->
<interface type="user">
<!-- ... -->
<model type="e1000e"/>
<!-- ... -->
</interface>
<!-- ... -->
</devices>
<!-- ... -->
<qemu:commandline>
<qemu:arg value="-netdev"/>
<qemu:arg value="user,id=net0,hostfwd=tcp::2222-:22"/>
<qemu:arg value="-device"/>
<qemu:arg value="e1000,netdev=net0"/>
</qemu:commandline>
</domain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment