产品
产品中心
< 返回主菜单
产品

交换机

交换机所有产品
< 返回产品
交换机
查看交换机首页 >

无线

无线所有产品
< 返回产品
无线
查看无线首页 >

云桌面

云桌面产品方案中心
< 返回产品
云桌面
查看云桌面首页 >

安全

安全所有产品
< 返回产品
安全
查看安全首页 >
产品中心首页 >
行业
行业中心
< 返回主菜单
行业
行业中心首页 >

【RSR】RSR如何VRF下添加静态路由

发布时间:2013-09-11
点击量:4496

功能介绍:

静态路由就是手工配置的路由,使得数据包能够按照预定的路径传送到指定的目标网络。当不能通过动态路由协议学到一些目标网络的路由时,配置静态路由就会显得十分重要。

一、组网需求

     路由器R1的F0/0、F0/1接口在vrf abc下,路由器R2为普通全局路由器, 如下网络,需要实现全网互通。

二、组网拓扑

    

三、配置要点

1、在R1上配置vrf abc

2、基本ip地址配置

3、在R1上将对应的接口划入vrf

4、配置静态路由

四、配置步骤

1、在R1上配置vrf abc

注意:

vrf 是本地有效的,在本端起了vrf,只是本路由器上相同vrf下的接口互通,不同vrf的接口逻辑隔离,与对端路由器是否起vrf无关

Ruijie(config)#hostname R1

R1(config)#ip vrf abc     //在路由器上启用vrf abc

R1(config-vrf)#exit

2、基本ip地址配置

R1(config)#interface fastEthernet 0/2

R1(config-if-FastEthernet 0/2)#ip address 192.168.1.1 255.255.255.0

R1(config-if-FastEthernet 0/2)#exit

R1(config)#interface fastEthernet 0/0

R1(config-if-FastEthernet 0/0)#ip address 10.1.1.1 255.255.255.0

R1(config-if-FastEthernet 0/0)#exit

 

Ruijie(config)#hostname R2

R2(config)#interface fastEthernet 0/0

R2(config-if-FastEthernet 0/0)#ip address 192.168.1.2 255.255.255.0

R2(config-if-FastEthernet 0/0)#exit

R2(config)#interface fastEthernet 0/1

R2(config-if-FastEthernet 0/1)#ip address 10.2.1.1 255.255.255.0

R2(config-if-FastEthernet 0/1)#exit

3、在R1上将对应的接口划入vrf

注意:

将接口划入到vrf时,若该接口有配置ip地址,会将ip地址移除,需要重新配置该接口的ip地址。

R1(config)#interface fastEthernet 0/2

R1(config-if-FastEthernet 0/2)#ip vrf forwarding abc    //配置vrf abc

% Interface FastEthernet 0/2 IP address 192.168.1.1 removed due to enabling VRF abc

R1(config-if-FastEthernet 0/2)#ip address 192.168.1.1 255.255.255.0       //重新配置F0/2接口的ip地址

R1(config-if-FastEthernet 0/2)#exit

R1(config)#interface fastEthernet 0/0

R1(config-if-FastEthernet 0/0)#ip vrf forwarding abc   //将接口划入vrf abc

% Interface FastEthernet 0/0 IP address 10.1.1.1 removed due to enabling VRF abc

R1(config-if-FastEthernet 0/0)#ip address 10.1.1.1 255.255.255.0   //重新配置接口的ip地址

R1(config-if-FastEthernet 0/0)#exit

4、配置静态路由

注意:

vrf下的静态路由配置,只是配置命令多了vrf abc,配置vrf下的静态路由注意事项与配置普通静态路由一致,请参考静态路由配置的相关章节。

R1(config)#ip route vrf abc 10.2.1.0 255.255.255.0 192.168.1.2         //配置vrf abc下的静态路由

R2(config)#ip route 10.1.1.0 255.255.255.0 192.168.1.1        //R2上未启用vrf,配置普通的静态路由

 

五、配置验证

1、在内网电脑上ping对端内网的地址,若能ping通,代表vrf下的静态路由配置正确。

ping的命令“开始菜单”-----“运行”------敲入cmd-----ping x.x.x.x   (x.x.x.x是对端内网的地址)

2、使用命令 show ip route vrf abc查看vrf下的路由

R1#show ip route vrf abc 

Routing Table: abc

 

Codes:  C - connected, S - static, R - RIP, B - BGP

        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

 

Gateway of last resort is no set

C    10.1.1.0/24 is directly connected, FastEthernet 0/0

C    10.1.1.1/32 is local host.

S    10.2.1.0/24 [1/0] via 192.168.1.2

C    192.168.1.0/24 is directly connected, FastEthernet 0/2

C    192.168.1.1/32 is local host.

 

 

相关产品

返回顶部

请选择服务项目
关闭咨询页
售前咨询 售前咨询
售前咨询
售后服务 售后服务
售后服务
意见反馈 意见反馈
意见反馈
更多联系方式