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)
Change History (4)
by , 17 hours ago
by , 17 hours ago
Attachment: | networkAdapter2PortForward.png added |
---|
Network Adapter 2 Port Forward Config
VBox.log