当前位置:网站首页>华为设备配置BGP/MPLS IP 虚拟专用网命令
华为设备配置BGP/MPLS IP 虚拟专用网命令
2022-06-11 04:43:00 【Tony_long7483】
[Huawei]bgp 100 //进入BGP视图
[Huawei-bgp]peer 10.1.1.1 as-number 100 //将对端PE配置为对等体
[Huawei-bgp]peer 10.1.1.1 connect-interface LoopBack 0 //指定BGP建立TCP(Transmission Control Protocol)连接的接口
[Huawei-bgp]ipv4-family unicast //进入BGP-VPNv4地址族视图
[Huawei-bgp-af-ipv4]peer 10.1.1.1 enable //使能对等体交换VPN-IPv4路由信息的能力
[Huawei]ip vpn-instance 1 //创建VPN实例,并进入VPN实例视图
[Huawei-vpn-instance-1]description vpn1 //配置VPN实例的描述信息
[Huawei-vpn-instance-1]service-id 1 //配置VPN实例的业务标识值
[Huawei-vpn-instance-1]ipv4-family //使能VPN实例IPv4地址族,并进入VPN实例IPv4地址族视图
[Huawei-vpn-instance-1-af-ipv4]route-distinguisher 100:1 //配置VPN实例IPv4地址族的RD
[Huawei-vpn-instance-1-af-ipv4]vpn-target 100:1 //为VPN实例IPv4地址族配置VPN-target扩展团体属性
[Huawei-vpn-instance-1-af-ipv4]routing-table limit 10 2 //配置VPN实例IPv4地址族的最大路由数
[Huawei-vpn-instance-1-af-ipv4]prefix limit 2 1 //配置VPN实例IPv4地址族的最大路由前缀数
[Huawei-vpn-instance-1-af-ipv4]limit-log-interval 5 //配置VPN实例IPv4地址族的路由超出限制后输出日志的频率,默认值为5秒
[Huawei-vpn-instance-1-af-ipv4]import route-policy a1 //配置VPN实例IPv4地址族入方向路由策略
[Huawei-vpn-instance-1-af-ipv4]export route-policy b1 //配置VPN实例IPv4地址族出方向路由策略
[Huawei-GigabitEthernet0/0/1]ip binding vpn-instance 1 //将当前接口与VPN实例绑定
[Huawei-GigabitEthernet0/0/1]ip add 10.1.1.1 24 //配置接口的IP地址
[Huawei]bgp 100 //进入BGP视图
[Huawei-bgp]ipv4-family vpnv4
[Huawei-bgp]ipv4-family vpn-instance 1 //进入BGP-VPN实例IPv4地址族视图
[Huawei-bgp-1]as-number 100 //为VPN实例IPv4地址族配置单独的AS号
[Huawei-bgp-1]peer 10.2.1.1 as-number 200 //将CE配置为VPN私网对等体
[Huawei-bgp-1]peer 10.2.1.1 ebgp-max-hop 255 //配置EBGP连接的最大跳数, 缺省值是255, 如果指定的最大跳数为1,则不能同非直连网络上的对等体建立EBGP连接
[Huawei-bgp-1]import-route direct //引入本端CE的直连路由
[Huawei-bgp-1]network 10.1.1.0 24
[Huawei-bgp-1]peer 10.2.1.1 substitute-as //使能BGP的AS号替换
[Huawei-bgp-1]import-route ospf 1 //引入本站点的OSPF路由
[Huawei]ip route-static vpn-instance 1 20.1.1.1 24 g0/0/2 //为指定VPN实例配置静态路由
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpn-instance 1
[Huawei-bgp-1]import-route static //将配置的静态路由引入到BGP-VPN实例IPv4地址族路由表
[Huawei]ospf 10 vpn-instance 1 //创建PE-CE间的OSPF实例,并进入OSPF视图
[Huawei-ospf-10]domain-id 0 //配置域ID, 缺省为0
[Huawei-ospf-10]route-tag 100 //配置VPN route tag
[Huawei-ospf-10]import-route bgp //引入BGP路由
[Huawei-bgp-1]import-route ospf 10 //将OSPF路由引入BGP-VPN实例IPv4地址族路由表
[Huawei]isis 1 vpn-instance 1 //创建PE-CE间的IS-IS实例,并进入IS-IS视图
[Huawei-isis-1]network-entity 00.0000.0000.0001.00 //设置网络实体名称
[Huawei-isis-1]import-route bgp //引入BGP路由
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpn-instance 1 //进入BGP-VPN实例IPv4地址族视图
[Huawei-bgp-1]import-route isis 1 //将IS-IS路由引入BGP-VPN实例IPv4地址族路由表
[Huawei]display ip vpn-instance 1 //查看指定VPN实例的简要信息
[Huawei]display ip vpn-instance verbose 1 //查看指定VPN实例的详细信息
[Huawei]display ip vpn-instance import-vt 100:1 //查看所有具备指定入口vpn-target属性的VPN实例信息
[Huawei]display ip vpn-instance interface //查看指定VPN实例所绑定的接口信息
[Huawei]display ip routing-table vpn-instance 1 //在PE上查看指定VPN实例IPv4地址族的路由信息
[Huawei]ip vpn-instance 1
[Huawei-vpn-instance-1]ipv4-family
[Huawei-vpn-instance-1-af-ipv4]route-distinguisher 100:1
[Huawei-vpn-instance-1-af-ipv4]vpn-target 100:1 import-extcommunity //为VPN-in实例1 IPv4地址族配置VPN-target扩展团体属性,使得该实例IPv4地址族可以接收所有Spoke-PE发布的VPNv4路由
[Huawei]ip vpn-instance 2
[Huawei-vpn-instance-2]ipv4-family
[Huawei-vpn-instance-2-af-ipv4]route-distinguisher 101:1
[Huawei-vpn-instance-2-af-ipv4]vpn-target 101:1 export-extcommunity //为VPN-out实例2 IPv4地址族配置VPN-target扩展团体属性,发布Hub站点及所有Spoke站点的路由。
[Huawei-GigabitEthernet0/0/1]ip binding vpn-instance 2 //将当前接口与VPN实例绑定
[Huawei-GigabitEthernet0/0/1]ip add 10.1.1.2 24 //配置接口的IP地址
[Huawei-bgp-1]peer 10.2.1.1 allow-as-loop 1 //允许路由环路。这里的number取1,允许AS重复1次的路由通过
[Huawei]ip route-static vpn-instance 2 0.0.0.0 0.0.0.0 10.1.1.2 //这里的vpn-source-name是VPN-out,nexthop-address是绑定VPN-out的接口所在链路的Hub-CE侧接口IP地址
[Huawei-bgp]ipv4-family vpn-instance 2
[Huawei-bgp-2]network 0.0.0.0 0 //通过MP-BGP发布缺省路由给所有Spoke-PE
[Huawei]display bgp vpnv4 all peer //可看到同一AS的PE和ASBR之间BGP VPNv4对等体关系的状态为“Established”
[Huawei]display bgp vpnv4 all routing-table //可以看到VPNv4路由
[Huawei]display ip routing-table vpn-instance 1 //可以看到PE和ASBR上的VPN路由表中有所有相关VPN的路由
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpnv4
[Huawei-bgp-af-vpnv4]peer 10.2.1.1 default-originate vpn-instance 1 //向UPE发送指定VPN实例的缺省路由,不论本地路由表中是否存在缺省路由,SPE都会向UPE发布一条下一跳地址为本地地址的缺省路由
[Huawei-bgp-af-vpnv4]peer 10.2.1.1 reflect-client //配置路由反射器及其客户
[Huawei-bgp-af-vpnv4]peer 10.2.1.1 next-hop-local //配置发布路由时将自身地址作为下一跳。为了使SPE向UPE和NPE方向发布路由时都需要将下一跳地址修改为自身地址,需要在SPE上分别对UPE和NPE对等体配置此命令
[Huawei-LoopBack0]ip add 1.1.1.1 32
[Huawei-LoopBack0]ip binding vpn-instance 1 //将Loopback接口绑定到VPN实例
[Huawei-LoopBack0]ip add 1.1.1.1 32 //配置Loopback接口的地址
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpn-instance 1 //进入BGP-VPN实例IPv4地址族视图
[Huawei-bgp-1]import-route direct //引入直连路由(将伪连接的端点地址的路由引入BGP),伪连接端点地址被BGP作为VPN-IPv4地址发布
[Huawei]ospf 10 vpn-instance 1 //进入OSPF视图
[Huawei-ospf-10]area 0
[Huawei-ospf-10-area-0.0.0.0]sham-link 10.1.1.1 10.2.1.1 //配置伪连接
[Huawei]display ospf 10 sham-link //查看sham-link的建立情况,可发现PE与对端CE的OSPF邻居状态为Full
[Huawei]display ospf routing //查看OSPF路由,可发现CE去往对端CE的路由是作为区域内(Intra Area)路由学到的
[Huawei]bgp 100
[Huawei-bgp]group a1 //创建IBGP对等体组
[Huawei-bgp]peer a1 connect-interface g0/0/2 //指定建立TCP连接的接口
[Huawei-bgp]ipv4-family vpnv4
[Huawei-bgp-af-vpnv4]peer a1 enable //使能与对等体组交换BGP的VPNv4路由, 缺省只有BGP-IPv4单播地址族的对等体是自动使能的
[Huawei-bgp-af-vpnv4]peer 10.2.1.1 group a1 //向对等体组中加入对等体
[Huawei-bgp-af-vpnv4]peer a1 reflect-client //使能RR的BGP-VPNv4路由反射功能
[Huawei-bgp-af-vpnv4]peer 10.2.1.1 reflect-client //使能反射所有客户机的BGP-VPNv4路由
[Huawei-bgp-af-vpnv4]undo policy vpn-target //不对接收的VPNv4路由使能VPN-Target进行过滤
[Huawei-bgp-af-vpnv4]rr-filter 1 //配置路由反射器的反射策略,只有路由目标扩展团体属性满足匹配条件的IBGP路由才被反射,通过这种方式,可以实现路由反射器之间的负载分担
[Huawei-bgp-af-vpnv4]undo reflect between-clients //禁止客户机之间的路由反射
[Huawei-bgp-af-vpnv4]reflector cluster-id 1 //配置路由反射器的集群ID
[Huawei]display bgp vpnv4 all peer //在RR上或客户机PE上查看BGP VPNv4对等体信息,可看到RR与所有客户机的MP-IBGP连接状态为“Established”
[Huawei]display bgp vpnv4 all routing-table peer 10.2.1.1 advertised-routes //在RR上或客户机PE上查看从对等体接收的路由或发布给对等体的VPNv4路由信息,可看到RR和客户机之间能互相收发VPNv4路由信息
[Huawei]display bgp vpnv4 all routing-table peer 10.2.1.1 received-routes
[Huawei]display bgp vpnv4 all group //在RR上查看VPNv4对等体组信息,可查看对等体组的成员,且RR与对等体成员之间的BGP连接状态都为“Established”
[Huawei]route-policy a1 permit node 1 //创建路由策略的节点,并进入路由策略视图
[Huawei-route-policy]apply backup-interface g0/0/2 //设置备份出接口
[Huawei]ip vpn-instance 1
[Huawei-vpn-instance-1]ipv4-family
[Huawei-vpn-instance-1-af-ipv4]ip frr route-policy a1 //使能私网IP FRR功能
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpn-instance 2 //进入BGP-VPN实例IPv4地址族视图
[Huawei-bgp]auto-frr //使能私网BGP Auto FRR功能
[Huawei]ip vpn-instance 3
[Huawei-vpn-instance-3]ipv4-family
[Huawei-vpn-instance-3-af-ipv4]vpn frr route-policy a2 //使能VPN FRR功能
[Huawei]route-policy a4 permit node 1
[Huawei-route-policy]apply backup-nexthop auto //设置为自动寻找备份下一跳模式
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpn-instance 1
[Huawei-bgp-1]vpn-route cross multipath //使能将多条与VPN实例的RD值不同的VPNv4路由交叉至VPN实例中
[Huawei]undo vpn frr all //去使能所有VPN实例的VPN FRR功能
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpnv4 //进入BGP-VPNv4地址族视图
[Huawei-bgp-af-vpnv4]auto-frr //使能VPNv4 FRR功能
[Huawei-bgp-af-vpnv4]bestroute nexthop-resolved tunnel //配置VPNv4路由在下一跳迭代到隧道时才可参与选路,保证流量在回切时不丢包
[Huawei]display mpls lsp include 10.1.1.1 24 verbose //查看VPNv4路由迭代到的备份LSP的索引和标签
[Huawei]tunnel-policy p1 //创建隧道策略,并进入隧道策略视图
[Huawei-tunnel-policy-p1]description p1 //对隧道策略配置描述信息
[Huawei-tunnel-policy-p1]tunnel select-seq lsp cr-lsp gre load-balance-number 2 //配置隧道的优先级顺序和负载分担条数
[Huawei]int Tunnel 0/0/1
[Huawei-Tunnel0/0/1]tunnel-protocol mpls te
[Huawei-Tunnel0/0/1]mpls te reserved-for-binding //使能TE隧道的隧道绑定能力
[Huawei-Tunnel0/0/1]mpls te commit //使MPLS TE的配置生效
[Huawei]tunnel-policy p2 //创建隧道策略
[Huawei-tunnel-policy-p2]tunnel binding destination 20.1.1.1 te Tunnel 0/0/1 //指定隧道绑定策略中的TE隧道
[Huawei]ip vpn-instance 1
[Huawei-vpn-instance-1]ipv4-family
[Huawei-vpn-instance-1-af-ipv4]tnl-policy p2 //对VPN实例IPv4地址族应用隧道策略
[Huawei]display tunnel-info all //查看当前系统中的隧道信息
[Huawei]display interface Tunnel 0/0/1 //查看指定Tunnel接口的详细信息
[Huawei]display tunnel-policy p2 //查看当前系统中存在的隧道策略信息
[Huawei]display ip vpn-instance verbose //查看VPN实例应用的隧道策略
[Huawei]tunnel-selector s1 permit node 1 //创建隧道选择器,并进入隧道选择器视图
[Huawei-tunnel-selector]apply tunnel-policy p1 //为通过if-match子句过滤的路由选择相应的隧道策略
[Huawei]bgp 100
[Huawei-bgp]ipv4-family vpnv4
[Huawei-bgp-af-vpnv4]tunnel-selector s1 //对本设备上的VPNv4路由应用隧道选择器
[Huawei]display tunnel-selector s1 //查看隧道选择器的详细配置信息
display bgp vpnv4 all routing-table label //查看BGP路由表中的标签路由信息
display bgp vpnv4 all routing-table statistics //查看BGP VPNv4路由表的统计信息
display bgp vpnv4 all network //查看BGP通过network方式发布的VPNv4路由信息
display bgp vpnv4 all paths //查看BGP VPNv4的AS路径信息
ping -vpn-instance 1 10.1.1.1 //检测从发送端到目的地址之间的网络是否连通
tracert -vpn-instance 1 10.1.1.1 //查看数据包从发送端到目的地址所经过的网关
ping lsp ip 10.1.1.1 24 //检测LSP链路的连通性
tracert lsp ip 10.1.1.1 24 //查看数据包在LSP上从发送主机到目的地所经过的网关
display ip routing-table all-vpn-instance statistics //查看所有IPv4 VPN实例的综合路由统计信息
refresh bgp vpn-instance 1 ipv4-family all import //触发入方向VPN实例IPv4地址族BGP连接软复位,使新的配置生效
refresh bgp vpn-instance 1 ipv4-family all export //触发出方向VPN实例IPv4地址族BGP连接软复位,使新的配置生效
refresh bgp vpnv4 all import //触发入方向BGP的VPNv4连接软复位,使新的配置生效
refresh bgp vpnv4 all export //触发出方向BGP的VPNv4连接软复位,使新的配置生效
display tunnel-info tunnel-id 1 //查看指定隧道的详细信息
display tunnel-info all //查看系统中所有隧道的信息
边栏推荐
- Cartographer learning record: cartographer Map 3D visualization configuration (self recording dataset version)
- Unity map mapping
- Leetcode question brushing series - mode 2 (datastructure linked list) - 24 (m): swap nodes in pairs exchange nodes in the linked list
- World programming language ranking in January 2022
- 精益产品开发体系最佳实践及原则
- Temporary website English Writing
- Programming Examples Using RDMA Verbs
- Ican uses fast r-cnn to get an empty object detection result file
- Cartographer learning records: 3D slam part of cartographer source code (I)
- Project architecture evolution
猜你喜欢

