• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 关于我们

02-以太网交换命令参考

03-端口绑定VPN命令

本章节下载 03-端口绑定VPN命令  (159.21 KB)

03-端口绑定VPN命令


1 端口绑定VPN

1.1  端口绑定VPN配置命令

1.1.1  description (VPN instance view)

description命令用来配置VPN实例的描述信息。

undo description命令用来恢复缺省情况。

【命令】

description text

undo description

【缺省情况】

未配置VPN实例的描述信息。

【视图】

VPN实例视图

【缺省用户角色】

network-admin

【参数】

text:VPN实例的描述信息,为1~79个字符的字符串,区分大小写。

【举例】

# 配置名为vpn1的VPN实例的描述信息为“This is vpn1”。

<Sysname> system-view

[Sysname] ip vpn-instance vpn1

[Sysname-vpn-instance-vpn1] description This is vpn1

1.1.2  ip binding vpn-instance

ip binding vpn-instance命令用来配置接口与指定VPN实例关联。

undo ip binding vpn-instance命令用来恢复缺省情况。

【命令】

ip binding vpn-instance vpn-instance-name

undo ip binding vpn-instance

【缺省情况】

接口未关联VPN实例,接口属于公网。

【视图】

接口视图

【缺省用户角色】

network-admin

【参数】

vpn-instance-name:接口关联的VPN实例名称,为1~31个字符的字符串,区分大小写。

【使用指导】

注意

配置或取消接口与VPN实例关联后,该接口上的IP地址等配置将被删除。

 

接口关联的VPN实例,必须已经通过系统视图下的ip vpn-instance命令创建。

不能通过重复执行本命令修改接口关联的VPN实例。如需修改接口关联的VPN实例,请先通过undo ip binding vpn-instance命令取消关联的VPN实例后,再执行ip binding vpn-instance命令关联新的VPN实例。

【举例】

# 将管理以太网接口M-GigabitEthernet0/0/0与名为vpn1的VPN实例关联。

<Sysname> system-view

[Sysname] interface m-gigabitethernet 0/0/0

[Sysname-M-GigabitEthernet0/0/0] ip binding vpn-instance vpn1

【相关命令】

·     ip vpn-instance (System view)

1.1.3  ip vpn-instance (System view)

ip vpn-instance命令用来创建VPN实例,并进入VPN实例视图。如果指定的VPN实例已经存在,则直接进入VPN实例视图。

undo ip vpn-instance命令用来删除指定的VPN实例。

【命令】

ip vpn-instance vpn-instance-name

undo ip vpn-instance vpn-instance-name

【缺省情况】

不存在VPN实例。

【视图】

系统视图

【缺省用户角色】

network-admin

【参数】

vpn-instance-name:VPN实例的名称,为1~31个字符的字符串,区分大小写。

【举例】

# 创建一个名为vpn1的VPN实例,并进入VPN实例视图。

<Sysname> system-view

[Sysname] ip vpn-instance vpn1

[Sysname-vpn-instance-vpn1]

【相关命令】

·     route-distinguisher

1.1.4  route-distinguisher (VPN instance view)

route-distinguisher命令用来配置VPN实例的RD(Route Distinguisher,路由标识)。

undo route-distinguisher命令用来恢复缺省情况。

【命令】

route-distinguisher route-distinguisher

undo route-distinguisher

【缺省情况】

未配置VPN实例的RD。

【视图】

VPN实例视图

【缺省用户角色】

network-admin

【参数】

route-distinguisher:路由标识符,为3~21个字符的字符串。路由标识符有三种格式:

·     16位自治系统号:32位用户自定义数,例如:101:3。

·     32位IP地址:16位用户自定义数,例如:192.168.122.15:1。

·     32位自治系统号:16位用户自定义数字,其中的自治系统号最小值为65536。例如:65536:1。

【使用指导】

