MPLS基础
本实验模拟BGP路由黑洞环境,使用MPLS LDP解决路由黑洞。 完成以下需求: 1.设备IP地址已配置,请测试直连。 2.AS200内配置OSPF,进程1,RID手动设置为Lo0地址,区域0,network通告接口使用通配符0.0.0.0 不宣告与其他AS互联接口。 3.建立BGP邻居关系 3.1 R2/4使用Lo0建立ibgp邻居。 3.2 R1/2,R4/5分别使用物理口建立ebgp邻居。 3.3 R1宣告1.1.1.1/32,R5宣告5.5.5.5/32,起源属性为“i”。 4.配置MPLS LDP AS200为MPLS域,在R2/3/4上配置LDP。 4.1 LSR-ID为Lo0地址。 4.2 R2/3,R3/4分别建立LDP邻居关系,并自动分发标签。 4.3 R2/4上配置以下命令,使得BGP路由可以“借用”下一跳地址的标签。 route recursive-lookup tunnel 4.4 测试1.1.1.1访问5.5.5.5,并查看R2/3/4的LSP。 display mpls lsp
R1配置
router id 1.1.1.1 interface GigabitEthernet0/0/0 ip address 12.1.1.1 255.255.255.0 interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # bgp 100 peer 12.1.1.2 as-number 200 # ipv4-family unicast undo synchronization network 1.1.1.1 255.255.255.255 peer 12.1.1.2 enable
R2配置
router id 2.2.2.2 mpls lsr-id 2.2.2.2 mpls # mpls ldp # interface GigabitEthernet0/0/0 ip address 12.1.1.2 255.255.255.0 # interface GigabitEthernet0/0/1 ip address 23.1.1.2 255.255.255.0 mpls mpls ldp interface LoopBack0 ip address 2.2.2.2 255.255.255.255 # bgp 200 peer 4.4.4.4 as-number 200 peer 4.4.4.4 connect-interface LoopBack0 peer 12.1.1.1 as-number 100 # ipv4-family unicast undo synchronization peer 4.4.4.4 enable peer 4.4.4.4 next-hop-local peer 12.1.1.1 enable # ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 23.1.1.2 0.0.0.0 # route recursive-lookup tunnel
R3配置
router id 3.3.3.3 mpls lsr-id 3.3.3.3 mpls # mpls ldp interface GigabitEthernet0/0/0 ip address 23.1.1.3 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip address 34.1.1.3 255.255.255.0 mpls mpls ldp interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 23.1.1.3 0.0.0.0 network 34.1.1.3 0.0.0.0
R4配置
router id 4.4.4.4 mpls lsr-id 4.4.4.4 mpls # mpls ldp interface GigabitEthernet0/0/0 ip address 34.1.1.4 255.255.255.0 mpls mpls ldp # interface GigabitEthernet0/0/1 ip address 45.1.1.4 255.255.255.0 interface LoopBack0 ip address 4.4.4.4 255.255.255.255 # bgp 200 peer 2.2.2.2 as-number 200 peer 2.2.2.2 connect-interface LoopBack0 peer 45.1.1.5 as-number 300 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 2.2.2.2 next-hop-local peer 45.1.1.5 enable # ospf 1 router-id 4.4.4.4 area 0.0.0.0 network 4.4.4.4 0.0.0.0 network 34.1.1.4 0.0.0.0 # route recursive-lookup tunnel
R5配置
router id 5.5.5.5 interface GigabitEthernet0/0/0 ip address 45.1.1.5 255.255.255.0 interface LoopBack0 ip address 5.5.5.5 255.255.255.255 # bgp 300 peer 45.1.1.4 as-number 200 # ipv4-family unicast undo synchronization network 5.5.5.0 255.255.255.0 network 5.5.5.5 255.255.255.255 peer 45.1.1.4 enable
测试
<R1>ping -a 1.1.1.1 5.5.5.5 PING 5.5.5.5: 56 data bytes, press CTRL_C to break Reply from 5.5.5.5: bytes=56 Sequence=1 ttl=252 time=60 ms Reply from 5.5.5.5: bytes=56 Sequence=2 ttl=252 time=40 ms Reply from 5.5.5.5: bytes=56 Sequence=3 ttl=252 time=50 ms Reply from 5.5.5.5: bytes=56 Sequence=4 ttl=252 time=30 ms Reply from 5.5.5.5: bytes=56 Sequence=5 ttl=252 time=50 ms --- 5.5.5.5 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/46/60 ms