18.9 VRF基础

2.动态路由方式配置VRF

图片[1]-18.9 VRF基础-大赛人网
图18-21 VRF动态方式配置网络拓扑

1)R2配置OSPF

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255

2)R3配置OSPF

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0 
[R3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255

3)R4配置OSPF

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255

4)R5配置OSPF

[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]are
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255 

5)R1配置vpn-instance R1

[R1]ip vpn-instance 1
[R1-vpn-instance-1]ipv4-family
[R1]ip vpn-instance 2
[R1-vpn-instance-2]ipv4-family

6)R1的G0/0/0端口绑定

[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip binding vpn-instance 1
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R1-GigabitEthernet0/0/0]ip address 192.168.2.254 24

7)R1的G0/0/2端口绑定

[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ip binding  vpn-instance 1
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R1-GigabitEthernet0/0/2]ip address 192.168.1.254 24

8)R1的G0/0/1端口绑定

[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip binding vpn-instance 2
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R1-GigabitEthernet0/0/1]ip address 192.168.2.254 24

9)R1的G1/0/0端口绑定

[R1]interface GigabitEthernet 1/0/0
[R1-GigabitEthernet1/0/0]ip binding vpn-instance 2
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[R1-GigabitEthernet1/0/0]ip address 192.168.1.254 24

10)R1配置OSFP

[R1]ospf 1 router-id 1.1.1.1 vpn-instance 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255

[R1]ospf 2 router-id 1.1.1.1 vpn-instance 2     
[R1-ospf-2]area 0
[R1-ospf-2-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[R1-ospf-2-area-0.0.0.0]network 192.168.2.0 0.0.0.255

11)R4连通性测试

<R4>ping 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=30 ms
<R4>ping 3.3.3.3
  PING 3.3.3.3: 56  data bytes, press CTRL_C to break
    Request time out

11)R5连通性测试

[R5]ping 3.3.3.3                        
  PING 3.3.3.3: 56  data bytes, press CTRL_C to break
    Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=40 ms
[R5]ping 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Request time out

1 2

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容