QEMU多端口转发


9

我想转发多个端口。

此命令运行我的VM并成功转发RDP端口:

qemu-system-i386 -net nic,model=rtl8139 -net user,hostfwd=tcp::3389-:3389 -m 512M -localtime -cpu core2duo,+nx -smp 2 -usbdevice tablet -k en-us -hda win.img -nographic

尝试了其他命令,但是没有运气,它们似乎都很糟糕:

qemu-system-i386 -net nic,model=rtl8139 -m 512M -localtime -cpu core2duo,+nx -smp 2 -usbdevice tablet -k en-us -hda win.img -nographic -redir tcp:443::443,tcp:992::992,tcp:1194::1194,tcp:5555::5555,udp:1194::1194,udp:500::500,udp:4500::4500,tcp:3389::3389

qemu-system-i386 -net nic,model=rtl8139 -net user,hostfwd=tcp::3389-:3389,tcp:443::443,tcp:992::992,tcp:1194::1194,tcp:5555::5555,udp:1194::1194,udp:500::500,udp:4500::4500 -m 512M -localtime -cpu core2duo,+nx -smp 2 -usbdevice tablet -k en-us -hda win.img -nographic

正确的例子将非常受欢迎。谢谢。

Answers:


8

得到它的工作:

qemu-system-i386 -net nic,model=rtl8139 -net user,hostfwd=tcp::3389-:3389 -redir tcp:443::443 -redir tcp:992::992 -redir tcp:1194::1194 -redir tcp:5555::5555 -redir udp:1194::1194 -redir udp:500::500 -redir udp:4500::4500 -m 512M -localtime -cpu core2duo,+nx -smp 2 -usbdevice tablet -k en-us -hda win.img -nographic

6
请注意,-redir是旧选项。要使用hostfwd进行相同操作,请尝试:-net user,hostfwd=tcp::3389-:3389,hostfwd=tcp::443-:443,hostfwd=tcp::992-:992,etc...。同样,只有转发到来宾的主界面(10.0.2.15)时,我才能使此工作正常。
Joao Costa 2015年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.