配置过程
1、配置基础配置,为接口分配IP地址
2、启用isis配置
isis 100
network-entity 49.0001.0030.0300.3003.00 //49.0001区域号;0030.0300.3003为系统id;00表示为net网络
cost-style wide //选择宽动态模式
is-level level-2 //选择模式
接口模式下启用isis:isis enable 100
3、启用mpls
mpls lsr-id x.x.x.x //环回接口
mpls
mpls ldp
接口下设置:
mpls
mpls ldp
特别注意:华为默认将主机地址设置为FEC
4、创建vrf(虚拟路由转发)
ip vpn-instance XYZ //创建vpn样例
ipv4-family
route-distinguisher 4:1 //设置RD
vpn-target 4:1 export-extcommunity
vpn-target 4:1 5:3 import-extcommunity
5、将样例与接口绑定
interface g0/0/0
IP binding vpn-instance XYZ
ip address 12.1.1.3 24
6、配置BGP
BGP 200
router-id 3.3.3.3
undo default ipv4-unicast //这条命令是防止路由默认直接将对等体加入ipv4中
peer 5.5.5.5 as-number 200
peer 5.5.5.5 connect-interface loopback 0
将对等体加入到vpnv4中
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.3 enable
7、设置静态路由
ip route-static vpn-instance XYZ 1.1.1.1 32 g0/0/0 13.1.1.1
8、将静态路由加入到样例中
ipv4-family vpn-instance XYZ
import-route static
特别注意事项:PE设备中有两个路由表,全局路由表和VRF表