先说说组网:ma5200g-1—cisco7609-1—cisco7609-2—ma5200g-2,鉴于这种情况,要使两台ma5200g的下挂用户实现二层互通,有两种方法,一种是配置GRE的l2***,这种方式需要在MA5200G上增加隧道板,另一种是启用mpls l2***,由于ma5200g直接下挂用户,因此,ce就相当于用户,为此ma5200g为pe,两台7609为p,具体配置如下:
一、ma5200g作为pe的配置:
1、 配置接口地址,这一步一般对于正在使用的设备都是配好的,不需再配。
[Quidway] interface LoopBack 0              进入环回接口
[Quidway-LoopBack0] ip address 1.1.1.9 32   设置环回地址
[Quidway-LoopBack0] quit
[Quidway] interface gig 1/0/0               进入与7609的互连接口
[Quidway-Pos2/0/0] ip address 10.1.1.1 32   设置互联地址
[Quidway-Pos2/0/0] quit
2、启动全局的MPLS能力。
[Quidway] mpls lsr-id 1.1.1.9               将环回地址设为lsr地址
[Quidway] mpls                              启用mpls
[Quidway-mpls] lsp-trigger all             
[Quidway-mpls] quit
3、启动全局的MPLS LDP能力。
[Quidway] mpls ldp
[Quidway-mpls-ldp] quit
4、启动接口的MPLSMPLS LDP能力。
[Quidway] interface gig 1/0/0
[Quidway-Pos2/0/0] mpls
[Quidway-Pos2/0/0] mpls ldp
[Quidway-Pos2/0/0] quit
5、和另一台MA5200G建立远程LDP会话。
[Quidway] mpls ldp
[Quidway-mpls-ldp] remote-peer 1
[Quidway-mpls-ldp-remote1] remote-ip 2.2.2.9(为对端设备的lsr地址)
[Quidway-mpls-ldp-remote1] quit
[Quidway-mpls-ldp] quit
6、全局使能L2×××功能。
[Quidway] l2*** enable
7、创建MPLS实例。
[Quidway] l2*** ***-instance l2***1
8、创建VC
[Quidway-vsi-l2***1] mpls-vc 2.2.2.9 100 encapsulation ethernet
封装模式也可以改为vlan,但是如果要实现PVC互通则只能用ethernet
9、配置BAS接口。
[Quidway] interface Ethernet 1/0/0.1
[Quidway-Ethernet1/0/0.1] user-vlan 1 10
[Quidway-Ethernet1/0/0.1] bas
[Quidway-Ethernet1/0/0.1-bas] access-type l2*** l2***1
二、cisco7609作为p设备的配置
1、启用ip cef功能
router(config)# ip cef distributed
2、启用标记分发
router(config)# tag-switching advertise-tags
3、在与ma5200g的接口和两台cisco7609的互联接口上使用MPLS
router(config)# interface gig0/1
router(config-if)# tag-switching ip
4、指定使用LDP协议,TDP是CISCO私有的
Router(config)# mpls lable protocol LDP