debian image with public_network?

26 views
Skip to first unread message

Travis Parker

unread,
Oct 9, 2014, 3:34:15 PM10/9/14
to vagra...@googlegroups.com
Hello vagrant-up,

I've tried 3 different debian wheezy images now (chef/debian-7.6, chef/debian-7.4, and mokote/debian-7) and can't get any of them to have basic network connectivity through a public_network/bridged device.

My super simple test is:

vagrant@box$ ip addr
<copy the eth1 IPv4 address, should be in the same subnet as the host>
vagrant@box$ nc -l 5000

me@host$ nc <vm ip> 5000

It works as expected with the ubuntu/trusty64 image, so it's not a host sysctl or anything.

Any help would be much appreciated!

--travis

Alvaro Miranda Aguilera

unread,
Oct 9, 2014, 5:07:01 PM10/9/14
to vagra...@googlegroups.com
the machines where are you testing these are on the same network?

if they are not on the same network, you would need to setup a gw/router on the guest vm

--
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 vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Travis Parker

unread,
Oct 9, 2014, 5:09:52 PM10/9/14
to vagra...@googlegroups.com
On Thu, Oct 9, 2014 at 2:06 PM, Alvaro Miranda Aguilera <kik...@gmail.com> wrote:
the machines where are you testing these are on the same network?
yes, there is only a single machine involved. I'm trying to communicate between the VM and it's own host machine.

--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/0xdeAhWEeFc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Oct 9, 2014, 5:13:20 PM10/9/14
to vagra...@googlegroups.com
can you share your Vagrantfile?

feelfree to change the bridge ip is you like

Travis Parker

unread,
Oct 9, 2014, 5:17:15 PM10/9/14
to vagrant-up
You can pretty well ignore the salt provisioning setup.
-----

# -*- mode: ruby -*-
# vim: ft=ruby:et:sw=2:ts=8:sts=2

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "mokote/debian-7"
  config.vm.network "public_network"

  config.vm.hostname = "dev"

  config.vm.synced_folder "states/", "/srv/salt"
  config.vm.synced_folder "pillar/", "/srv/pillar"

  config.vm.provision :salt do |salt|
    salt.install_master = true
    salt.run_highstate = false # love to, but it's broken in current vagrant

    salt.minion_config = "dev/minion"
    salt.minion_key = "dev/minion.key"
    salt.minion_pub = "dev/minion.pem"

    salt.master_config = "dev/master"
    salt.master_key = "dev/master.key"
    salt.master_pub = "dev/master.pem"
    salt.seed_master = { :dev => salt.minion_pub }
  end
end

Alvaro Miranda Aguilera

unread,
Oct 9, 2014, 5:35:48 PM10/9/14
to vagra...@googlegroups.com

On Fri, Oct 10, 2014 at 10:16 AM, Travis Parker <travis...@gmail.com> wrote:
config.vm.network "public_network"

it should work.

just check there is no firewall and apparmor or selinux is not playing here.

# iptables -L


#getenforce

from the guest you can do check the service is listening on port 5000 for everything and not binded just to localhost

#netstat -anp |grep ':5000'

and from the guest you could test

#telnet localhost:5000

#telnet ip_of_lan:5000


other than that it should work

Travis Parker

unread,
Oct 9, 2014, 6:37:09 PM10/9/14
to vagra...@googlegroups.com
well this is embarrassing. I had checked iptables before, but hadn't looked at netstat to verify that it was listening correctly. It was listening on an ephemeral port number, because the right invocation was to give the bind-port to -p, rather than as a positional arg. It appears the relevant difference with ubuntu was the netcat variant it ships with.

thanks Alvaro for the guidance.
--travis

Reply all
Reply to author
Forward
0 new messages