How setting two or more "ip" for one interface (Vagrant)?

13 views
Skip to first unread message

jaguar...@gmail.com

unread,
Oct 30, 2017, 12:40:55 PM10/30/17
to Vagrant
How setting two or more "ip" for one interface in Vagrantfile?

Alvaro Miranda Aguilera

unread,
Oct 30, 2017, 5:50:29 PM10/30/17
to vagra...@googlegroups.com
hello

in the documentation, check for networking.


have a look at private and public networks,

Alvaro

On Mon, Oct 30, 2017 at 5:40 PM, <jaguar...@gmail.com> wrote:
How setting two or more "ip" for one interface in Vagrantfile?

--
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 vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/329911ac-e75f-44ea-ad40-072d0cf0a9a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Message has been deleted

jaguar...@gmail.com

unread,
Oct 31, 2017, 3:07:32 AM10/31/17
to Vagrant
it is not work:
joomla.vm.network :private_network, ip: "192.168.5.2"
joomla.vm.network :private_network, ip: "192.168.5.3"

понедельник, 30 октября 2017 г., 19:40:55 UTC+3 пользователь jaguar...@gmail.com написал:

Alvaro Miranda Aguilera

unread,
Oct 31, 2017, 5:50:26 AM10/31/17
to vagra...@googlegroups.com
can you share your full Vagrantfile for review?

On Tue, Oct 31, 2017 at 8:06 AM, <jaguar...@gmail.com> wrote:
it is not work:
joomla.vm.network :private_network, ip: "192.168.4.2"
joomla.vm.network :private_network, ip: "192.168.5.2"


понедельник, 30 октября 2017 г., 19:40:55 UTC+3 пользователь jaguar...@gmail.com написал:
How setting two or more "ip" for one interface in Vagrantfile?

--
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 vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Message has been deleted
Message has been deleted

jaguar...@gmail.com

unread,
Oct 31, 2017, 6:44:55 AM10/31/17
to Vagrant
Vagrant.configure(2) do |config|

    config
.vm.define "joomla" do |joomla|
         
# Base temmplate for virtualbox, we use debian 8.9.0 here
         
#joomla.vm.box = "debian/jessie64"
         joomla
.vm.box = "ubuntu/trusty64"
         
# Domain on which our application will respond later on
         joomla
.vm.hostname = "joomla.dev"
         
# IP address will be used by the VM
         joomla
.vm.network :private_network, ip: "192.168.5.2"
         
#joomla.vm.network :private_network, ip: "192.168.5.3"

         
# Tell vagrant to run ansible as a provisioner
         joomla
.vm.provision :ansible do |ansible|
             
# where the playbook is located
             ansible
.playbook = "provisioning/playbook.yml"
             
# show the ansible-playbook command used by vagrant
             ansible
.verbose = true
         
end
     
end

     
# Access the shared vagrant directory via NFS, otherwise slow on mac and windows
     config
.vm.synced_folder ".", "/vagrant", type: "nfs"

     config
.vm.provider "virtualbox" do |v|
         
# tell virtualbox to give our machine 1Gb RAM and 1 Cores
         v
.memory = 1024
         v
.cpus =1
     
end
end



понедельник, 30 октября 2017 г., 19:40:55 UTC+3 пользователь jaguar...@gmail.com написал:
How setting two or more "ip" for one interface in Vagrantfile?

Alvaro Miranda Aguilera

unread,
Oct 31, 2017, 6:52:33 AM10/31/17
to vagra...@googlegroups.com
the file looks good

after the VM is up, can you ping the ip?

i expect to be up and running.

From there you need to configure the application to use that ip, either hardcoding the ip/virtualhost, or use something like tell the web server to listen for any ip ( 0.0.0.0 )

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 vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

jaguar...@gmail.com

unread,
Oct 31, 2017, 7:01:28 AM10/31/17
to Vagrant
Vagrant up - OK
ping - OK

How add 192.168.5.3?
How setting two or more "ip" for one interface in Vagrantfile?

Alvaro Miranda Aguilera

unread,
Oct 31, 2017, 7:04:48 AM10/31/17
to vagra...@googlegroups.com
In networking, you should't have more than one network card for a network.

Locally it may work.

so this should work:


         joomla.vm.network :private_network, ip: "192.168.5.2"
         joomla.vm.network :private_network, ip: "192.168.5.3"

but its better have separate networks

so this is better:

         joomla.vm.network :private_network, ip: "192.168.15.2"
         joomla.vm.network :private_network, ip: "192.168.25.3"





--
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 vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

jaguar...@gmail.com

unread,
Oct 31, 2017, 7:11:55 AM10/31/17
to Vagrant
This does not work.
I will have the last ip ... ((


понедельник, 30 октября 2017 г., 19:40:55 UTC+3 пользователь jaguar...@gmail.com написал:
How setting two or more "ip" for one interface in Vagrantfile?

Alvaro Miranda Aguilera

unread,
Oct 31, 2017, 7:13:36 AM10/31/17
to vagra...@googlegroups.com
share updated vagrantfile and output of:

vagrant ssh -c '/sbin/ifconfig -a'

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 vagrant-up+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

jaguar...@gmail.com

unread,
Oct 31, 2017, 7:25:41 AM10/31/17
to Vagrant
You are right. It's working.
It's strange that it did not work before.

Введите код.eth0      Link encap:Ethernet  HWaddr 08:00:27:f1:ca:b0  
          inet addr
:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr
: fe80::a00:27ff:fef1:cab0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU
:1500  Metric:1
          RX packets
:21705 errors:0 dropped:0 overruns:0 frame:0
          TX packets
:10868 errors:0 dropped:0 overruns:0 carrier:0
          collisions
:0 txqueuelen:1000
          RX bytes
:24539680 (24.5 MB)  TX bytes:1020121 (1.0 MB)

eth1      
Link encap:Ethernet  HWaddr 08:00:27:04:e4:ef  
          inet addr
:192.168.5.2  Bcast:192.168.5.255  Mask:255.255.255.0
          inet6 addr
: fe80::a00:27ff:fe04:e4ef/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU
:1500  Metric:1
          RX packets
:44 errors:0 dropped:0 overruns:0 frame:0
          TX packets
:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions
:0 txqueuelen:1000
          RX bytes
:4856 (4.8 KB)  TX bytes:2966 (2.9 KB)

eth2      
Link encap:Ethernet  HWaddr 08:00:27:64:7a:ba  
          inet addr
:192.168.5.3  Bcast:192.168.5.255  Mask:255.255.255.0
          inet6 addr
: fe80::a00:27ff:fe64:7aba/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU
:1500  Metric:1
          RX packets
:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets
:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions
:0 txqueuelen:1000
          RX bytes
:329 (329.0 B)  TX bytes:648 (648.0 B)

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
:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets
:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions
:0 txqueuelen:0
          RX bytes
:260 (260.0 B)  TX bytes:260 (260.0 B)
..



понедельник, 30 октября 2017 г., 19:40:55 UTC+3 пользователь jaguar...@gmail.com написал:
How setting two or more "ip" for one interface in Vagrantfile?

jaguar...@gmail.com

unread,
Oct 31, 2017, 7:28:29 AM10/31/17
to Vagrant
Thank very mach!


понедельник, 30 октября 2017 г., 19:40:55 UTC+3 пользователь jaguar...@gmail.com написал:
How setting two or more "ip" for one interface in Vagrantfile?
Reply all
Reply to author
Forward
0 new messages