VirtualBox

Opened 17 hours ago

#22276 new defect

NAT Port forwarding rules not working on second network adapter

Reported by: ssaloisb Owned by:
Component: network/NAT Version: VirtualBox-7.1.4
Keywords: Port Forward Cc: ssaloisb
Guest type: Linux Host type: all

Description

We have a custom script that creates VMs using Virtualbox that has worked for years. The script setups each VM with two network adapters:

  • Network Adapter 1:

Type: Bridge Adapter

  • Network Adapter 2:

Type: NAT Port forward rule: TCP Host IP: unset Host Port: some port (ex: 12132) Guest IP: unset Guest Port: 22

The script creates the VM and uses the NAT port forward to SSH on the VM and then configure the external IP and other stuff. On Virtualbox 7.0.22, this works fine. On Virtualbox 7.1.4, we cannot SSH using the local port forward. SSH just times out.

Using netstat -a, I see the redirection rule which seems fine:

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address Foreign Address State

(...)

tcp 0 0 0.0.0.0:12130 0.0.0.0:* LISTEN

After some investigation, I realized that the NAT port forwarding seems to only work when NAT is on the first network adapter. If I do the exact same setup and reverse my two network adapters, then I am able to SSH on my VM using the port forward. So for some reasons, the NAT port forwarding don't work when set on the second network adapter. I imagine the same would be true if NAT was on the third or fourth adapter.

Host: Windows 11/Ubuntu 24.10 Guest: Oracle Linux 8.6

Attachments (4)

VBox.log (81.2 KB ) - added by ssaloisb 17 hours ago.
VBox.log
networkAdapter1Config.png (68.9 KB ) - added by ssaloisb 17 hours ago.
Network Adapter 1 Config
networkAdapter2Config.png (69.2 KB ) - added by ssaloisb 17 hours ago.
Network Adapter 2 Config
networkAdapter2PortForward.png (28.1 KB ) - added by ssaloisb 17 hours ago.
Network Adapter 2 Port Forward Config

Download all attachments as: .zip

Change History (4)

by ssaloisb, 17 hours ago

Attachment: VBox.log added

VBox.log

by ssaloisb, 17 hours ago

Attachment: networkAdapter1Config.png added

Network Adapter 1 Config

by ssaloisb, 17 hours ago

Attachment: networkAdapter2Config.png added

Network Adapter 2 Config

by ssaloisb, 17 hours ago

Network Adapter 2 Port Forward Config

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette