标签:要求 rip remote 接口 转发 原理 地址 via 访问
1、实验拓扑在查找LFIB表 走4.4.4.4出去,欺骗了R2和R3,最后在R4弹出标签,到6.6.6.6
e、查看入出标签情况
Router#sh mpls ip binding
1.1.1.0/24
in label: imp-null
out label: 200 lsr: 2.2.2.2:0
2.2.2.0/24
in label: 100
out label: imp-null lsr: 2.2.2.2:0 inuse
3.3.3.0/24
in label: 101
out label: 203 lsr: 2.2.2.2:0 inuse
4.4.4.0/24
in label: 102
out label: 201 lsr: 2.2.2.2:0 inuse
12.12.12.0/24
in label: imp-null
out label: imp-null lsr: 2.2.2.2:0
15.15.15.0/24
in label: imp-null
23.23.23.0/24
in label: 103
out label: imp-null lsr: 2.2.2.2:0 inuse
34.34.34.0/24
in label: 104
out label: 202 lsr: 2.2.2.2:0 inuse
通过标签可以看到:label 201是mpls分配给igp路由4.4.4.0的。
5、配置:
R1:
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Ethernet0/0
ip address 12.12.12.1 255.255.255.0
mpls ip
!
interface Ethernet0/1
ip address 15.15.15.1 255.255.255.0
router eigrp 100
network 1.1.1.0 0.0.0.255
network 12.12.12.0 0.0.0.255
!
router bgp 100
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
neighbor 4.4.4.4 remote-as 100
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 15.15.15.5 remote-as 200
R2:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Ethernet0/0
ip address 12.12.12.2 255.255.255.0
mpls ip
!
interface Ethernet0/1
ip address 23.23.23.2 255.255.255.0
mpls ip
router eigrp 100
network 2.2.2.0 0.0.0.255
network 12.12.12.0 0.0.0.255
network 23.23.23.0 0.0.0.255
R3:
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Ethernet0/0
ip address 23.23.23.3 255.255.255.0
mpls ip
!
interface Ethernet0/1
ip address 34.34.34.3 255.255.255.0
mpls ip
router eigrp 100
network 3.3.3.0 0.0.0.255
network 23.23.23.0 0.0.0.255
network 34.34.34.0 0.0.0.255
R4:
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Ethernet0/0
ip address 34.34.34.4 255.255.255.0
mpls ip
!
interface Ethernet0/1
ip address 46.46.46.4 255.255.255.0
!
router eigrp 100
network 4.4.4.0 0.0.0.255
network 34.34.34.0 0.0.0.255
!
router bgp 100
bgp router-id 4.4.4.4
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 46.46.46.6 remote-as 300
R5:
!
interface Loopback0
ip address 5.5.5.5 255.255.255.0
!
interface Ethernet0/0
ip address 15.15.15.5 255.255.255.0
!
router bgp 200
bgp router-id 5.5.5.5
bgp log-neighbor-changes
network 5.5.5.0 mask 255.255.255.0
neighbor 15.15.15.1 remote-as 100
!
R6:
interface Loopback0
ip address 6.6.6.6 255.255.255.0
!
interface Ethernet0/0
ip address 46.46.46.6 255.255.255.0
!
router bgp 300
bgp router-id 6.6.6.6
bgp log-neighbor-changes
network 6.6.6.0 mask 255.255.255.0
neighbor 46.46.46.4 remote-as 100
最后我们可以总结出:在mpls网络中,mpls会给igp路由分配label,cef会给采用mpls分配好的label并且给下一跳是该igp的bgp路由分配该igp的label,数据在转发的时候是按照cef表进行的,这样那些没有在mpls中分配标签的bgp路由也可以按照标签进行转发。
6、相关配置命令详解
1、启用CEF
2、指定使用的标签分发协议 (可选)
3、MPLS LDP router-id lo0 fo强制更改 (可选)
4、MPLS label range 200 299 (可选)
5、运行LDP
6、修改MTU值 (可选)
查询命令:
show mpls interfaces //查看启用MPLS的接口
show mpls ldp neighbor //查看LDP的邻居表
show mpls ldp bindings //查看LIB表
show mpls forwarding-table //查看标签转发表LFIB
show mpls ip binding //可以直接看到一条路由的入标签和出标签
show ip cef //查看FIB表
show mpls ldp discovery detail //可看到transport-address
基本命令:
rouer(config)#ip cef
rouer(config)#int s0/0
rouer(config-if)#mpls ip //在接口下启用MPLS
可选命令:
rouer(config)#mpls label protocol ldp //指定使用LDP
rouer(config)#mpls ldp router-id lo0 //指定lo0为router-id
rouer(config)#mpls label range 200 299 //指定路由器分配标签的范围,需要重新建立TCP连接
rouer(config-if)#mpls ldp discovery transport-address interface //指定自已的transport-address
标签:要求 rip remote 接口 转发 原理 地址 via 访问
原文地址:https://blog.51cto.com/aluna/2477559