New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static ip addresses on public networks #1745

Merged
merged 1 commit into from Sep 2, 2013

Conversation

Projects
None yet
@jheise
Contributor

jheise commented May 19, 2013

This patch allows users to specify an ip address and netmask for an ip address on a public network

@gimler

This comment has been minimized.

Show comment
Hide comment

gimler commented Jun 12, 2013

+1

@Testjenkins

This comment has been minimized.

Show comment
Hide comment
@Testjenkins

Testjenkins Jun 27, 2013

+1, really usefull

+1, really usefull

@fedecz

This comment has been minimized.

Show comment
Hide comment

fedecz commented Jul 3, 2013

+1

@fedecz

This comment has been minimized.

Show comment
Hide comment
@fedecz

fedecz Jul 3, 2013

Does this make you able to set static IPs on public networks?
If I applied the patch in my current installation, would it just work? I don't want to wait till the merge and release is done.

Thanks!!

fedecz commented on 7a89ab7 Jul 3, 2013

Does this make you able to set static IPs on public networks?
If I applied the patch in my current installation, would it just work? I don't want to wait till the merge and release is done.

Thanks!!

This comment has been minimized.

Show comment
Hide comment
@jheise

jheise Jul 3, 2013

Owner
Owner

jheise replied Jul 3, 2013

This comment has been minimized.

Show comment
Hide comment
@fedecz

fedecz Jul 4, 2013

This comment has been minimized.

Show comment
Hide comment
@Telemakhos

Telemakhos Aug 10, 2013

I was looking for this... thanks!

I was looking for this... thanks!

@Telemakhos

This comment has been minimized.

Show comment
Hide comment

+1

@sinhix

This comment has been minimized.

Show comment
Hide comment
@sinhix

sinhix Aug 16, 2013

Hello,

Thanks for the patch, but it doesn't seem to work with me as I don't know how to edit the configuration.

I did update my plugins/providers/virtualbox/action/network.rb in my vagrant 1.2.7

and I updated my Vagrantfile with something like this

config.vm.network :public_network, ip: "192.168.0.200"

But I guess this is not how you configure this.
Thanks in advance for any help !

EDIT: this configuration actually works, I need to vagrant reload twice to make it work though.

sinhix commented Aug 16, 2013

Hello,

Thanks for the patch, but it doesn't seem to work with me as I don't know how to edit the configuration.

I did update my plugins/providers/virtualbox/action/network.rb in my vagrant 1.2.7

and I updated my Vagrantfile with something like this

config.vm.network :public_network, ip: "192.168.0.200"

But I guess this is not how you configure this.
Thanks in advance for any help !

EDIT: this configuration actually works, I need to vagrant reload twice to make it work though.

@mitchellh

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh Sep 2, 2013

Member

LGTM. Great job thank you.

Member

mitchellh commented Sep 2, 2013

LGTM. Great job thank you.

mitchellh added a commit that referenced this pull request Sep 2, 2013

Merge pull request #1745 from jheise/master
providers/virtualbox: static ip addresses on public networks

@mitchellh mitchellh merged commit 154b32e into hashicorp:master Sep 2, 2013

1 check passed

default The Travis CI build passed
Details
@hyperfocus1337

This comment has been minimized.

Show comment
Hide comment
@hyperfocus1337

hyperfocus1337 Sep 12, 2013

This doesn't work (yet), vagrant reloaded many times to no avail..

I'm on the latest (1.3.1) version of Vagrant, and this is the relevant part of my playbook:

config.vm.define "testbox" do |testbox|
testbox.vm.network "public_network", ip: "192.168.1.100"
end

This doesn't work (yet), vagrant reloaded many times to no avail..

I'm on the latest (1.3.1) version of Vagrant, and this is the relevant part of my playbook:

config.vm.define "testbox" do |testbox|
testbox.vm.network "public_network", ip: "192.168.1.100"
end

@niccolox

This comment has been minimized.

Show comment
Hide comment
@niccolox

niccolox Jan 23, 2014

bridged, static ip, public dns, vagrant as poor mans cloud

config.vm.network "public_network", :bridge => "eth0", ip:"79.37.142.40", :auto_config => "false", :netmask => "255.255.255.0"

config.vm.provision :shell, inline: <<-SCRIPT
sudo ifconfig eth1 79.37.142.40 netmask 255.255.255.0 up
sudo route add default gw 79.37.142.1

bridged, static ip, public dns, vagrant as poor mans cloud

config.vm.network "public_network", :bridge => "eth0", ip:"79.37.142.40", :auto_config => "false", :netmask => "255.255.255.0"

config.vm.provision :shell, inline: <<-SCRIPT
sudo ifconfig eth1 79.37.142.40 netmask 255.255.255.0 up
sudo route add default gw 79.37.142.1

@cpbotha

This comment has been minimized.

Show comment
Hide comment
@cpbotha

cpbotha May 13, 2014

I'm having no luck getting this going, any pointers would be much appreciated. I've tried all kinds of permutations of the above tips. After vagrant up, I get endless Warning: Remote connection disconnect. Retrying...

Any tips are greatly appreciated!

cpbotha commented May 13, 2014

I'm having no luck getting this going, any pointers would be much appreciated. I've tried all kinds of permutations of the above tips. After vagrant up, I get endless Warning: Remote connection disconnect. Retrying...

Any tips are greatly appreciated!

@cpbotha

This comment has been minimized.

Show comment
Hide comment
@cpbotha

cpbotha May 13, 2014

Cancel that, I just had to wait a bit longer. After a minute or two I could connect.

I can confirm that with vagrant 1.6.2 and virtualbox 4.3 all that was needed in the Vagrantfile was:

config.vm.network "public_network", :bridge => "wlan0", :ip => "192.168.1.140"

Thanks!

cpbotha commented May 13, 2014

Cancel that, I just had to wait a bit longer. After a minute or two I could connect.

I can confirm that with vagrant 1.6.2 and virtualbox 4.3 all that was needed in the Vagrantfile was:

config.vm.network "public_network", :bridge => "wlan0", :ip => "192.168.1.140"

Thanks!

@drocsid

This comment has been minimized.

Show comment
Hide comment
@drocsid

drocsid Oct 30, 2014

It doesn't seem to work for me with the following

vagrant --version
Vagrant 1.6.5

virtualbox 4.3.18_OSE

config.vm.network "public_network", :bridge => "eno1", :ip => "10.0.0.23"

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: bridged
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run vagrant up while the
VirtualBox GUI is open.

drocsid commented Oct 30, 2014

It doesn't seem to work for me with the following

vagrant --version
Vagrant 1.6.5

virtualbox 4.3.18_OSE

config.vm.network "public_network", :bridge => "eno1", :ip => "10.0.0.23"

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: bridged
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run vagrant up while the
VirtualBox GUI is open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment