Enabling guest to access the same network as host?

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

Enabling guest to access the same network as host?

Antti
Hey!

I have Vagrant set up and working fine, except I would like the guest (CentOS) vm to be able to access same network as the host (OS X) does. How should I set it up? For example my host can access lan server normally, but the VM host isn't able to.

My host ip address is: 10.0.2.134 and lan server is accessible from 10.0.2.50 for example

Vagrant is set up with following config:

Vagrant.configure("2") do |config|
  config.vm.network :forwarded_port, guest: 80, host: 8001, auto_correct: true
  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--memory", "1024", "--nicpromisc3", "allow-all"]
  end
end

From Vagrant SSH:

Vagrant box (CentOS)
inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0

And routing information from CentOS
[vagrant@localhost ~]$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0

-> 10.0.2.2 being the host (OS X) computer 


Any ideas how to make the guest vm access the same network as the host does?

--
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].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Enabling guest to access the same network as host?

Mike
Are you looking for public_network (used to be called bridged)?

v1.1 refs: http://docs.vagrantup.com/v2/networking/public_network.html
v1.0 refs: http://docs-v1.vagrantup.com/v1/docs/bridged_networking.html

-M

On Thu, Apr 11, 2013 at 3:52 AM, Antti <[hidden email]> wrote:

> Hey!
>
> I have Vagrant set up and working fine, except I would like the guest
> (CentOS) vm to be able to access same network as the host (OS X) does. How
> should I set it up? For example my host can access lan server normally, but
> the VM host isn't able to.
>
> My host ip address is: 10.0.2.134 and lan server is accessible from
> 10.0.2.50 for example
>
> Vagrant is set up with following config:
>
> Vagrant.configure("2") do |config|
>   config.vm.network :forwarded_port, guest: 80, host: 8001, auto_correct:
> true
>   config.vm.provider :virtualbox do |vb|
>     vb.customize ["modifyvm", :id, "--memory", "1024", "--nicpromisc3",
> "allow-all"]
>   end
> end
>
> From Vagrant SSH:
>
> Vagrant box (CentOS)
> inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
>
> And routing information from CentOS
> [vagrant@localhost ~]$ route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> 10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
> link-local      *               255.255.0.0     U     1002   0        0 eth0
> default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
>
> -> 10.0.2.2 being the host (OS X) computer
>
>
> Any ideas how to make the guest vm access the same network as the host does?
>
> --
> 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].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: Enabling guest to access the same network as host?

Antti
Hmm, that setting doesn't seem to help: when I put it in Vagrantfile - it doesn't connect to internet or the host LAN.

Happen to have any other ideas?


On Thursday, April 11, 2013 2:08:25 PM UTC+3, miketheman wrote:
Are you looking for public_network (used to be called bridged)?

v1.1 refs: http://docs.vagrantup.com/v2/networking/public_network.html
v1.0 refs: http://docs-v1.vagrantup.com/v1/docs/bridged_networking.html

-M

On Thu, Apr 11, 2013 at 3:52 AM, Antti <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="XGpCzVaxr-sJ">antti.n...@...> wrote:

> Hey!
>
> I have Vagrant set up and working fine, except I would like the guest
> (CentOS) vm to be able to access same network as the host (OS X) does. How
> should I set it up? For example my host can access lan server normally, but
> the VM host isn't able to.
>
> My host ip address is: 10.0.2.134 and lan server is accessible from
> 10.0.2.50 for example
>
> Vagrant is set up with following config:
>
> Vagrant.configure("2") do |config|
>   config.vm.network :forwarded_port, guest: 80, host: 8001, auto_correct:
> true
>   config.vm.provider :virtualbox do |vb|
>     vb.customize ["modifyvm", :id, "--memory", "1024", "--nicpromisc3",
> "allow-all"]
>   end
> end
>
> From Vagrant SSH:
>
> Vagrant box (CentOS)
> inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
>
> And routing information from CentOS
> [vagrant@localhost ~]$ route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> 10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
> link-local      *               255.255.0.0     U     1002   0        0 eth0
> default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
>
> -> 10.0.2.2 being the host (OS X) computer
>
>
> Any ideas how to make the guest vm access the same network as the host does?
>
> --
> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="XGpCzVaxr-sJ">vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
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].
For more options, visit https://groups.google.com/groups/opt_out.