Skip to contentSkip to conversation

qemu.rst: slirp port forwarding details

PATCH Superseded Atanas Bunchev 2 participants 2 messages Nov 9, 2022

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu.rst: slirp port forwarding details

Explains the default behavior of runqemu slirp. Explains how to forward ports from the guest to the host machine.

---
 documentation/dev-manual/qemu.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
documentation/dev-manual/qemu.rst +10 -0
index 5a4a82ce6..1f866f1b7 100644
@@ -426,6 +426,16 @@ command line:
    networking that does not need root access but also is not as easy to
    use or comprehensive as the default.
 
+   Using ``slirp`` will forward the guest machine's 22 and 23 port to host
+   machine's 2222 and 2323, incrementing them if they're already taken
+   by another ``runqemu`` instance. Specific forwarding rules can be
+   configured by setting ``QB_SLIRP_OPT`` in ``qemuboot.conf``.
+   Examples::
+
+      QB_SLIRP_OPT="-netdev user,id=net0,hostfwd=tcp::8080-:80"
+
+      QB_SLIRP_OPT="-netdev user,id=net0,hostfwd=tcp::8080-:80,hostfwd=tcp::2222-:22"
+
 -  ``kvm``: Enables KVM when running "qemux86" or "qemux86-64" QEMU
    architectures. For KVM to work, all the following conditions must be
    met:
Signature · 1 line
2.37.4
#1 lore raw

Hi Atanas,

Quoted 13 lines · Atanas Bunchev

Explains the default behavior of runqemu slirp. Explains how to forward ports from the guest to the host machine.

---
  documentation/dev-manual/qemu.rst | 10 ++++++++++
  1 file changed, 10 insertions(+)
documentation/dev-manual/qemu.rst +0 -0
index 5a4a82ce6..1f866f1b7 100644

documentation/dev-manual/qemu.rst command line: · line 429

Quoted 4 lines
documentation/dev-manual/qemu.rst +1 -0
@@ -426,6 +426,16 @@ command line:
     networking that does not need root access but also is not as easy to
     use or comprehensive as the default.
 
+   Using ``slirp`` will forward the guest machine's 22 and 23 port to host

Can we put "by default" somewhere in there?

also s/port/ports/

documentation/dev-manual/qemu.rst command line: · line 438

Quoted 9 lines
documentation/dev-manual/qemu.rst +9 -0
+   machine's 2222 and 2323, incrementing them if they're already taken
+   by another ``runqemu`` instance. Specific forwarding rules can be
+   configured by setting ``QB_SLIRP_OPT`` in ``qemuboot.conf``.
+   Examples::
+
+      QB_SLIRP_OPT="-netdev user,id=net0,hostfwd=tcp::8080-:80"
+
+      QB_SLIRP_OPT="-netdev user,id=net0,hostfwd=tcp::8080-:80,hostfwd=tcp::2222-:22"
+

Can you say in a few words below what exactly those commands do so that the user has somewhat of an idea what they are doing?

Cheers,
Quentin