簡介
從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轉換的方法有兩種:
1.中繼埠(OTV內部介面)上的VLAN轉換。
2.在Overlay上配置的VLAN轉換(F3模組目前不支援)。
本文討論第一種方法 — 中繼埠(OTV內部介面)上的VLAN轉換。
第二種方法包含在單獨的檔案中。
必要條件
需求
思科建議您瞭解以下主題:
採用元件
本文檔中的資訊基於以下內容
- 帶有Supervisor 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轉換配置指南