XEN建立內網(VLAN)

來源:互聯網
上載者:User

標籤:des   style   class   blog   code   http   

步驟:

1、建立一個Network

2、建立VLAN

建立VLAN的時候內部包含幾個工作

2.1、建立一個Vlan對象(圖中的①)

2.2、建立一個PIF(圖中的②)串連之前建立的VLAN和建立的Network

2.3、Vlan(圖中的①)和PIF(圖中的③)串連起來

 

code:

Network.Record networkRecord   = new Network.Record();networkRecord.nameLabel        = "for_vlan_test_1";networkRecord.nameDescription  = "for_vlan_test_1";networkRecord.MTU              = 1500L;//傳輸單元最大值,取設定檔常量,1500LnetworkRecord.otherConfig      = null;Network  network = Network.create(connection, networkRecord);Long tag = 801L;PIF taggedPIF = PIF.getByUuid(connection, "8a6dfb4d-187f-a5d0-7e35-bd8d81a301a7");//PIF為圖中的③//create vlanVLAN vlan = VLAN.create(connection, taggedPIF, tag, network);

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.