vagrant-landrush / landrush

A Vagrant plugin that provides a simple DNS server for Vagrant guests
MIT License
668 stars 80 forks source link

Problem reading vagrant machine IP address #19

Open karmelak opened 10 years ago

karmelak commented 10 years ago

I have a problem with landrush reading my vagrant machine IP address. During vagrant up it logs something like that: [default] [landrush] adding machine entry: mysite.dev => (notice the value is empty). And because of that I cant access mysite.dev.

~/.vagrant.d/data/landrush/hosts.json looks like that:

{
  "mysite.dev": null
}

and when i set there a proper ip, everything works. I looked up the code and run the statement from read_host_visible_ip_address.rb and it outputs something that looks good to me. The last address is the one i set in Vagrantfie for private_network.

→ ifconfig  | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'     
10.0.2.15
192.168.66.101
phinze commented 10 years ago

Hi @karmelak sorry I missed the notification for this issue! :see_no_evil:

Would you mind letting me know the host/guest you were trying for this if you can remember?

karmelak commented 10 years ago

I tried Debian wheezy VM on OSX 10.9 host. I also tried similar configuration using Ubuntu 13.10 VM and it worked. But I still need that debian VM so I'll be glad if you can help me with that.

phinze commented 10 years ago

Will do - is the box you used for debian wheezy one of the ones up on http://www.vagrantbox.es/?

karmelak commented 10 years ago

I made the box myself using this script https://github.com/EmmanuelKasper/vagrant-debian-wheezy-64

Menelao commented 10 years ago

Same problem

hferentschik commented 8 years ago

@karmelak is this still an issue? Can you try Landrush 1.0.0?

ianmiell commented 6 years ago

I'm having a similar problem, and I think it's because the order of interfaces is unpredictable:

imiell@rothko:/space/git/shutit-openshift-cluster/vagrant_run/shutit_openshift_cluster_QyDYrE  ⑂ master +  $  vagrant landrush ls
master1.vagrant.test           172.28.128.3
3.128.28.172.in-addr.arpa      master1.vagrant.test
node1.vagrant.test             10.0.2.15
15.2.0.10.in-addr.arpa         node1.vagrant.test

imiell@rothko:/space/git/shutit-openshift-cluster/vagrant_run/shutit_openshift_cluster_QyDYrE  ⑂ master +  $  vagrant ssh master1
Last login: Thu Mar 22 06:28:34 2018 from 10.0.2.2
[vagrant@master1 ~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::5054:ff:feda:a710  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:da:a7:10  txqueuelen 1000  (Ethernet)
        RX packets 2772  bytes 2125964 (2.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1175  bytes 143241 (139.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.28.128.3  netmask 255.255.255.0  broadcast 172.28.128.255
        inet6 fe80::a00:27ff:feb4:358b  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:b4:35:8b  txqueuelen 1000  (Ethernet)
        RX packets 12  bytes 6088 (5.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 2680 (2.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  base 0xd240  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 64  bytes 5568 (5.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5568 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

imiell@rothko:/space/git/shutit-openshift-cluster/vagrant_run/shutit_openshift_cluster_QyDYrE  ⑂ master +  $  vagrant ssh node1
Last login: Fri Mar 23 11:06:00 2018 from 10.0.2.2
[vagrant@node1 ~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.28.128.4  netmask 255.255.255.0  broadcast 172.28.128.255
        inet6 fe80::a00:27ff:feb6:64d3  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:b6:64:d3  txqueuelen 1000  (Ethernet)
        RX packets 4  bytes 2360 (2.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 2664 (2.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  base 0xd240  

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::5054:ff:feda:a710  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:da:a7:10  txqueuelen 1000  (Ethernet)
        RX packets 2802  bytes 2129961 (2.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1181  bytes 147304 (143.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 64  bytes 5568 (5.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5568 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0