[Resolved] vboxmanage command for nat network port forwarding info

This is for discussing general topics about how to use VirtualBox.
Post Reply
techiebiker
Posts: 20
Joined: 26. Dec 2007, 18:27
Location: connecticut

[Resolved] vboxmanage command for nat network port forwarding info

Post by techiebiker »

VBoxManage showvminfo "virtual machine name" does a great job showing the NAT rules when a guest is connected to NAT. e.g.

Code: Select all

host:~$ VBoxManage showvminfo "TestDevLAMP"
...
NIC 1:                       MAC: ************, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0):   name = SSH, protocol = tcp, host ip = 127.0.0.1, host port = 2224, guest ip = , guest port = 22
NIC 1 Rule(1):   name = SSL, protocol = tcp, host ip = 127.0.0.1, host port = 4443, guest ip = , guest port = 443
NIC 1 Rule(2):   name = Web, protocol = tcp, host ip = 127.0.0.1, host port = 8800, guest ip = , guest port = 80
NIC 1 Rule(3):   name = Web8080, protocol = tcp, host ip = 127.0.0.1, host port = 8080, guest ip = , guest port = 8080
However when the guest is connected to a NAT Network all that is displayed is the fact the NIC is connected to the NAT network. No rules are displayed. e.g.

Code: Select all

host:~$ VBoxManage showvminfo "Ubuntu 16.04 server"
Name:                        Ubuntu 16.04 server
...
NIC 1:                       MAC: 0800274D701D, Attachment: NAT Network 'CMS Test', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
...
Is there a VBoxManage command to display the port forwarding setup of a NAT Network?

Can someone tell me the command or point me toward the section of the manual it's in, please?

I cannot find any way to see the settings except via the GUI.

Thank you.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: vboxmanage command for nat network port forwarding info

Post by scottgus1 »

Try:

vboxmanage list natnets

Here's what my host says about my NAT network:
C:\Users\SnC>vboxmanage list natnets
NetworkName:    NatNetwork15
IP:             10.0.15.1
Network:        10.0.15.0/24
IPv6 Enabled:   No
IPv6 Prefix:    fd17:625c:f037:2::/64
DHCP Enabled:   Yes
Enabled:        Yes
Port-forwarding (ipv4)
        Rule 1:tcp:[]:2248:[10.0.15.45]:2248
loopback mappings (ipv4)
        127.0.0.1=2
techiebiker
Posts: 20
Joined: 26. Dec 2007, 18:27
Location: connecticut

Re: vboxmanage command for nat network port forwarding info

Post by techiebiker »

Thank you, scottgus1.

I had found "VBoxManage natnetwork list" which doesn't provide the NAT info.

vboxmanage list natnets show exactly what I'm looking for.
Post Reply