Skip to content

Latest commit

 

History

History
84 lines (75 loc) · 1.76 KB

static-ip-example.md

File metadata and controls

84 lines (75 loc) · 1.76 KB

Network definition in cloud config

networks:
- name: default
  type: manual
  subnets:
  - az: lon02
    cloud_properties:
      vlan_ids: [((PUBLIC_VLAN_ID)), ((PRIVATE_VLAN_ID))]
    dns: [((POWER_DNS_IP)), 10.0.80.11, 10.0.80.12]
    gateway: 10.112.166.129
    range: 10.112.166.128/26
    reserved: []
    static: [10.112.166.134, 10.112.166.135]
- name: dynamic
  type: dynamic
  subnets:
  - az: lon02
    cloud_properties:
      vlan_ids: [((PUBLIC_VLAN_ID)), ((PRIVATE_VLAN_ID))]
    dns: [((POWER_DNS_IP)), 10.0.80.11, 10.0.80.12]

instance_group definition in deployment manifest which uses the static ips

instance_groups:
- name: dummy
  azs:
  - lon02
  instances: 2
  vm_type: default
  stemcell: ubuntu
  networks:
  - name: default
    static_ips:
    - 10.112.166.134
    - 10.112.166.135
  - name: dynamic
    default:
    - gateway
    - dns
  jobs:
  - name: dummy
  release: dummy

The network interfaces definition of the deployed vm with the static ip should be like this:

cat /etc/network/interfaces
# Generated by bosh-agent
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 10.112.249.1
    network 10.112.249.0
    netmask 255.255.255.0
    post-up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.112.249.1
    post-up route add -net 161.26.0.0 netmask 255.255.0.0 gw 10.112.249.1

auto eth0:2
iface eth0:2 inet static
    address 10.112.166.134
    network 10.112.166.128
    netmask 255.255.255.240

auto eth1
iface eth1 inet static
    address 159.122.224.1
    network 159.122.224.128
    netmask 255.255.255.224
    broadcast 159.122.224.159
    gateway 159.122.224.129

auto eth1:0
iface eth1:0 inet static
    address 10.112.166.134
    network 10.112.166.128
    netmask 255.255.255.240