RD用于解决不同VPN之间地址空间重叠的问题。将RD添加到一个IPv4前缀之前,就可以使之成为全局唯一的VPN-IPv4地址前缀。

为了保证VPN-IPv4地址全球唯一,建议不要将自治系统号/IP地址设置为私有AS号/私有IP地址。

不能通过重复执行route-distinguisher命令修改VPN实例的RD值。如需修改VPN实例的RD值,请先通过undo route-distinguisher命令删除VPN实例的RD值,再执行route-distinguisher命令配置新的RD值。

【举例】

# 配置VPN实例vpn1的RD为22:1。

<Sysname> system-view

[Sysname] ip vpn-instance vpn1

[Sysname-vpn-instance-vpn1] route-distinguisher 22:1

1.1.5  vpn-id

vpn-id命令用来配置VPN实例的ID。

undo vpn-id命令用来恢复缺省情况。

【命令】

vpn-id vpn-id

undo vpn-id

【缺省情况】

未配置VPN实例的ID。

【视图】

VPN实例视图

【缺省用户角色】

network-admin

【参数】

vpn-id:VPN实例的ID,取值形式为OUI:Index。其中,OUI(Organizationally Unique Identifier,全球统一标识符)的取值范围为十六进制数0~FFFFFF;Index的取值范围为十六进制数0~FFFFFFFF。

【使用指导】

VPN ID是VPN实例的唯一标识,不同VPN实例的VPN ID不能相同。

VPN ID的取值不能为0:0。

【举例】

# 配置VPN实例vpn1的ID为20:1。

<Sysname> system-view

[Sysname] ip vpn-instance vpn1

[Sysname-vpn-instance-vpn1] vpn-id 20:1

【相关命令】

·     display ip vpn-instance

1.1.6  vpn-target

vpn-target命令用来配置VPN实例的Route Target。

undo vpn-target命令用来删除VPN实例的Route Target。

【命令】

vpn-target vpn-target&<1-8> [ both | export-extcommunity | import-extcommunity ]

undo vpn-target { all | vpn-target&<1-8> [ both | export-extcommunity | import-extcommunity ] }

【缺省情况】

未配置指定VPN实例的Route Target。

【视图】

VPN实例视图

【缺省用户角色】

network-admin

【参数】

vpn-target&<1-8>:指定Route Target值。vpn-target为3~21个字符的字符串,取值为AS-number:nn或IP-address:nn。&<1-8>表示前面的参数最多可以输入8次。

Route Target有三种格式:

·     16位自治系统号:32位用户自定义数,例如:101:3。

·     32位IP地址:16位用户自定义数,例如:192.168.122.15:1。

·     32位自治系统号:16位用户自定义数字,其中的自治系统号最小值为65536。例如:65536:1。

both:指定配置的Route Target值同时作为Import Target和Export Target。如果未指定bothexport-extcommunityimport-extcommunity中的任何一个参数时,缺省值为both

export-extcommunity:指定配置的Route Target值为Export Target。

import-extcommunity:指定配置的Route Target值为Import Target。

all:所有Route Target值。

【使用指导】

Route Target用来控制VPN路由的发布。PE在发布的VPN路由中添加Route Target扩展团体属性,该属性的值为配置的Export Target。对端PE接收到VPN路由后,将路由中携带的Route Target属性与本地配置的VPN实例的Import Target进行比较,如果二者中存在相同的值,则将该路由学习到该VPN实例的路由表中。

重复执行本命令,VPN实例的Route Target值为多次配置结果的集合。

【举例】

# 为名为vpn1的VPN实例配置Route Target。

<Sysname> system-view

[Sysname] ip vpn-instance vpn1

[Sysname-vpn-instance-vpn1] vpn-target 3:3 export-extcommunity

[Sysname-vpn-instance-vpn1] vpn-target 4:4 import-extcommunity

[Sysname-vpn-instance-vpn1] vpn-target 5:5 both

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们