2

I have a problem. Here is diagram of my network. enter image description here

  1. I have WIFI Router connected to the internet, I have order static IP from my ISP so I can access my local PC via the internet.
  2. My router creates network 192.168.0.0/24
  3. I have some ports forwared to my Local PC server (192.168.0.101) enter image description here
  4. I have virtual box installed on my local PC
  5. There two nodes created and maintained through vagrant, but we are interested in first node.
  6. Each VM has two NIC first is NAT for Vagrant communication second is Bridged adapter through Local PC interface enp3s0.
  7. All nodes has specific MAC addresses that are binded in Router DHCP settings to give them static IP (192.168.0.110 and 192.168.0.111)
  8. Everything works inside the local network, nodes receive correct IP addresses, and I can access any node port through local network
  9. My node with ip 192.168.0.110 runs Apache server and inside local network it works fine.
  10. I want to access my this node apache server from the outside so I forwarded external port 8888 to local port 80 to machine with IP 192.168.0.110 as you can see in the screenshot above.

But the problem is that I cannot access node apache from the outside. Connection is timed out or reset. I have tried to capture traffic using Wireshark and I can see following errors.

enter image description here enter image description here Is it possible to get this working ? Or only one solution is to forward ports to 192.168.0.101 PC than forward packets to the Node using NAT with port forwarding ?

Please help to solve this problem. Thanks.

1 Answer 1

1

I realize this isn't the answer you are looking for but I racked my brain for over a day and came to this conclusion. It should work and does not. I'm a Linux pro and versed in networking of it. Other forums say you are doing it right, I agree, and should work. I myself tried your exact same setup on two completely different networks and it just does not work.

You have to do it with a NAT adapter along side the bridged adapter. Set up a port forward on the NAT and set the Host IP to 0.0.0.0.

In your router do a port forward to the HOST IP address, NOT the client VM bridged IP. So per your example port forward 8888 to the HOST IP address on the SAME PORT 8888.

Then in Vagrant the NAT port forward would look like:

config.vm.network "forwarded_port", guest: 80, host_ip: "0.0.0.0", host: 8888

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .