NAT Network + port forward broken? (#18103)

Discussions related to using VirtualBox on Linux hosts.
Post Reply
madworm
Posts: 21
Joined: 14. Dec 2007, 17:33

NAT Network + port forward broken? (#18103)

Post by madworm »


ModEdit; related ticket: #18103: User-manual amendment regarding DHCP IP / NAT networking
NAT networking works, including DHCP. The VMs can talk to each other and see the world.
Hostonly networking works, including DHCP. The VMs can talk to each other and the host.
Private networking works, including DHCP. The VMs can only see each other.

Code: Select all

NetworkName:    natnet1
IP:             192.168.16.1
Network:        192.168.16.0/24
IPv6 Enabled:   No
IPv6 Prefix:    fd17:625c:f037:2::/64
DHCP Enabled:   Yes
Enabled:        Yes
Port-forwarding (ipv4)
        nc:tcp:[127.0.0.1]:9999:[192.168.16.137]:66
        ssh:tcp:[127.0.0.1]:6666:[192.168.16.137]:22
        telnet:tcp:[127.0.0.1]:7777:[192.168.16.137]:23
loopback mappings (ipv4)
        127.0.0.1=2
Now, the port forwarding is a different thing. I don't have any firewall active, neither on the host, nor on the VMS.

When I try to connect via ssh to one VM, I can see the connection is being made on the host (lsof -i -Pn), yet nothing really happens on the VM. The ssh daemon doesn't react in any way.
Attaching tcpdump to the relevant interface on the VM reveals that some pre connection stuff goes back and forth, a couple of SYN/ACK and ARP packets with the correct IP addresses and ports, but thats it.
Ultimately the connection fails.

What works is port forwarding with ordinary "NAT" (per VM setting), but I don't want that.

Any clues?
Last edited by socratis on 4. Nov 2018, 20:50, edited 1 time in total.
Reason: Added ticket related information.
madworm
Posts: 21
Joined: 14. Dec 2007, 17:33

Re: [Solved] NAT Network + port forward broken?

Post by madworm »

IP conflict, which didn't mess up things until I started using port-forwarding...

See https://www.virtualbox.org/ticket/18103 (request to enhance the user manual)

Don't set the DHCP server to use the IP of the gateway (AAA.BBB.CCC.1), using (AAA.BBB.CCC.3) seems to work.
This appears to be only an issue when the dhcp server is created manually, instead of using the auto-created one of "VBoxManage natnetwork add .... --dhcp on"
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: [Solved] NAT Network + port forward broken?

Post by socratis »

Right... What could also reveal that "mistake"/"misunderstanding" would have been the output of:
  • VBoxManage list dhcpservers
madworm wrote:See https://www.virtualbox.org/ticket/18103 (request to enhance the user manual)
Did you also post in https://www.virtualbox.org/ticket/16810 that just "woke up"? ;)

I added the ticket information and removed the [Solved] mark since the related ticket is still open. When it gets addressed, I'll mark it as [Fixed].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
madworm
Posts: 21
Joined: 14. Dec 2007, 17:33

Re: NAT Network + port forward broken? (#18103)

Post by madworm »

Maybe... It's much like not seeing typos in your own writing.
madworm
Posts: 21
Joined: 14. Dec 2007, 17:33

Re: NAT Network + port forward broken? (#18103)

Post by madworm »

It seems I've replicated #13753. Science :-)
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: NAT Network + port forward broken? (#18103)

Post by socratis »

Great detective work, and kudos for not stopping the search! ;)
But I think you still need to keep #18103 alive, that clarification *should* be in the manual, not in some 4-year old, closed as Invalid, ticket.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply