VRF configuration

Hi to all! Can anybody explain, or give an example of vrf configuration. I have 2 routers different locations, interconnected between with an OVPN tunnel. Each router has it’s own gateway. On R1 I have 2 LAN’s one private, and second public IP’s. so I need that second (public) LAN be reachable and goes to internet only via R2 (ovpn), BUT, first lan, with private IP’s goes through R1’s default gateway!
Thanks!

And why do you need VRF?
Who advertises the public network? If it’s not you and it’s the ISP doing it on your behalf, your options are limited. I’m a bit puzzled what you’re trying to achieve. Could you prepare a small drawing and elaborate a little bit…

Do you want this network routed, or as a layer2?

You can just add the routes - regardless of default gw.

vrf is “quite” simple - but you need to do a lot of configurations. And i would not recomand use this, unless you have to. I use it some - using rfc1918 addresses for managment and config- but running MPLS with ospf in main routing table - and running bgp with confederation for vrf on top of this.

Edit . you might want to use a firewallrule to set another gw for your lan.

VRF is very common in ISP and Data Center networks. Some common uses are:

  1. Separate public IPs from private management
  2. Allow overlap of private IPs for customer networks
  3. Create security zones with firewalls in between for routing between VRFs

Thanks to all for ideas, I solved this marking new route, and adding default gateway for route mark!