6.148. NetworkAttachment struct


描述主机如何连接到网络。

主机上网络附加的 XML 表示:

<network_attachment href="/ovirt-engine/api/hosts/123/nics/456/networkattachments/789" id="789">
  <network href="/ovirt-engine/api/networks/234" id="234"/>
  <host_nic href="/ovirt-engine/api/hosts/123/nics/123" id="123"/>
  <in_sync>true</in_sync>
  <ip_address_assignments>
    <ip_address_assignment>
      <assignment_method>static</assignment_method>
      <ip>
        <address>192.168.122.39</address>
        <gateway>192.168.122.1</gateway>
        <netmask>255.255.255.0</netmask>
        <version>v4</version>
      </ip>
    </ip_address_assignment>
  </ip_address_assignments>
  <reported_configurations>
    <reported_configuration>
      <name>mtu</name>
      <expected_value>1500</expected_value>
      <actual_value>1500</actual_value>
      <in_sync>true</in_sync>
    </reported_configuration>
    <reported_configuration>
      <name>bridged</name>
      <expected_value>true</expected_value>
      <actual_value>true</actual_value>
      <in_sync>true</in_sync>
    </reported_configuration>
    ...
  </reported_configurations>
</network_attachment>

将网络附加到网卡时,需要使用 idname 的 network 元素。

例如,要将网络附加到主机网络接口卡,请发送如下请求:

POST /ovirt-engine/api/hosts/123/nics/456/networkattachments

使用请求正文,如下所示:

<networkattachment>
  <network id="234"/>
</networkattachment>

要将 newtwork 附加到主机,请发送如下请求:

POST /ovirt-engine/api/hosts/123/networkattachments

使用请求正文,如下所示:

<network_attachment>
  <network id="234"/>
  <host_nic id="456"/>
</network_attachment>

ip_address_assignmentsproperties 元素是创建后的 updatable。

例如,要更新新tork 附加,请发送如下请求:

PUT /ovirt-engine/api/hosts/123/nics/456/networkattachments/789

使用请求正文,如下所示:

<network_attachment>
  <ip_address_assignments>
    <ip_address_assignment>
      <assignment_method>static</assignment_method>
      <ip>
        <address>7.1.1.1</address>
        <gateway>7.1.1.2</gateway>
        <netmask>255.255.255.0</netmask>
        <version>v4</version>
      </ip>
    </ip_address_assignment>
  </ip_address_assignments>
</network_attachment>

要从网卡分离网络,请发送如下请求:

DELETE /ovirt-engine/api/hosts/123/nics/456/networkattachments/789
重要

必须明确提交对网络附加配置的更改。

网络附加的 properties 子集合的 XML 表示:

<network_attachment>
  <properties>
    <property>
      <name>bridge_opts</name>
      <value>
        forward_delay=1500 group_fwd_mask=0x0 multicast_snooping=1
      </value>
    </property>
  </properties>
  ...
</network_attachment>
Expand
表 6.195. 属性概述
名称类型概述

注释

字符串

自由包含此对象的注释的文本。

description

字符串

以纯文本形式的人类可读描述。

id

字符串

唯一标识符。

in_sync

布尔值

 

ip_address_assignments

IpAddressAssignment[]

网络的 IP 配置。

name

字符串

以纯文本形式的人类可读名称。

属性

Property[]

定义网络配置的自定义属性。

reported_configurations

ReportedConfiguration[]

配置属性的只读列表。

6.148.1. 属性

定义网络配置的自定义属性。

网桥选项设置 bridge_opts 的名称。使用空格字符分隔多个条目。以下键对 bridge_opts 有效:

Expand
名称默认值

forward_delay

1500

gc_timer

3765

group_addr

1:80:c2:0:0:0

group_fwd_mask

0x0

hash_elasticity

4

hash_max

512

hello_time

200

hello_timer

70

max_age

2000

multicast_last_member_count

2

multicast_last_member_interval

100

multicast_membership_interval

26000

multicast_querier

0

multicast_querier_interval

25500

multicast_query_interval

13000

multicast_query_response_interval

1000

multicast_query_use_ifaddr

0

multicast_router

1

multicast_snooping

1

multicast_startup_query_count

2

multicast_startup_query_interval

3125

Expand
表 6.196. 链接概述
名称类型概述

主机

主机

 

host_nic

HostNic

对主机网络接口的引用。

network

Network

对接口附加到的网络的引用。

qos

QoS

 
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部