扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
在本页阅读全文(共2页)
接下来我们要做的就是为每一个接口配备一份VRF:
interface FastEthernet0/0.1
encapsulation dot1Q 201
ip vrf forwarding POD1
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 202
ip vrf forwarding POD2
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 203
ip vrf forwarding POD3
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.4
encapsulation dot1Q 204
ip vrf forwarding POD4
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.5
encapsulation dot1Q 205
ip vrf forwarding POD5
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.6
encapsulation dot1Q 206
ip vrf forwarding POD6
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.7
encapsulation dot1Q 207
ip vrf forwarding POD7
ip address 192.168.1.1 255.255.255.0
!
interface FastEthernet0/0.8
encapsulation dot1Q 208
ip vrf forwarding POD8
ip address 192.168.1.1 255.255.255.0
!
!
interface FastEthernet0/1.1
encapsulation dot1Q 211
ip vrf forwarding POD1
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
!
interface FastEthernet0/1.2
encapsulation dot1Q 212
ip vrf forwarding POD2
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
!
interface FastEthernet0/1.3
encapsulation dot1Q 213
ip vrf forwarding POD3
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
!
interface FastEthernet0/1.4
encapsulation dot1Q 214
ip vrf forwarding POD4
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
!
interface FastEthernet0/1.5
encapsulation dot1Q 215
ip vrf forwarding POD5
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
!
interface FastEthernet0/1.6
encapsulation dot1Q 216
ip vrf forwarding POD6
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
!
interface FastEthernet0/1.7
encapsulation dot1Q 217
ip vrf forwarding POD7
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
!
interface FastEthernet0/1.8
encapsulation dot1Q 218
ip vrf forwarding POD8
ip address 172.26.26.53 255.255.255.0 secondary
ip address 172.26.26.1 255.255.255.0
为了确保路由现在都是独立的,我们可以选择从VRF的角度查看路由表。
首先就是第一部分:
BBR#show ip route vrf POD1
Routing Table: POD1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.26.0.0/24 is subnetted, 1 subnets
C 172.26.26.0 is directly connected, FastEthernet0/1.1
10.0.0.0/24 is subnetted, 2 subnets
S 10.0.1.0 [1/0] via 192.168.1.2
C 10.0.100.0 is directly connected, Loopback201
C 192.168.1.0/24 is directly connected, FastEthernet0/0.1
BBR#
为了确认到每个接口对应的VRF都是什么,我们现在可以利用show ip vrf brief命令来获取相关信息。
BBR#sh ip vrf brief
Name Default RD Interfaces
POD1 1:1 Lo201
Fa0/0.1
Fa0/1.1
POD2 2:2 Lo202
Fa0/0.2
Fa0/1.2
POD3 3:3 Lo203
Fa0/0.3
Fa0/1.3
POD4 4:4 Lo204
Fa0/0.4
Fa0/1.4
POD5 5:5 Lo205
Fa0/0.5
Fa0/1.5
POD6 6:6 Lo206
Fa0/0.6
Fa0/1.6
POD7 7:7 Lo207
Fa0/0.7
Fa0/1.7
POD8 8:8 Lo208
Fa0/0.8
Fa0/1.8
BBR#
当然,还有很多其它命令可以用来验证VRF;但正如我们所看到的,只有这样才能将路由器用VRF分拆为八个部分。在以后的文章中,我还将会对如何利用VRF对IP安全协议进行相同步骤的设置进行介绍。
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者