Opened 11 years ago
Closed 10 years ago
#11925 closed defect (fixed)
Host IP argument to port forward rule not working with aliased host interface
Reported by: | Scramblejams | Owned by: | |
---|---|---|---|
Component: | network/NAT | Version: | VirtualBox 4.2.14 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Linux |
Description
I have a service running on the Debian guest listening on port 8080. I would like to access that service via a port on the host (using the host's IP, 10.0.0.3). If I use the following command to set up the port forward...
VBoxManage modifyvm debianvm --natpf1 "my_fwd,tcp,,8080,,8080"
...it works fine. I can connect to 10.0.0.3:8080 and it works correctly.
However, I have also defined a number of IP aliases on eth0, e.g. eth0:0 is 10.0.0.20. I would like my port forward to _only_ listen on 10.0.0.20. So I delete the old forward and use the following command...
VBoxManage modifyvm debianvm --natpf1 "my_fwd,tcp,10.0.0.20,8080,,8080"
...and it does not work. Nothing's listening on 10.0.0.20.
==================================================================
Host kernel: 3.2.0-4-amd64, guest kernel: 3.2.0-4-486, VirtualBox version: 4.2.14-86644
Output of host's ifconfig -a
:
eth0 Link encap:Ethernet HWaddr <<redacted>> inet addr:10.0.0.3 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: <<redacted>>/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:30239324 errors:6 dropped:29149 overruns:0 frame:6 TX packets:30811647 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:20244529555 (18.8 GiB) TX bytes:24759658051 (23.0 GiB) Interrupt:20 Memory:e1200000-e1220000 eth0:0 Link encap:Ethernet HWaddr <<redacted>> inet addr:10.0.0.20 Bcast:10.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:20 Memory:e1200000-e1220000 eth0:1 Link encap:Ethernet HWaddr <<redacted>> inet addr:10.0.0.21 Bcast:10.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:20 Memory:e1200000-e1220000 eth0:2 Link encap:Ethernet HWaddr <<redacted>> inet addr:10.0.0.22 Bcast:10.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:20 Memory:e1200000-e1220000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:852909 errors:0 dropped:0 overruns:0 frame:0 TX packets:852909 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1237740824 (1.1 GiB) TX bytes:1237740824 (1.1 GiB)
Output of host's route -n
:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
Output of guest's ifconfig -a
:
eth0 Link encap:Ethernet HWaddr <<redacted>> inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: <<redacted>>/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3155 errors:0 dropped:0 overruns:0 frame:0 TX packets:1761 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1794350 (1.7 MiB) TX bytes:189097 (184.6 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Output of guest's route -n
:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0 10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
Relevant lines from VboxManage showvminfo debian
using the host-wide port forward:
NIC 1: MAC: <<redacted>>, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, 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 = my_fwd, protocol = tcp, host ip = , host port = 8080, guest ip = , guest port = 8080
Relevant lines from VboxManage showvminfo debian
using the specific host IP port forward:
NIC 1: MAC: <<redacted>>, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, 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 = my_fwd, protocol = tcp, host ip = 10.0.0.20, host port = 8080, guest ip = , guest port = 8080
Change History (4)
comment:1 by , 11 years ago
comment:2 by , 10 years ago
Binding port-forwarding to an alias works for me in 4.3. As a workaround can you try specifying guest's IP in the rule and see if that makes it work?
comment:3 by , 10 years ago
Hi Vushakov,
Thanks for your note. I've since migrated to Xen, sorry. Since I was on 4.2 and you're on 4.3, if this works for you, then this bug should probably be closed.
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've tested that binding port-forwarding rule to an alias on the host also works on 4.2 branch (4.2.26). Closing.
Neglected to mention that the host is Debian as well.