Vagrant works in 'Forwarded Port' but I can't make 'Public Network' work

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Vagrant works in 'Forwarded Port' but I can't make 'Public Network' work

decimoseptimo
Vagrant works in 'Forwarded Port'. I can reach the guest webserver from my windows host  (localhost:9990, or the LAN IP 192.168.1.100:9990)
config.vm.network "forwarded_port", guest: 80, host: 9990

As I need the webserver to be reachable from other devices in the LAN I did:
config.vm.network "public_network"

The first issue is the machine boots around 10x slower, but it's ok for now.

The second issue is I don't know how to reach the guest from other devices.
ifconfig (first is NAT, second is BRIDGE):

enp0s3    Link encap:Ethernet  HWaddr 02:14:68:3e:84:47
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::14:68ff:fe3e:8447/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2280 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2236 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:186742 (186.7 KB)  TX bytes:1599034 (1.5 MB)

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:7c:23:74
          inet6 addr: fe80::a00:27ff:fe7c:2374/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:453 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29213 (29.2 KB)  TX bytes:9198 (9.1 KB)

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:65536  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1684 (1.6 KB)  TX bytes:1684 (1.6 KB)

It is assigned an IPv6.
So I tried defining an static IP as my router's subnet:
config.vm.network "public_network", ip: '192.168.1.111'

I Checked the router, and the VBox is not connecting to it, the VBox is still getting IPv6.

Am I suppose to do something else?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/8130e278-fa83-47cd-9db9-c03f805c6d8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant works in 'Forwarded Port' but I can't make 'Public Network' work

Alvaro Miranda Aguilera
Hello

are you over wifi?

so wifi adapters don't play nice with bridge interfaces and dhcp on the virtual one.

if on wifi, try on cable.



Check you are on the latest version of vagrant 2.0.x and on the latest 5.1.x series of Virtualbox.

have been some on/off issues about the nic on linux not being set with the cable connected by default, or some bugs on the virtualbox driver.

Check the settings of the VM.

Settings -> network, check both interfaces for cable connected.

Screenshot in dutch :/

Inline image 1


so try please with our box:

hashicorp/precise64



the ipv6 is ok you can ignore is just a local per device local-link ip

once the first nic is up and running, grab dhcp from virtualbox, vagrant connects over ssh, creates a configuration for the 2nd nic, and try to grab IP over dhcp.


vagrant ssh -c 'sudo su -'

ethtool enp0s8

dhclient  enp0s8




Thanks
Alvaro.


On Thu, Nov 23, 2017 at 5:49 AM, <[hidden email]> wrote:
Vagrant works in 'Forwarded Port'. I can reach the guest webserver from my windows host  (localhost:9990, or the LAN IP 192.168.1.100:9990)
config.vm.network "forwarded_port", guest: 80, host: 9990

As I need the webserver to be reachable from other devices in the LAN I did:
config.vm.network "public_network"

The first issue is the machine boots around 10x slower, but it's ok for now.

The second issue is I don't know how to reach the guest from other devices.
ifconfig (first is NAT, second is BRIDGE):

enp0s3    Link encap:Ethernet  HWaddr 02:14:68:3e:84:47
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::14:68ff:fe3e:8447/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2280 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2236 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:186742 (186.7 KB)  TX bytes:1599034 (1.5 MB)

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:7c:23:74
          inet6 addr: fe80::a00:27ff:fe7c:2374/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:453 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29213 (29.2 KB)  TX bytes:9198 (9.1 KB)

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:65536  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1684 (1.6 KB)  TX bytes:1684 (1.6 KB)

It is assigned an IPv6.
So I tried defining an static IP as my router's subnet:
config.vm.network "public_network", ip: '192.168.1.111'

I Checked the router, and the VBox is not connecting to it, the VBox is still getting IPv6.

Am I suppose to do something else?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/8130e278-fa83-47cd-9db9-c03f805c6d8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0eyGSBqGJXETvnLEpv_ML%2BsP9PSYycNhhuZVp%3Dw060B1Cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant works in 'Forwarded Port' but I can't make 'Public Network' work

decimoseptimo
In reply to this post by decimoseptimo
Going wired is not feasible for me as the router is on a different room. Is that the only option I have? I miss XAMPP days, so easy to share frontend work to LAN devices.

On Wednesday, November 22, 2017 at 8:49:31 PM UTC-8, [hidden email] wrote:
Vagrant works in 'Forwarded Port'. I can reach the guest webserver from my windows host  (localhost:9990, or the LAN IP <a href="http://192.168.1.100:9990" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F192.168.1.100%3A9990\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFZAMLC28qY1yRsqCC3ZUq6UL8K7w&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F192.168.1.100%3A9990\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFZAMLC28qY1yRsqCC3ZUq6UL8K7w&#39;;return true;">192.168.1.100:9990)
config.vm.network "forwarded_port", guest: 80, host: 9990

As I need the webserver to be reachable from other devices in the LAN I did:
config.vm.network "public_network"

The first issue is the machine boots around 10x slower, but it's ok for now.

The second issue is I don't know how to reach the guest from other devices.
ifconfig (first is NAT, second is BRIDGE):

enp0s3    Link encap:Ethernet  HWaddr 02:14:68:3e:84:47
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::14:68ff:fe3e:8447/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2280 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2236 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:186742 (186.7 KB)  TX bytes:1599034 (1.5 MB)

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:7c:23:74
          inet6 addr: fe80::a00:27ff:fe7c:2374/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:453 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29213 (29.2 KB)  TX bytes:9198 (9.1 KB)

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:65536  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1684 (1.6 KB)  TX bytes:1684 (1.6 KB)

It is assigned an IPv6.
So I tried defining an static IP as my router's subnet:
config.vm.network "public_network", ip: '192.168.1.111'

I Checked the router, and the VBox is not connecting to it, the VBox is still getting IPv6.

Am I suppose to do something else?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c8929bdf-efcb-40c3-b6a8-04848ec51ab7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.