IBM Cloud Docs
将 vSRX 设置为 VLAN 网关

将 vSRX 设置为 VLAN 网关

本主题提供了有关将 vSRX 设置为 VLAN 上系统的网关的示例。

您需要知道:

  • 您的 vSRX 类型,高可用性 (HA) 或单项可用 (SA)
  • 要连接到的 VLAN 及其类型 (专用或公用)
  • 该 VLAN 的标识
  • 子网地址以及 CIDR

示例 1

在此示例中,我们有一个 SA vSRX 和一个标识为 1439 的专用 VLAN。 VLAN 具有一个具有地址 /CIDR 10.150.236.128/26 的子网。

要创建示例 VLAN 接口,需要根据以下设置确定其基本接口:

  1. SA 专用 VLAN 基本接口为 ae0
  2. SA 公用 VLAN 基本接口为 ae1
  3. HA 专用 VLAN 基本接口为 reth2
  4. HA 公用 VLAN 基本接口为 reth3

在这种情况下,基本接口为 ae0

要创建 VLAN 接口,请运行以下命令: set interfaces base_interface unit vlan_id vlan-id vlan_id

例如:

set interfaces ae0 unit 1439 vlan-id 1439

对于与 VLAN 关联的每个子网,将在 VLAN 接口上配置网关 IP。

在这种情况下,我们只有一个地址为 10.150.236.128/26 的子网。 此子网的网关 IP 为 10.150.236.129,这是子网 IP 旁边的 IP。

要设置 IP,请运行以下命令:

set interfaces ae0 unit 1439 family inet address 10.150.236.129/26

要创建与 VLAN 接口关联的安全区域,请将该区域命名为 CUSTOMER-PRIVATE 并指定其所有服务:

set security zones security-zone CUSTOMER-PRIVATE interfaces reth2.1898 host-inbound-traffic system-services all

安全策略使用区域和地址。 因此,您还必须使子网的地址簿可用。 在此示例中,工作簿的名称为 VSI_PRIV_NET。 要定义工作簿,请运行以下命令:

set security address-book global address VSI_PRIV_NET 10.150.236.128/26

示例 2

下一个示例描述了 HA vSRX 和具有三个子网的 VLAN:

  • 10.208.110.121/29
  • 10.186.228.145/28
  • 10.208.237.97/29

VLAN 是专用的,其标识为 1898

必须为三个子网中的每个子网配置 IP 地址和地址簿。 使用以下八个命令 (按第一个示例中说明的顺序) 来配置 VLAN:

set interfaces reth2 unit 1898 vlan-id 1898
set interfaces reth2 unit 1898 family inet address 10.208.237.97/29
set interfaces reth2 unit 1898 family inet address 10.186.228.145/28
set interfaces reth2 unit 1898 family inet address 10.208.110.121/29
set security zones security-zone CUSTOMER-PRIVATE interfaces reth2.1898 host-inbound-traffic system-services all
set security address-book global address VSI_PRIV_NET 10.208.237.96/29
set security address-book global address VSI_PRIV_NET1 10.186.228.144/28
set security address-book global address VSI_PRIV_NET2 10.208.110.120/29

示例 3

在最后一个示例中,vSRX 是 HA,但 VLAN 是公共的。 其标识为 1523,并且只有一个子网: 169.47.211.152/29。 使用以下四个命令 (按第一个示例中说明的顺序) 来配置 VLAN:

set interfaces reth3 unit 1523 vlan-id 1523
set interfaces reth3 unit 1523 family inet address 169.47.211.153/29
set security zones security-zone CUSTOMER-PUBLIC interfaces reth3.1523 host-inbound-traffic system-services all
set security address-book global address VSI_PUB_NET 169.47.211.152/29

此处,基本接口为 reth3,因为 vSRX 为 HA,VLAN 为公共。