8.8 VBoxManage modifyvm
8.8.2 Networking settings
The following networking settings are available throughVBoxManage modifyvm. With all these settings, the decimal number directly following the option name (“1-N” in the list below) specifies the virtual network adapter whose settings should be changed.
• --nic<1-N> none|null|nat|natnetwork|bridged|intnet|hostonly|generic: With this, you can set, for each of the VM’s virtual network cards, what type of networking should be available. They can be not present (none), not connected to the host (null), use network address translation (nat), use the new network address translation engine (natnetwork), bridged networking (bridged) or communicate with other virtual ma- chines using internal networking (intnet), host-only networking (hostonly), or access rarely used sub-modes (generic). These options correspond to the modes which are de- scribed in detail in chapter6.2,Introduction to networking modes, page96.
• --nicpromisc<1-N> deny|allow-vms|allow-all: This allows you, for each of the VM’s virtual network cards, to specify how the promiscious mode is handled. This setting is only relevant for bridged networking. deny(default setting) hides any traffic not intended for this VM. allow-vms hides all host traffic from this VM but allows the VM to see traffic from/to other VMs.allow-allremoves this restriction completely.
• --nictype<1-N> Am79C970A|Am79C973|82540EM|82543GC|82545EM|virtio: This al- lows you, for each of the VM’s virtual network cards, to specify which networking hardware VirtualBox presents to the guest; see chapter6.1,Virtual networking hardware, page95. • --cableconnected<1-N> on|off: This allows you to temporarily disconnect a virtual
network interface, as if a network cable had been pulled from a real network card. This might be useful for resetting certain software components in the VM.
• With the “nictrace” options, you can optionally trace network traffic by dumping it to a file, for debugging purposes.
With --nictrace<1-N> on|off, you can enable network tracing for a particular virtual network card.
If enabled, you must specify with--nictracefile<1-N> <filename>what file the trace should be logged to.
• --natnet<1-N> <network>|default: If the networking type is set to nat (not
natnetwork) then this setting specifies the IP address range to be used for this network. See chapter9.11,Fine-tuning the VirtualBox NAT engine, page188for an example.
• --nat-network<1-N> <network name>: If the networking type is set tonatnetwork(not
• --bridgeadapter<1-N> none|<devicename>: If bridged networking has been enabled for a virtual network card (see the --nic option above; otherwise this setting has no effect), use this option to specify which host interface the given virtual network interface will use. For details, please see chapter6.5,Bridged networking, page100.
• --hostonlyadapter<1-N> none|<devicename>: If host-only networking has been en- abled for a virtual network card (see the –nic option above; otherwise this setting has no effect), use this option to specify which host-only networking interface the given virtual network interface will use. For details, please see chapter6.7,Host-only networking, page
102.
• --intnet<1-N> network: If internal networking has been enabled for a virtual network card (see the--nicoption above; otherwise this setting has no effect), use this option to specify the name of the internal network (see chapter6.6,Internal networking, page101). • --macaddress<1-N> auto|<mac>: With this option you can set the MAC address of the virtual network card. Normally, each virtual network card is assigned a random address by VirtualBox at VM creation.
• --nicgenericdrv<1-N> <backend driver>: If generic networking has been enabled for a virtual network card (see the--nicoption above; otherwise this setting has no effect), this mode allows you to access rarely used networking sub-modes, such as VDE network or UDP Tunnel.
• --nicproperty<1-N> <paramname>="paramvalue": This option, in combination with “nicgenericdrv” allows you to pass parameters to rarely-used network backends.
Those parameters are backend engine-specific, and are different between UDP Tunnel and the VDE backend drivers. For example, please see chapter 6.8, UDP Tunnel networking, page103.
8.8.2.1 NAT Networking settings.
The following NAT networking settings are available throughVBoxManage modifyvm. With all these settings, the decimal number directly following the option name (“1-N” in the list below) specifies the virtual network adapter whose settings should be changed.
• --natpf<1-N> [<name>],tcp|udp,[<hostip>],<hostport>,[<guestip>], <guestport>: This option defines a NAT port-forwarding rule (please see chapter6.3.1,Configuring port forwarding with NAT, page97for details).
• --natpf<1-N> delete <name>: This option deletes a NAT port-forwarding rule (please see chapter6.3.1,Configuring port forwarding with NAT, page97for details).
• --nattftpprefix<1-N> <prefix>: This option defines a prefix for the built-in TFTP server, i.e. where the boot file is located (please see chapter6.3.2,PXE booting with NAT, page 98and chapter 9.11.2, Configuring the boot server (next server) of a NAT network interface, page189for details).
• --nattftpfile<1-N> <bootfile>: This option defines the TFT boot file (please see chap- ter9.11.2,Configuring the boot server (next server) of a NAT network interface, page189for details).
• --nattftpserver<1-N> <tftpserver>: This option defines the TFTP server address to boot from (please see chapter 9.11.2, Configuring the boot server (next server) of a NAT network interface, page189for details).
• --natdnspassdomain<1-N> on|off: This option specifies whether the built-in DHCP server passes the domain name for network name resolution.
• --natdnsproxy<1-N> on|off: This option makes the NAT engine proxy all guest DNS requests to the host’s DNS servers (please see chapter9.11.5, Enabling DNS proxy in NAT mode, page189for details).
• --natdnshostresolver<1-N> on|off: This option makes the NAT engine use the host’s resolver mechanisms to handle DNS requests (please see chapter 9.11.5, Enabling DNS proxy in NAT mode, page189for details).
• --natsettings<1-N> [<mtu>],[<socksnd>],[<sockrcv>],[<tcpsnd>], [<tcprcv>]: This option controls several NAT settings (please see chapter9.11.3,Tuning TCP/IP buffers for NAT, page189for details).
• --nataliasmode<1-N> default|[log],[proxyonly],[sameports]: This option de- fines behaviour of NAT engine core: log - enables logging, proxyonly - switches of aliasing mode makes NAT transparent, sameports enforces NAT engine to send packets via the same port as they originated on, default - disable all mentioned modes above . (please see chap- ter9.11.7,Configuring aliasing of the NAT engine, page190for details).