如果要使用 OAM 介面來部署閘道,請完成下列步驟。

  1. 新增額外介面給虛擬機器 (ETH2)。

    VMware

    如果需要用於管理/OAM 的專用 VNIC,請再新增一個 vmxnet3 類型的 vNIC。您必須重複先前的步驟,即按一下確定 (OK),然後再次移至編輯設定 (Edit Settings),以便記下 vNIC MAC 位址。

    vcg-edit-settings-new-network

    KVM

    如果需要用於管理/OAM 的專用 VNIC,請確定您有名為 oam-network 的 libvirt 網路。然後,將下列幾行新增至 XML 虛擬機器結構:

    …..
    </controller>
    <interface type='network'>
      <source network='public_interface'/>
      <vlan><tag id='#public_vlan#'/></vlan>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x11' function='0x0'/>
    </interface>
    <interface type='network'>
      <source network='inside_interface'/>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>
    </interface>
    <interface type='network'> 
      <source network='oam_interface'/>
      <vlan><tag id='#oam_vlan#'/></vlan>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x13' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
  2. meta-data 檔案中設定其他介面。
    instance-id: #_Hostname_#
    local-hostname: #_Hostname_#
    network-interfaces: |
    auto eth0
    iface eth0 inet static
    address #_IPv4_Address_#
    netmask #_IPv4_Netmask_#
    gateway #_IPv4_Gateway_#
    dns-nameservers #_DNS_server_primary_# #_DNS_server_secondary_#
    auto eth1
    iface eth1 inet static
    metric '13'
    address #_MGMT_IPv4_Address_#
    netmask #_MGMT_IPv4_Netmask_#
    gateway #_MGMT_IPv4_Gateway_#
    dns-nameservers #_DNS_server_primary_# #_DNS_server_secondary_#
    auto eth2
    iface eth2 inet static
    address #_OAM_IPv4_Address_# 
    netmask #_OAM_IPv4_Netmask_# 
    up route add -net 10.0.0.0 netmask 255.0.0.0 gw #_OAM_IPv4_Gateway_# 
    up route add -net 192.168.0.0 netmask 255.255.0.0 gw #_OAM_IPv4_Gateway_# 
    dns-nameservers # _DNS_server_primary_# #_DNS_server_secondary_#