Private network with static IP issue on Vagrant up Hook

33 views
Skip to first unread message

Budh Ram

unread,
Mar 12, 2016, 3:14:34 AM3/12/16
to Vagrant
Hello All,

I am working on a vagrat plugin "vagrant-service-manager"[1] and we are facing weird issue related to 'private_network' with 'static ip'.
After having brainstorming discussions/debugging on finding the solution, I came here on the hope of getting some assistance on this issue.

My environment:
  Host OS : Fedora 23
  Guest OS : CentOS 7
  VirtualBox : 5.0.14
  Vagrant : 1.8.2.dev

Here, is the full scenario of the issue: 
The branch 'before_docker_restart' has way to restart docker on firing the command as 'vagrant service-manager env docker' which generate the TLS certs.

However, to enhance the user experience, we migrated this code in the "vagrant up"  'action_hook'(code here[4]) which works seamlessly with 'private_network + dhcp'
combination. However, for 'private_network + static ip', we are getting following error:

      "An error occurred trying to connect: Get https://10.1.2.2:2376/v1.20/images/json: x509: certificate is valid for fe80::a00:27ff:fe9a:f54c, not 10.1.2.2"

It seems that when we restart docker again, docker generate the TLS certificates IPv6 address instead of IPv4.

   "$ ip addr"                     
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 52:54:00:ab:24:98 brd ff:ff:ff:ff:ff:ff
        inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
           valid_lft 86170sec preferred_lft 86170sec
        inet6 fe80::5054:ff:feab:2498/64 scope link 
           valid_lft forever preferred_lft forever
    3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 08:00:27:9a:f5:4c brd ff:ff:ff:ff:ff:ff
        inet 10.1.2.2/24 brd 10.1.2.255 scope global eth1
           valid_lft forever preferred_lft forever
        inet6 fe80::a00:27ff:fe9a:f54c/64 scope link 
           valid_lft forever preferred_lft forever
    4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
        link/ether 02:42:d5:79:4d:a9 brd ff:ff:ff:ff:ff:ff
        inet 172.17.42.1/16 scope global docker0
           valid_lft forever preferred_lft forever


Any help/pointer/guidance is highly appreciated.

Regards,
Budh Ram Gurung

Joaquin Menchaca

unread,
Mar 18, 2016, 1:55:36 PM3/18/16
to Vagrant
What web service is listening on 10.1.2.2? 
Reply all
Reply to author
Forward
0 new messages