summaryrefslogtreecommitdiffstats
path: root/qemu-options.hx
diff options
context:
space:
mode:
authorJan Kiszka2009-06-24 14:42:28 +0200
committerAnthony Liguori2009-06-29 15:52:45 +0200
commitc92ef6a22d3c71538fcc48fb61ad353f7ba03b62 (patch)
tree867e01eb52981f2b493c745b5c0dadf97b492824 /qemu-options.hx
parentslirp: Rework internal configuration (diff)
downloadqemu-c92ef6a22d3c71538fcc48fb61ad353f7ba03b62.tar.gz
qemu-c92ef6a22d3c71538fcc48fb61ad353f7ba03b62.tar.xz
qemu-c92ef6a22d3c71538fcc48fb61ad353f7ba03b62.zip
slirp: Rework external configuration interface
With the internal IP configuration made more flexible, we can now enhance the user interface. This patch adds a number of new options to "-net user": net (address and mask), host, dhcpstart, dns and smbserver. It also renames "redir" to "hostfwd" and "channel" to "guestfwd" in order to (hopefully) clarify their meanings. The format of guestfwd is extended so that the user can define not only the port but also the virtual server's IP address the forwarding starts from. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-options.hx')
-rw-r--r--qemu-options.hx52
1 files changed, 34 insertions, 18 deletions
diff --git a/qemu-options.hx b/qemu-options.hx
index d1c1539e21..da5b0ac6a5 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -749,10 +749,11 @@ DEF("net", HAS_ARG, QEMU_OPTION_net,
"-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
" create a new Network Interface Card and connect it to VLAN 'n'\n"
#ifdef CONFIG_SLIRP
- "-net user[,vlan=n][,name=str][ip=netaddr][,restrict=y|n][,hostname=host]\n"
- " [,tftp=dir][,bootfile=f][,redir=rule][,channel=rule]"
+ "-net user[,vlan=n][,name=str][,net=addr[/mask]][,host=addr][,restrict=y|n]\n"
+ " [,hostname=host][,dhcpstart=addr][,dns=addr][,tftp=dir][,bootfile=f]\n"
+ " [,hostfwd=rule][,guestfwd=rule]"
#ifndef _WIN32
- "[,smb=dir]\n"
+ "[,smb=dir[,smbserver=addr]]\n"
#endif
" connect the user mode network stack to VLAN 'n', configure its\n"
" DHCP server and enabled optional services\n"
@@ -819,8 +820,14 @@ Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default).
@item name=@var{name}
Assign symbolic name for use in monitor commands.
-@item ip=@var{netaddr}
-Set IP network address the guest will see (default: 10.0.2.x).
+@item net=@var{addr}[/@var{mask}]
+Set IP network address the guest will see. Optionally specify the netmask,
+either in the form a.b.c.d or as number of valid top-most bits. Default is
+10.0.2.0/8.
+
+@item host=@var{addr}
+Specify the guest-visible address of the host. Default is the 2nd IP in the
+guest network, i.e. x.x.x.2.
@item restrict=y|yes|n|no
If this options is enabled, the guest will be isolated, i.e. it will not be
@@ -830,12 +837,20 @@ to the outside. This option does not affect explicitly set forwarding rule.
@item hostname=@var{name}
Specifies the client hostname reported by the builtin DHCP server.
+@item dhcpstart=@var{addr}
+Specify the first of the 16 IPs the built-in DHCP server can assign. Default
+is the 16th to 31st IP in the guest network, i.e. x.x.x.16 to x.x.x.31.
+
+@item dns=@var{addr}
+Specify the guest-visible address of the virtual nameserver. The address must
+be different from the host address. Default is the 3rd IP in the guest network,
+i.e. x.x.x.3.
+
@item tftp=@var{dir}
When using the user mode network stack, activate a built-in TFTP
server. The files in @var{dir} will be exposed as the root of a TFTP server.
The TFTP client on the guest must be configured in binary mode (use the command
-@code{bin} of the Unix TFTP client). The host IP address on the guest is
-10.0.2.2 by default.
+@code{bin} of the Unix TFTP client).
@item bootfile=@var{file}
When using the user mode network stack, broadcast @var{file} as the BOOTP
@@ -847,10 +862,11 @@ Example (using pxelinux):
qemu -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
@end example
-@item smb=@var{dir}
+@item smb=@var{dir}[,smbserver=@var{addr}]
When using the user mode network stack, activate a built-in SMB
server so that Windows OSes can access to the host files in @file{@var{dir}}
-transparently.
+transparently. The IP address of the SMB server can be set to @var{addr}. By
+default the 4th IP in the guest network is used, i.e. x.x.x.4.
In the guest Windows OS, the line:
@example
@@ -865,19 +881,19 @@ Note that a SAMBA server must be installed on the host OS in
@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from
Red Hat 9, Fedora Core 3 and OpenSUSE 11.x.
-@item redir=[tcp|udp]:@var{host-port}:[@var{guest-host}]:@var{guest-port}
-Redirect incoming TCP or UDP connections to the host port @var{host-port} to
-the guest @var{guest-host} on guest port @var{guest-port}. If @var{guest-host}
-is not specified, its value is 10.0.2.15 (default address given by the built-in
-DHCP server). If no connection type is specified, TCP is used. This option can
-be given multiple times.
+@item hostfwd=[tcp|udp]:@var{hostport}:[@var{guestaddr}]:@var{guestport}
+Redirect incoming TCP or UDP connections to the host port @var{hostport} to
+the guest IP address @var{guestaddr} on guest port @var{guestport}. If
+@var{guestaddr} is not specified, its value is x.x.x.15 (default first address
+given by the built-in DHCP server). If no connection type is specified, TCP is
+used. This option can be given multiple times.
For example, to redirect host X11 connection from screen 1 to guest
screen 0, use the following:
@example
# on the host
-qemu -net user,redir=tcp:6001::6000 [...]
+qemu -net user,hostfwd=tcp:6001::6000 [...]
# this host xterm should open in the guest X11 server
xterm -display :1
@end example
@@ -887,14 +903,14 @@ the guest, use the following:
@example
# on the host
-qemu -net user,redir=tcp:5555::23 [...]
+qemu -net user,hostfwd=tcp:5555::23 [...]
telnet localhost 5555
@end example
Then when you use on the host @code{telnet localhost 5555}, you
connect to the guest telnet server.
-@item channel=@var{port}:@var{dev}
+@item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
Forward guest TCP connections to port @var{port} on the host to character
device @var{dev}. This option can be given multiple times.