实验目的:使用vpls构建伪线使得sw1和sw2二层互通
拓扑如下
配置思路
首先配置R1,R2,R3之间的IGP,我这里使用OSPF;其次在配置MPLS LDP;最后配置VSI
1. IGP
将R1,R2,R3的互联接口和换回接口通告进ospf
R1-R3测试联通性
<R1>ping -a 1.1.1.1 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=40 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=80 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=60 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=50 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=90 ms
--- 3.3.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/64/90 ms
<R1>
2.MPLS LDP
R1,R2,R3之间的互联接口使能MPLS LDP;R1-R3手动指定LDP会话
R1 配置
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
interface GigabitEthernet0/0/2
ip address 10.1.12.1 255.255.255.0
ospf enable 1 area 0.0.0.0
mpls
mpls ldp
#
mpls ldp remote-peer 3.3.3.3 //手动指定对端PE
remote-ip 3.3.3.3
#
验证LDP会话
<R1>dis mpls ldp session //R1成功与R2,R3建立LDP会话
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.2:0 Operational DU Passive 0000:00:00 2/2
3.3.3.3:0 NonExistent Passive 0/0
------------------------------------------------------------------------------
TOTAL: 2 session(s) Found.
3.VSI
R1和R2配置相同
R1配置
#
mpls l2vpn //使能mpls二层vpn
#
vsi 111 static //静态vsi
pwsignal ldp // 信令方式为ldp
vsi-id 1 //一个VPLS域内所有设备的VSI ID应配置为相同
peer 3.3.3.3 //R3的ip
#
interface GigabitEthernet0/0/1 //接口绑定vsi,链接SW1的接口
l2 binding vsi 111
#
验证
在R1查看VSI
<R1>display vsi name 111
Vsi Mem PW Mac Encap Mtu Vsi
Name Disc Type Learn Type Value State
--------------------------------------------------------------------------
111 static ldp unqualify vlan 1500 up
<R1>
SW1配置ip:10.1.1.1/24
SW2配置ip:10.1.1.2/24
在sw1上ping sw2
<Huawei>ping -a 10.1.1.1 10.1.1.2
PING 10.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=255 time=200 ms
Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=255 time=140 ms
Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=255 time=110 ms
Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=255 time=110 ms
--- 10.1.1.2 ping statistics ---
4 packet(s) transmitted
4 packet(s) received
0.00% packet loss
round-trip min/avg/max = 110/140/200 ms
实验成功