简介
从Cisco NX-OS版本6.2(2)开始,您可以将本地站点上的VLAN映射到远程站点上具有不同VLAN ID的VLAN。当您跨站点映射两个具有不同VLAN ID的VLAN时,它们会映射到称为传输VLAN的公共VLAN。例如,当您将站点A上的VLAN 1映射到站点B上的VLAN 2时,两个VLAN都映射到传输VLAN。从站点A上的VLAN 1始发的所有流量都转换为从传输VLAN传输。从传输VLAN到达站点B的所有流量都转换为VLAN 2。
本文档提供了在OTV上实现Vlan映射的配置示例。
在OTV上配置VLAN转换的方法有2种:
1.中继端口(OTV内部接口)上的VLAN转换。
2.重叠上配置的VLAN转换(F3模块当前不支持)。
本文档将讨论第一种方法 — 中继端口(OTV内部接口)上的VLAN转换。
第二种方法在单独的文档中进行介绍。
先决条件
要求
Cisco 建议您了解以下主题:
使用的组件
本文档中的信息基于以下内容
- 带管理引擎2模块的Cisco Nexus 7000系列交换机。
- F3线卡
- 软件版本:7.3(0)DX(1)
本文档中的信息都是基于特定实验室环境中的设备编写的。 本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
配置
网络图
配置
您可以在端口上配置入口VLAN和本地VLAN之间的VLAN转换。进入入口VLAN的流量映射到中继端口入口处的本地VLAN,而使用转换后的VLAN ID进行内部标记的流量在离开交换机端口之前映射回原始VLAN ID。此配置方法不具有OTV依赖关系。
SITE-1:
AGG VDC:
interface port-channel43
switchport
switchport mode trunk
switchport trunk allowed vlan 10
mtu 9216
interface Vlan10
no shutdown
ip address 10.10.10.1/24
OTV VDC:
N7K-Site-1-OTV# sh port-channel summary interface po43
Flags: D - Down P - Up in port-channel (members)
I - Individual H - Hot-standby (LACP only)
s - Suspended r - Module-removed
b - BFD Session Wait
S - Switched R - Routed
U - Up (port-channel)
M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port- Type Protocol Member Ports
Channel
--------------------------------------------------------------------------------
43 Po43(SU) Eth LACP Eth1/23(P) Eth2/23(P)
//vlan 10 is the local vlan and it will be mapped to vlan 30(transport vlan).
//Transport vlan is only defined in the OTV VDC.
interface port-channel43
switchport
switchport mode trunk
switchport vlan mapping enable >> This command shows up only under member ports config all
switchport vlan mapping 10 30 >> Mapping vlan 10 to vlan 30
switchport trunk allowed vlan 30
mtu 9216
interface Overlay0
description Overlay trunk to DCI
otv join-interface port-channelXX
otv control-group X.X.X.X
otv data-group X.X.X.X
otv extend-vlan 30
SITE-2:
AGG VDC:
interface port-channel43
switchport
switchport mode trunk
switchport trunk allowed vlan 20
mtu 9216
interface Vlan20
no shutdown
ip address 10.10.10.2/24
OTV VDC:
N7K-Site-2-OTV# sh port-channel summary interface po43
Flags: D - Down P - Up in port-channel (members)
I - Individual H - Hot-standby (LACP only)
s - Suspended r - Module-removed
b - BFD Session Wait
S - Switched R - Routed
U - Up (port-channel)
M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port- Type Protocol Member Ports
Channel
--------------------------------------------------------------------------------
43 Po43(SU) Eth LACP Eth1/23(P) Eth2/23(P)
//Vlan 20 is the local vlan and it will be mapped to vlan 30(transport vlan)
//Transport vlan is only defined in the OTV VDC
interface port-channel43
switchport
switchport mode trunk
switchport vlan mapping enable >> This command shows up only under member port config all
switchport vlan mapping 20 30 >> Mapping vlan 20 to vlan 30
switchport trunk allowed vlan 30
mtu 9216
interface Overlay0
description Overlay trunk to DCI
otv join-interface port-channelXX
otv control-group X.X.X.X
otv data-group X.X.X.X
otv extend-vlan 30
验证
N7K-Site1-OTV# show interface port-channel 43 vlan mapping
Interface Po43:
Original VLAN Translated VLAN
--------------- -----------------
10 30
N7K-Site1-otv# show vlan internal info mapping | inc Po43 next 6
ifindex Po43(0x1600002a)
vlan mapping enabled: TRUE
vlan translation mapping information (count=1):
Original Vlan Translated Vlan
------------- ---------------
10 30
N7K-Site1-AGG# sh mac address-table vlan 10
Note: MAC table entries displayed are getting read from software.
Use the 'hardware-age' keyword to get information related to 'Age'
Legend:
* - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC
age - seconds since last seen,+ - primary entry using vPC Peer-Link, E -
EVPN entry
(T) - True, (F) - False , ~~~ - use 'hardware-age' keyword to retrieve
age info
VLAN/BD MAC Address Type age Secure NTFY Ports/SWID.SSID.LID
---------+-----------------+--------+---------+------+----+------------------
G 10 8c60.4fac.b9c2 static - F F sup-eth1(R)
* 10 8c60.4f89.71c2 dynamic ~~~ F F Po43 <------- Remote Vlan 20 mac address learned in vlan 10 in AGG VDC
N7k-Site1-OTV# sh otv route vlan 10
OTV Unicast MAC Routing Table For Overlay0
VLAN MAC-Address Metric Uptime Owner Next-hop(s)
---- -------------- ------ -------- --------- -----------
30 8c60.4f89.71c2 42 2d20h overlay F340.22.11-N77-C7706-1-otv <------ Remote Vlan 20 MAC showing up as Vlan 30 MAC in OTV VDC
30 8c60.4fac.b9c2 1 2d20h site port-channel43 <------ Local Vlan 10 MAC showing up as Vlan 30 MAC in OTV VDC
参考
OTV配置指南
通用VLAN转换配置指南