日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

玩转华为ENSP模拟器系列 | 配置Dot1q终结子接口接入L2示例

發布時間:2024/3/26 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 玩转华为ENSP模拟器系列 | 配置Dot1q终结子接口接入L2示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

素材來源:華為路由器配置指南

一邊學習一邊整理試驗筆記,并與大家分享,侵權即刪,謝謝支持!

附上匯總貼:玩轉華為ENSP模擬器系列 | 合集_COCOgsta的博客-CSDN博客_ensp實驗大全


目標

從典型的應用場景描述了Dot1q終結子接口接入L2VPN(Layer 2 virtual private network)后,如何保證發送帶有一層VLAN Tag報文的終端用戶通過L2VPN網絡通信。

組網模型

如果通過終結子接口接入L2VPN網絡,為了保證用戶之間互通,需要配置終結子接口綁定VSI(Virtual Switching Instance)/VPWS(Virtual Private Wire Service)接入L2VPN網絡。

如圖1所示,CE通過路由器接入PE,路由器發送到PE的用戶報文帶有一層VLAN Tag,并通過Dot1q終結子接口接入L2VPN用戶網絡。為了保證CE1~CE6的用戶網絡可以互通,需要在PE1、PE2、PE3上部署Dot1q終結子接口綁定VSI/VPWS接入L2VPN網絡。

配置思路

  • 分別配置CE上接口IP地址,CE發往路由器的報文不帶VLAN Tag。
  • 分別在路由器上創建VLAN,確定用戶所屬的VLAN。
  • 分別在路由器、CE上配置二層轉發功能,使得路由器發往PE的報文帶有一層VLAN Tag。
  • 分別在PE上配置VPLS、Dot1q終結子接口,將VSI與Dot1q終結子接口綁定,實現用戶通過VPLS網絡通信。 分別在PE上配置路由協議,保證網絡三層互通。
  • 本示例以OSPF(Open Shortest Path First)為例。
  • 分別在PE上配置MPLS(Multiprotocol Label Switching)基本能力和MPLS LDP(Label Distribution Protoco),建立MPLS LSP(Label Switched Path)。
  • 分別在PE上使能MPLS L2VPN,全局使能設備L2VPN功能。
  • 分別在PE上配置VSI和Dot1q終結子接口,并將VSI與Dot1q終結子接口綁定,實現Dot1q終結子接口接入L2VPN。

