| 
 1.mpls lsr-idx.x.x.x 
指定LSR的ID 
2.mpls ldp 
激活LDP协议并进入LDP视图 
3.remote-peer local-ip x.x.x.x(local-ip)remote-ip (x.x.x.x)remote-ip 
配置LDP Remote-peer,配置LDP remote-peer必须配置local-ip 
4.loop-detect 
允许进行环路检测 
5.hops-count (hop-numbe) 
设置环路检测最大跳数,设置环路检测的最大跳数,缺省情况下没有配置环路检测最大跳数 
6.path-vectors (pv-number) 
设置路径向量的最大值,当环路检测采用路径向量方式时,也需要规定LSP的最大值。这样,在以下条件之一时即认为出现了环路,LSP建立失败: 
(1) 路径向量记录表中已有本LSR的记录。 
(2) 路径的跳数超过这里设定的最大值。 
7. mpls ldp enable 
在接口使能LDP 
8.mpls ldp timer { keepalive keepalive-holdtime| hello hello-holdtime } 
设置接口LDP会话保持参数,Keepalive报文的缺省定时时间为60秒,Hello报文的缺省定时时间为15秒 
在不支持广播报文的链路层协议(如帧中继、ATM)上,必须要使用命令map ip { ip-address [ ip-mask ] | default | inarp [ minutes ] } [broadcast ]配置broadcast属性,以支持广播和组播报文的传递 
 
******************************************************************* 
 
要实现BGP/MPLS VPN的功能一般需要完成以下步骤: 
  在PE、CE、P上配置基本信息; 
  建立PE到PE的具有IP能力的逻辑或物理的链路; 
  发布、更新VPN信息。 
BGP/MPLS VPN的配置包括: 
  定义BGP/MPLS VPN 
  进入协议地址族视图 
  PE-CE间路由交换的配置 
  PE-PE间路由交换的配置 
1. 创建并进入VPN实例视图 
ip vpn-instance (vpn-instance-name) 
2. 为vpn-instance创建路由和转发表 
route-distinguisher (route-distinguisher) 
RD在与自治系统号(ASN)相关时,RD是由一个自治系统号和一个任意的数组成。RD在与IP地址相关时,RD是由一个IP地址和一个任意的数组成。 
RD有以下格式: 
(16位ASN:32位用户自定义数),例如:100:1 
(32位IP地址:16位用户自定义数),例如:172.1.1.1:1 
3. 为vpn-instance创建VPN Target扩展团体 
vpn-target (vpn-target-ext-community) [import-extcommunity | export-extcommunity | both ] 
4. 限制一个vpn-instance中最大路由数 
routing-table limit (limit) { warn threshold |simply-alert } 
5. 将接口与vpn-instance关联 
ip binding vpn-instance (vpn-instance-name) 
在实施接口与vpn-instance的绑定时,需要在接口上先执行ip binding vpn-instance命令,再配置IP地址,否则已经配置的IP地址会因为执行ip binding vpn-instance命令而被删除 
请在BGP视图下进行下列配置 
ipv4-family vpn-instance (vpn-instance-name) 
ipv4-family vpnv4 [ unicast ] 
PE-CE间路由交换的配置 
1. PE和CE间通过静态路由链接的配置 
ip route-static vpn-instance (vpn-instance-name)prefix mask [ next-hop-address ] [ interface { interface-number } ] [ public |preference preference | blackhole | reject ] 
2. PE和CE间通过EBGP交换路由信息的配置 
peer (peer-address) as-number (as-number) 
PE-PE间路由交换的配置 
1. 配置自治系统号 
peer { peer-address | group-name } as-number (as-number) 
2. 配置允许内部BGP会话使用任何可操作的TCP连接接口 
peer { peer-address | group-name }connect-interface interface-type interface-name 
3. 配置是否激活对等体(组) 
peer { group-name | peer-address } enable 
4. 配置向对等体(组)发送缺省路由 
peer { peer-address | group-name }default-route-advertise 
5. 配置在发布路由时将自身地址作为下一跳 
peer { peer-address | group-name }next-hop-local 
6. 配置传送BGP更新报文时不携带私有自治系统号 
peer { peer-address | group-name }public-as-only  
 |