cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
15524
Views
8
Helpful
8
Replies

How to communicate between VRF table and global routing table in a single router

Vaibhav Vishnoi
Level 1
Level 1

Hello,

We need to know that what would be the procedure to have the VRF table and global routing table communicating with each other in a single router. Earlier we were using 2 different routers for this purpose, but now 1 router has to be eliminated.

There is no BGP involved for this.

2 Accepted Solutions

Accepted Solutions

Laurent Aubert
Cisco Employee
Cisco Employee

Hi,

You could use static routes:

- Use the global keyword for the one in the VRF

- Specified both the interface and the NH for the one in the GRT.

It doesn't really scale so should be consider for exception only.

Another well known trick is to use an external cable connected to the same router. One port belong to the VRF and the other one to the GRT. You can then use regular static routing or an IGP like OSPF which uses a different process per VRF.

It's actually the same thing than using two routers as the idea is still to send the traffic out to receive it on another interface.

HTH

Laurent.

View solution in original post

Vaibhav,

I do not want to jump into Laurent's thread of answering but as you seem to be in some sort of hurry I'll provide the example for you. The credit, however, belongs to Laurent.

ip vrf Example

rd 1:1

route-target 1:1

interface FastEthernet0/0

description Interface in a VRF

ip vrf forwarding Example

ip address 192.0.2.1 255.255.255.0

no shutdown

interface FastEthernet0/1

description Interface in a global table

ip address 199.99.9.1 255.255.255.0

! This command adds a route into the VRF

! that points to a route reachable via the global table

ip route vrf Example 223.255.255.0 255.255.255.0 199.99.9.2 global

! This command adds a route into the global table

! that points to a route reachable in the VRF Example

ip route 126.0.0.0 255.0.0.0 FastEthernet0/0 192.0.2.2

This way, there is a route added to the VRF Example pointing to the network 223.255.255.0/24 via the next hop 199.99.9.2 (somewhere behind the Fa0/1 interface). Also, another route to 126.0.0.0/8 is added to the global routing table which is reachable via the next hop 199.0.2.2 somewhere behind the Fa0/0 interface in the VRF Example.

Best regards,

Peter

Best regards.

Peter

View solution in original post

8 Replies 8

Laurent Aubert
Cisco Employee
Cisco Employee

Hi,

You could use static routes:

- Use the global keyword for the one in the VRF

- Specified both the interface and the NH for the one in the GRT.

It doesn't really scale so should be consider for exception only.

Another well known trick is to use an external cable connected to the same router. One port belong to the VRF and the other one to the GRT. You can then use regular static routing or an IGP like OSPF which uses a different process per VRF.

It's actually the same thing than using two routers as the idea is still to send the traffic out to receive it on another interface.

HTH

Laurent.

Hello,

ANYONE can please help with config lines?

Vaibhav,

I do not want to jump into Laurent's thread of answering but as you seem to be in some sort of hurry I'll provide the example for you. The credit, however, belongs to Laurent.

ip vrf Example

rd 1:1

route-target 1:1

interface FastEthernet0/0

description Interface in a VRF

ip vrf forwarding Example

ip address 192.0.2.1 255.255.255.0

no shutdown

interface FastEthernet0/1

description Interface in a global table

ip address 199.99.9.1 255.255.255.0

! This command adds a route into the VRF

! that points to a route reachable via the global table

ip route vrf Example 223.255.255.0 255.255.255.0 199.99.9.2 global

! This command adds a route into the global table

! that points to a route reachable in the VRF Example

ip route 126.0.0.0 255.0.0.0 FastEthernet0/0 192.0.2.2

This way, there is a route added to the VRF Example pointing to the network 223.255.255.0/24 via the next hop 199.99.9.2 (somewhere behind the Fa0/1 interface). Also, another route to 126.0.0.0/8 is added to the global routing table which is reachable via the next hop 199.0.2.2 somewhere behind the Fa0/0 interface in the VRF Example.

Best regards,

Peter

Best regards.

Peter

Thank you Peter, thanks for your post

i have another case related to IPv6 

 

R7---------(vrf CE7)--R9

 

R7 is CE

R9 is PE and use vrf CE7 toward R7 

 

i am trying to ping from R7 to R9 loopback (where loopback is resided in global routing table), i am trying to use ipv6 route nexthop-vrf default, but i am not sure what is value of nexthpp ip address?

Vaibhav Vishnoi
Level 1
Level 1

Thanks Laurent

Can you please elaborate the use of global keyword (config). That would really help.

You can Use BGP for it as well..must check

http://blog.ipexpert.com/2010/12/01/vrf-route-leaking/

HI,

The global keyword basically specifies to look into global routing table for the nexthop configured as part of static route.

ip route vrf test 10.0.0.0 255.0.0.0 192.168.1.1  global

As per above config, to reach 10.x.x.x netwrok from VRF test, it needs to look into global table for 192.168.1.1 as nexthop.

HTH,

Nagendra