操作步驟

  • 在CE上配置接口IP地址
  • 配置CE1

    interface Ethernet0/0/0ip address 10.1.1.1 255.255.255.0

    配置CE2

    interface Ethernet0/0/0ip address 10.1.1.2 255.255.255.0

    配置CE3

    interface Ethernet0/0/0ip address 10.1.1.3 255.255.255.0

    配置CE4

    interface Ethernet0/0/0ip address 10.1.1.4 255.255.255.0

    配置CE5

    interface Ethernet0/0/0ip address 10.1.1.5 255.255.255.0

    配置CE6

    interface Ethernet0/0/0ip address 10.1.1.6 255.255.255.0
  • 在路由器創建VLAN,并關聯二層端口和VLAN
  • 配置DeviceA

    vlan batch 10 20 interface Ethernet0/0/0portswitchport link-type accessport default vlan 10 interface GigabitEthernet0/0/0portswitchport link-type accessport default vlan 20

    配置DeviceB

    vlan batch 10 20 interface Ethernet0/0/0portswitchport link-type accessport default vlan 10 interface GigabitEthernet0/0/0portswitchport link-type accessport default vlan 20

    配置DeviceC

    vlan batch 10 20 interface Ethernet0/0/0portswitchport link-type accessport default vlan 10 interface Ethernet0/0/1portswitchport link-type accessport default vlan 20
  • 配置二層轉發功能
  • 配置DeviceA

    interface Ethernet0/0/1portswitchport link-type trunkport trunk allow-pass vlan 10 20

    配置DeviceB

    interface Ethernet0/0/1portswitchport link-type trunkport trunk allow-pass vlan 10 20

    配置DeviceC

    interface GigabitEthernet0/0/0portswitchport link-type trunkport trunk allow-pass vlan 10 20
  • 配置VPLS
  • 分別在PE上配置OSPF協議

    配置PE的各接口地址。配置OSPF時,注意需要發布PE的32位Loopback接口地址。

    配置PE1。

    interface LoopBack1ip address 1.1.1.9 255.255.255.255 interface Ethernet1/0/0ip address 192.168.1.1 255.255.255.0 interface Ethernet1/0/1ip address 192.168.3.1 255.255.255.0 ospf 1area 0.0.0.0network 1.1.1.9 0.0.0.0network 192.168.1.0 0.0.0.255network 192.168.3.0 0.0.0.255

    配置PE2。

    interface LoopBack1ip address 2.2.2.9 255.255.255.255 interface Ethernet1/0/1ip address 192.168.2.2 255.255.255.0 interface Ethernet1/0/0ip address 192.168.3.2 255.255.255.0 ospf 1area 0.0.0.0network 2.2.2.9 0.0.0.0network 192.168.2.0 0.0.0.255network 192.168.3.0 0.0.0.255

    配置PE3。

    interface LoopBack1ip address 3.3.3.9 255.255.255.255 interface Ethernet1/0/0ip address 192.168.1.2 255.255.255.0 interface Ethernet1/0/1ip address 192.168.2.1 255.255.255.0 ospf 1area 0.0.0.0network 3.3.3.9 0.0.0.0network 192.168.1.0 0.0.0.255network 192.168.3.0 0.0.0.255

    完成上述步驟后,PE1和PE2、PE1和PE3之間通過OSPF協議發現的對方Loopback1的IP路由,并能互相Ping通。

    以PE1的顯示為例。

    [~PE1-ospf-1]dis ip routing-table Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black holeroute ------------------------------------------------------------------------------ Routing Table : _public_Destinations : 14 Routes : 14 Destination/Mask Proto Pre Cost Flags NextHop Interface1.1.1.9/32 Direct 0 0 D 127.0.0.1 LoopBack12.2.2.9/32 OSPF 10 1 D 192.168.3.2 Ethernet1/0/13.3.3.9/32 OSPF 10 1 D 192.168.1.2 Ethernet1/0/0127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0192.168.1.0/24 Direct 0 0 D 192.168.1.1 Ethernet1/0/0192.168.1.1/32 Direct 0 0 D 127.0.0.1 Ethernet1/0/0192.168.1.255/32 Direct 0 0 D 127.0.0.1 Ethernet1/0/0192.168.2.0/24 OSPF 10 2 D 192.168.3.2 Ethernet1/0/1192.168.3.0/24 Direct 0 0 D 192.168.3.1 Ethernet1/0/1192.168.3.1/32 Direct 0 0 D 127.0.0.1 Ethernet1/0/1192.168.3.255/32 Direct 0 0 D 127.0.0.1 Ethernet1/0/1 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 [~PE1-ospf-1] [~PE1-ospf-1]ping 192.168.2.2PING 192.168.2.2: 56 data bytes, press CTRL_C to breakReply from 192.168.2.2: bytes=56 Sequence=1 ttl=255 time=4 msReply from 192.168.2.2: bytes=56 Sequence=2 ttl=255 time=4 msReply from 192.168.2.2: bytes=56 Sequence=3 ttl=255 time=4 msReply from 192.168.2.2: bytes=56 Sequence=4 ttl=255 time=4 msReply from 192.168.2.2: bytes=56 Sequence=5 ttl=255 time=5 ms--- 192.168.2.2 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 4/4/5 ms [~PE1-ospf-1]

    使能MPLS基本能力和LDP

    配置PE1。

    mpls lsr-id 1.1.1.9 mpls mpls ldp interface Ethernet1/0/0mplsmpls ldp interface Ethernet1/0/1mplsmpls ldp

    配置PE2。

    mpls lsr-id 2.2.2.9 mpls mpls ldp interface Ethernet1/0/0mplsmpls ldp interface Ethernet1/0/1mplsmpls ldp

    配置PE3。

    mpls lsr-id 3.3.3.9 mpls mpls ldp interface Ethernet1/0/0mplsmpls ldp interface Ethernet1/0/1mplsmpls ldp

    上述配置完成后,PE1與PE2、PE1與PE3之間建立LDP會話,執行命令display mpls ldp session可以看到顯示結果中Status項為“Operational”。

    以PE1的顯示為例。

    [~PE1-Ethernet1/0/1]dis mpls ldp session LDP Session(s) in Public NetworkCodes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)An asterisk (*) before a session means the session is being deleted.--------------------------------------------------------------------------PeerID Status LAM SsnRole SsnAge KASent/Rcv--------------------------------------------------------------------------2.2.2.9:0 Operational DU Passive 0002:00:01 11527/115273.3.3.9:0 Operational DU Passive 0000:00:01 8/8--------------------------------------------------------------------------TOTAL: 2 Session(s) Found. [~PE1-Ethernet1/0/1]

    使能MPLS L2VPN

    配置PE1。

    mpls l2vpn

    配置PE2。

    mpls l2vpn

    配置PE3。

    mpls l2vpn

    配置VSI和Dot1q終結子接口,并將VSI與Dot1q終結子接口綁定。

    配置PE1。

    vsi ldp1 staticpwsignal ldpvsi-id 2peer 2.2.2.9 peer 3.3.3.9 interface Ethernet1/0/2.1encapsulation dot1q-terminationdot1q termination vid 10dot1q termination vid 20l2 binding vsi ldp1

    配置PE2。

    vsi ldp1 staticpwsignal ldpvsi-id 2peer 1.1.1.9 peer 3.3.3.9 interface Ethernet1/0/2.1encapsulation dot1q-terminationdot1q termination vid 10dot1q termination vid 20l2 binding vsi ldp1

    配置PE3。

    vsi ldp1 staticpwsignal ldpvsi-id 2peer 1.1.1.9 peer 2.2.2.9 interface Ethernet1/0/2.1encapsulation dot1q-terminationdot1q termination vid 10dot1q termination vid 20l2 binding vsi ldp1

    完成上述配置后,在PE1上執行命令display vsi name ldp1 verbose,可以看到名字為ldp1的VSI建立了到PE2、PE3的PW,VSI狀態為Up。

    [~PE1]dis vsi name ldp1 verbose***VSI Name : ldp1Work Mode : normalAdministrator VSI : noIsolate Spoken : disableVSI Index : 1PW Signaling : ldpMember Discovery Style : staticBridge-domain Mode : disablePW MAC Learn Style : unqualifyEncapsulation Type : vlanMTU : 1500Diffserv Mode : uniformService Class : --Color : --DomainId : 255Domain Name : Ignore AcState : disableP2P VSI : disableMulticast Fast Switch : disableCreate Time : 0 days, 0 hours, 21 minutes, 49 secondsVSI State : upResource Status : --VSI ID : 2*Peer Router ID : 2.2.2.9Negotiation-vc-id : 2Encapsulation Type : vlanprimary or secondary : primaryignore-standby-state : noVC Label : 48122Peer Type : dynamicSession : upTunnel ID : 0x0000000001004c4b42 Broadcast Tunnel ID : --Broad BackupTunnel ID : --CKey : 1NKey : 16777376Stp Enable : 0PwIndex : 1Control Word : disableBFD for PW : unavailable*Peer Router ID : 3.3.3.9Negotiation-vc-id : 2Encapsulation Type : vlanprimary or secondary : primaryignore-standby-state : noVC Label : 48123Peer Type : dynamicSession : upTunnel ID : 0x0000000001004c4b43 Broadcast Tunnel ID : --Broad BackupTunnel ID : --CKey : 2NKey : 16777377Stp Enable : 0PwIndex : 2Control Word : disableBFD for PW : unavailableInterface Name : Ethernet1/0/2.1State : upAc Block State : unblockedAccess Port : falseLast Up Time : 2021/01/26 16:48:42Total Up Time : 0 days, 0 hours, 21 minutes, 49 seconds**PW Information:*Peer Ip Address : 2.2.2.9PW State : upLocal VC Label : 48122Remote VC Label : 48122Remote Control Word : disablePW Type : labelLocal VCCV : alert lsp-ping bfd Remote VCCV : alert lsp-ping bfd Tunnel ID : 0x0000000001004c4b42 Broadcast Tunnel ID : --Broad BackupTunnel ID : --Ckey : 1Nkey : 16777376Main PW Token : 0x0Slave PW Token : 0x0Tnl Type : ldpOutInterface : --Backup OutInterface : --Stp Enable : 0Mac Flapping : 0Monitor Group Name : --PW Last Up Time : 2021/01/26 16:51:08PW Total Up Time : 0 days, 0 hours, 19 minutes, 23 seconds*Peer Ip Address : 3.3.3.9PW State : upLocal VC Label : 48123Remote VC Label : 48122Remote Control Word : disablePW Type : labelLocal VCCV : alert lsp-ping bfd Remote VCCV : alert lsp-ping bfd Tunnel ID : 0x0000000001004c4b43 Broadcast Tunnel ID : --Broad BackupTunnel ID : --Ckey : 2Nkey : 16777377Main PW Token : 0x0Slave PW Token : 0x0Tnl Type : ldpOutInterface : --Backup OutInterface : --Stp Enable : 0Mac Flapping : 0Monitor Group Name : --PW Last Up Time : 2021/01/26 16:52:50PW Total Up Time : 0 days, 0 hours, 17 minutes, 41 seconds [~PE1] [~PE1]
  • 檢查配置結果
  • 上述配置完成后,執行命令display dot1q information termination interface,可以查看到Dot1q終結子接口配置信息,及Dot1q終結子接口綁定了VSI。

    以PE1的顯示為例。

    [~PE1]dis dot1q information termination interface ethe 1/0/2Ethernet1/0/2.1VSI boundTotal QinQ Num: 2dot1q termination vid 10dot1q termination vid 20Total vlan-group Num: 0encapsulation dot1q-termination [~PE1]

    CE、CE2和CE3的主機能夠相互Ping通。

    [CE1]ping 10.1.1.2PING 10.1.1.2: 56 data bytes, press CTRL_C to breakReply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=110 msReply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=60 msReply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=80 msReply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=110 msReply from 10.1.1.2: bytes=56 Sequence=5 ttl=255 time=80 ms--- 10.1.1.2 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 60/88/110 ms [CE1]

    總結

    以上是生活随笔為你收集整理的玩转华为ENSP模拟器系列 | 配置Dot1q终结子接口接入L2示例的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。