C
C
Ciscoridze2017-05-19 19:02:33
linux
Ciscoridze, 2017-05-19 19:02:33

How to do forwarding to vagrant on linux?

Hi everybody!
Behind a router with eth_ext = xxxx, eth_int = 192.168.1.1, forwarding 80/tcp to the host on it. Host eth_ext = 192.168.1.41, eth_vm = 192.168.2.1. On the host virtual machine vagrant eth0 = 192.168.2.100, on it is an http server on port 80.
If you do curl -v 192.168.2.100:80 on the host, it will display a web page. How to make curl -v 192.168.1.41:80 work?
Those. how to make the web server accessible over the internet?
(forwarding in the vagrant file does not help)

FedoraWorkstation (active)
  target: default
  icmp-block-inversion: no
  interfaces: wlp2s0 virbr1
  sources: 
  services: ssh samba-client vnc-server mdns openvpn http
  ports: 5901/tcp 1025-65535/udp 1025-65535/tcp 5902/tcp 1194/udp 80/tcp
  protocols: 
  masquerade: yes
  forward-ports: port=1194:proto=udp:toport=:toaddr=192.168.121.100
  port=80:proto=tcp:toport=80:toaddr=192.168.121.100
  source-ports: 
  icmp-blocks: 
  rich rules:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentine, 2017-05-20
@ProFfeSsoRr

The easiest way is to remove NAT for the virtual machine on the host so that the virtual machine is, as it were, on the same network as the host. Then it will have an IP from the 192.168.1.* subnet, and forward to this IP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question