用 MPLS 解决 BGP中 路由黑洞的配置

该配置案例展示了如何通过MPLS协议在路由器R1、R2、R3和R4上设置,以实现PC1和PC2之间的通信。配置包括了各路由器的LSR-ID、MPLS、LDP以及BGP和OSPF的设置,确保了网络间的路由可达性。
摘要由CSDN通过智能技术生成

1.网络拓扑图
在这里插入图片描述

2.网络需求
MPLS协议实现PC1和PC2互通。

3.配置
3.1、R1的配置
display current-configuration

sysname R1

mpls lsr-id 1.1.1.1
mpls

mpls ldp

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http

firewall zone Local
priority 16

interface Ethernet0/0/0

interface Ethernet0/0/1

interface Serial0/0/0
link-protocol ppp

interface Serial0/0/1
link-protocol ppp

interface Serial0/0/2
link-protocol ppp

interface Serial0/0/3
link-protocol ppp

interface GigabitEthernet0/0/0
ip address 192.168.12.1 255.255.255.0
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3

wlan

interface NULL0

interface LoopBack0
ip address 1.1.1.1 255.255.255.0

bgp 100
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack0

ipv4-family unicast
undo synchronization
network 192.168.1.0
peer 4.4.4.4 enable

ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.12.0 0.0.0.255
network 1.1.1.0 0.0.0.255

user-interface con 0
user-interface vty 0 4
user-interface vty 16 20

return
3.2、R2的配置
display current-configuration

sysname R2

mpls lsr-id 2.2.2.2
mpls

mpls ldp

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http

firewall zone Local
priority 16

interface Ethernet0/0/0

interface Ethernet0/0/1

interface Serial0/0/0
link-protocol ppp

interface Serial0/0/1
link-protocol ppp

interface Serial0/0/2
link-protocol ppp

interface Serial0/0/3
link-protocol ppp

interface GigabitEthernet0/0/0
ip address 192.168.12.2 255.255.255.0
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.23.2 255.255.255.0
mpls
mpls ldp

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3

wlan

interface NULL0

interface LoopBack0
ip address 2.2.2.2 255.255.255.0

ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 192.168.12.0 0.0.0.255
network 192.168.23.0 0.0.0.255
network 2.2.2.0 0.0.0.255

user-interface con 0
user-interface vty 0 4
user-interface vty 16 20

return
3.3、R3的配置
display current-configuration

sysname R3

mpls lsr-id 3.3.3.3
mpls

mpls ldp

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http

firewall zone Local
priority 16

interface Ethernet0/0/0

interface Ethernet0/0/1

interface Serial0/0/0
link-protocol ppp

interface Serial0/0/1
link-protocol ppp

interface Serial0/0/2
link-protocol ppp

interface Serial0/0/3
link-protocol ppp

interface GigabitEthernet0/0/0
ip address 192.168.23.3 255.255.255.0
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.34.3 255.255.255.0
mpls
mpls ldp

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3

wlan

interface NULL0

interface LoopBack0
ip address 3.3.3.3 255.255.255.0

ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 192.168.23.0 0.0.0.255
network 192.168.34.0 0.0.0.255
network 3.3.3.0 0.0.0.255

user-interface con 0
user-interface vty 0 4
user-interface vty 16 20

return
3.4、R4的配置
display current-configuration

sysname R4

mpls lsr-id 4.4.4.4
mpls

mpls ldp

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
local-user admin service-type http

firewall zone Local
priority 16

interface Ethernet0/0/0

interface Ethernet0/0/1

interface Serial0/0/0
link-protocol ppp

interface Serial0/0/1
link-protocol ppp

interface Serial0/0/2
link-protocol ppp

interface Serial0/0/3
link-protocol ppp

interface GigabitEthernet0/0/0
ip address 192.168.34.4 255.255.255.0
mpls
mpls ldp

interface GigabitEthernet0/0/1
ip address 192.168.2.1 255.255.255.0

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3

wlan

interface NULL0

interface Logic-Channel0

interface LoopBack0
ip address 4.4.4.4 255.255.255.0

bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0

ipv4-family unicast
undo synchronization
network 192.168.2.0
peer 1.1.1.1 enable

ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 192.168.34.0 0.0.0.255
network 4.4.4.0 0.0.0.255

user-interface con 0
user-interface vty 0 4
user-interface vty 16 20

return

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值