[FONT=lucida console]
[/FONT]define_vbox_subnet_for_nat([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#660e7a][B]@nat_net_cidr[/B][/COLOR])
[COLOR=#808080][I]#nat_net_cidr_cidr ** Adapter 1: NAT (attention: [/I][/COLOR][COLOR=#808080][B][I]'''NOT''' [/I][/B][/COLOR][COLOR=#808080][I]NAT-network!!)
[/I][/COLOR]connect_vbox_adapter([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#0000ff]1[/COLOR], [COLOR=#008000][B]'nat'[/B][/COLOR], [COLOR=#660e7a][B]@nat_net_cidr[/B][/COLOR])
[COLOR=#808080][I]#** Adapter 2: Host-only Adapter, vboxnet0; recommended leave the advanced settings as they are.
[/I][/COLOR]make_vbox_host_only_network(name, [COLOR=#660e7a][B]@hostonly_network_ip[/B][/COLOR])
connect_to_hostonly([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#660e7a][B]@hostonly_network_ip[/B][/COLOR])
route_host_to_containers([COLOR=#660e7a][B]@container_network_cidr[/B][/COLOR], [COLOR=#660e7a][B]@hostonly_gateway[/B][/COLOR])
[COLOR=#808080][I]# proxmox in vbox setup
[/I][/COLOR][COLOR=#808080][I]# [/I][/COLOR][COLOR=#808080][B][I][URL]http://forum.proxmox.com/threads/20054-Proxmox-under-Virtualbox-no-outbound-networking[/URL]
[/I][/B][/COLOR][COLOR=#808080][I]#- vbox Proxmox virtual machine:
[/I][/COLOR][COLOR=#808080][I]#-- eth0 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 1" [/I][/B][/COLOR][COLOR=#808080][I]connected with NAT - address 192.168.11.15/24, gateway 192.168.11.2, DNS 192.168.11.3
[/I][/COLOR][COLOR=#808080][I]#-- eth1 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 2" [/I][/B][/COLOR][COLOR=#808080][I]connected with [/I][/COLOR][COLOR=#808080][B][I]"Host only" [/I][/B][/COLOR][COLOR=#808080][I]- address 192.168.4.2/24
[/I][/COLOR][COLOR=#808080][I]#-- vmbr1 (not bridged to any NIC in virtual Proxmox host) - address 192.168.9.1/24
[/I][/COLOR][COLOR=#003c5a][I]nat_net_proxmox_ip [/I][/COLOR]= [COLOR=#008000][B]'192.168.11.15' [/B][/COLOR][COLOR=#808080][I]# not a global variable because in cluster we'd need a ip for each proxmox node
[/I][/COLOR][COLOR=#003c5a][I]nat_net_subnet_mask [/I][/COLOR]= [COLOR=#008000][B]'255.255.255.0'
[/B][/COLOR][COLOR=#808080][I]#-- eth0 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 1" [/I][/B][/COLOR][COLOR=#808080][I]connected with NAT - address nat_net_proxmox_ip, gateway [/I][/COLOR][COLOR=#808080][B][I]@nat_net_gateway[/I][/B][/COLOR][COLOR=#808080][I], DNS [/I][/COLOR][COLOR=#808080][B][I]@nat_net_dns
[/I][/B][/COLOR][COLOR=#808080][I]#-- eth1 = [/I][/COLOR][COLOR=#808080][B][I]"Adapter 2" [/I][/B][/COLOR][COLOR=#808080][I]connected with [/I][/COLOR][COLOR=#808080][B][I]"Host only" [/I][/B][/COLOR][COLOR=#808080][I]- address [/I][/COLOR][COLOR=#808080][B][I]@hostonly_gateway
[/I][/B][/COLOR][COLOR=#808080][I]#-- vmbr1 (not bridged to any NIC in virtual Proxmox host) - address 192.168.9.1/24
[/I][/COLOR]proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/eth0 -type eth -address [/B][/COLOR]#{[COLOR=#003c5a][I]nat_net_proxmox_ip[/I][/COLOR]}[COLOR=#008000][B] -netmask [/B][/COLOR]#{[COLOR=#003c5a][I]nat_net_subnet_mask[/I][/COLOR]}[COLOR=#008000][B]"[/B][/COLOR])
proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/eth0 -gateway [/B][/COLOR]#{[COLOR=#660e7a][B]@nat_net_gateway[/B][/COLOR]}[COLOR=#008000][B]"[/B][/COLOR])
proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/eth1 -gateway [/B][/COLOR]#{[COLOR=#660e7a][B]@hostonly_gateway[/B][/COLOR]}[COLOR=#008000][B]"[/B][/COLOR])
proxmox_ssh([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#008000][B]"pvesh set nodes/localhost/network/vmbr0 -address [/B][/COLOR]#{[COLOR=#660e7a][B]@container_network_vmbr_ip[/B][/COLOR]}[COLOR=#008000][B] -comments 'container network'"[/B][/COLOR])
connect_to_private_network([COLOR=#c37522][I]vm[/I][/COLOR], [COLOR=#660e7a][B]@nat_net_cidr[/B][/COLOR])