The 4th small class discussion class on fundamentals of information and communication

Implementation of unity transport mechanism

ACTS:如何让缺陷无处藏身?

Redis master-slave replication, sentinel, cluster cluster principle + experiment (wait, it will be later, but it will be better)

PHP话费充值通道网站完整运营源码/全解密无授权/对接免签约支付接口

Cartographer learning record: cartographer Map 3D visualization configuration (self recording dataset version)

Decision tree (hunt, ID3, C4.5, cart)

Unity 可缩放地图的制作

Feature engineering feature dimension reduction

Emlog new navigation source code / with user center
随机推荐
关于串口波特率的的记录
Crmeb/v4.4 Standard Version open version mall source code applet official account h5+app mall source code
[Transformer]AutoFormerV2:Searching the Search Space of Vision Transformer
传说使用Shader的ID来设置Shader属性能提高效率:)
Cartographer learning records: 3D slam part of cartographer source code (I)
Unity map mapping
Database introduction
Check the digital tube with a multimeter
Programming Examples Using RDMA Verbs
无刷电机调试经验与可靠性设计
PCB地线设计_单点接地_底线加粗
QT method for generating QR code pictures
Carbon path first, Huawei digital energy injects new momentum into the green development of Guangxi
What is the KDM of digital movies?
用万用表检测数码管
Unity 高級背包系統
Redis主从复制、哨兵、cluster集群原理+实验(好好等,会晚些,但会更好)
Tips and websites for selecting papers
The 4th small class discussion class on fundamentals of information and communication
芯源cw32f030c8t6用keil5编译时出现的问题