Skip to main content

Gestion réseau

Forward port:

virt-xml $DOMAIN --edit --confirm --qemu-commandline '-net'
virt-xml $DOMAIN --edit --confirm --qemu-commandline 'user,hostfwd=::$PORT-:$PORT'

XML:

<qemu:commandline>
<qemu:arg value='-net'/>
<qemu:arg value='user,hostfwd=::$PORT-:$PORT'/>
</qemu:commandline>

Acces relay par iptables

iptables -I FORWARD -m conntrack -d $SOUS_RESEAU_VM/24 --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT
 iptables -t nat -A PREROUTING -p tcp -d $IP_PUBLIC --dport 32400 -j DNAT --to-destination $IP_VM:$PORT_VM