![]() On the bash script you should set the IP/netmask, gateway and DNS (and interface number, if yours is different, it should be eth1 though if you've just got bridged set in Vagrantfile). Not ideal, but I haven't come up with a better solution yet! So, the alternative is creating a script in /etc/network/if-up.d/ that re-sets the IP for the interface. You can use shell provisioning to re-configure the network with your IP, but you cannot modify the /etc/network/interfaces file or the VM will not be able to come back up if you do a vagrant halt (doing vagrant up will try and reconfigure the network interfaces, and it dies if you've modified that file). Unfortunately, vagrant does not yet support this (see discussion here).įirstly, set box_config.vm.network :bridged as you need virtualbox to create a bridged interface, and you can remove the box_config.vm.network :hostonly. What you really need is a bridged interface with a static IP. Now, i can install applications to the box and connect to them over public static ip without "port_forwarding" setup (Like on VPS). # For example, my vagrant box public static ip is 8.8.8.8 ![]() Rebuild-iptables needs to generate and apply iptables rules: # /etc/iptables/general Ĭookbook generates Vagrantfile from template: Vagrant::n do |config|īox_config.vm.network :hostonly, "192.168.5.10" Wrote rebuild-iptables with nat support.I'm using Oracle VM VirtualBox Manager 4.1.18 and Vagrant version 1.0.3.Īfter two weeks, I resolved my question this way: How I can access virtual box via public static IP from network? Debian-host-machine# cat Vagrantfileīox_config.vm.network :hostonly, "188.120.244.5", :auto_config => falseĮth1 Link encap:Ethernet HWaddr 00:15:17:69:71:bb What I have now: Not working configuration. config.vm.network :bridged - I'm confused how this works :).Of course 188.120.244.1 IP isn't mine and I can't access my server via this IP. Was created new interface on host-machine with ip "188.120.244.1". config.vm.forward_port - good idea: setup interface "eth1:1" with 188.120.244.5 on host-machine, and add to Vagrant file "config.vm.forward_port = hmm.?".What I want: Setup virtual box (Ubuntu) with access via static IP (188.120.244.5). I have server (Debian Squeeze) with 1 ethernet card and 2 public static IPs (188.120.245.4 and 188.120.244.5).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |