QEMU command to configure the virtual machine network user mode

QEMU defaults "-net nic-net user" parameter configuration network to the client, a user mode (user-mode) network simulation. User mode client and host can communicate with external networks. User-mode network is fully emulated by QEMU implement the entire TCP / IP protocol stack, and uses this protocol stack provides a virtual NAT network. It is not dependent on the network tool assembly on the host, such as bridge-utils, tunctl, dnsmasq, iptables other and therefore do not require root authority. Of course, the user-mode networks defect is obvious: the realization of all network protocols in its inside QEMU stack, relatively poor performance.

 
QEMU command "-net user" user mode network configuration parameters, the command format is as follows:
     qemu-kvm -net nic -net user [, opion[, option[, ... ] ] ]  myVM.img
 
User mode parameter options are described below:
vlan = vlan ID, the user mode network stack connections to a VLAN number n (Default 0).
name = name, assign a network name, which can be used to identify the network QEMU monitor.
net = address [/ mask], the client's subnet are provided, the default is 10.0.2.0/24.
host = address, provided that the client sees the IP address of the host, a client default value of the network that two IP addresses 10.0.2.2.
restrict = switch, if this option is turned on (y or Yes), the client can not communicate with the host, the host can not be routed through the network to the outside. The default setting is n or no.
hostname = name, settings are saved in the host DHCP server, the client host name.
dhcpstart = address, the first set can be assigned to an IP client, the QEMU embedded DHCP server 16 has IP addresses available for allocation, 10.0.2.15-10.0.2.30 default address range.
dns = address, DNS specified virtual address, the default value is the third IP address in the network 10.0.2.3, and not "host =" specified in the same.
hostfwd = [tcpludp] [host Address]: host port - [Client Address]: the client port, the host access to TCP / UDP port designated redirects a connection to the client port. This option can be used several times in a command line.

Guess you like

Origin www.cnblogs.com/wpcnblog/p/11517546.html