标签交换实验

该博客详细介绍了如何通过配置公网IP、OSPFA和MPLS环境,以及使用BGP建立VPNV4连接,实现不同VRF之间的路由交换和连通性测试。在R2和R4路由器上创建VRF空间并绑定接口,随后启动MPLS上的BGP进程,进行邻居配置和路由重发布,最终完成R1到R7的跨域通信路径设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. 先配公网IP

用ospf将公网打通

 

 

4调成沉默接口

测试公网连通性

7的缺省指向4

测试连通性

  1. 搭建mpls环境

R2

R3

R4

在2上做VRF空间

绑定接口

#

interface GigabitEthernet0/0/0

 ip binding vpn-instance b1

 ip address 192.168.2.2 255.255.255.0

#

#

interface GigabitEthernet0/0/2

 ip binding vpn-instance a1

 ip address 192.168.2.2 255.255.255.0

#

在4上做VRF空间

绑定接口

#

interface GigabitEthernet0/0/1

 ip binding vpn-instance a2

 ip address 192.168.3.1 255.255.255.0

#

interface GigabitEthernet0/0/2

 ip binding vpn-instance b2

 ip address 192.168.3.1 255.255.255.0

#

在mpls上启动bgp

[R2]bgp 1

[R2-bgp]router-id 2.2.2.2

[R2-bgp]peer 4.4.4.4 as-number 1

[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0

[R2-bgp]ipv4-family vpnv4

[R2-bgp-af-vpnv4]peer 4.4.4.4 enable

[R4]bgp 1

[R4-bgp]router-id 4.4.4.4

[R4-bgp]peer 2.2.2.2 as-number 1

[R4-bgp]peer 2.2.2.2 connect-interface LoopBack 0

[R4-bgp]ipv4-family vpnv4

[R4-bgp-af-vpnv4]peer 2.2.2.2 enable

给R1配IP

给R6配IP

给R5配IP

给R7配IP

给R2,6间写rip

R6

R2

给R4,7间写ospf

R7

R4

R4学到了7环回

在R2上进行双向重发布

#

rip 1 vpn-instance a1

 version 2

 network 192.168.2.0

 import-route bgp

#

#

 ipv4-family vpn-instance a1

  import-route rip 1

#

在R4上进行双向重发布

#

ospf 2 vpn-instance a2

 import-route bgp

 area 0.0.0.0

  network 192.168.3.1 0.0.0.0

#

#

 ipv4-family vpn-instance a2

  import-route ospf 2

#

写静态路由

R1

[R1]ip route-static 192.168.3.0 24 192.168.2.2

[R1]ip route-static 192.168.4.0 24 192.168.2.2

R2

[R2]ip route-static vpn-instance b1 192.168.1.0 24 192.168.2.1

#

 ipv4-family vpn-instance b1

  import-route direct

  import-route static

#

R4

[R4]ip route-static vpn-instance b2 192.168.4.0 24 192.168.3.2

#

 ipv4-family vpn-instance b2

  import-route direct

  import-route static

#

R5

[R5]ip route-static 192.168.1.0 24 192.168.3.1

[R5]ip route-static 192.168.2.0 24 192.168.3.1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值