Wiki DE Start in the browser

Wiki › Protocols

VRF

Several separate routing tables on one router: two customers with the same addresses over the same device without seeing each other.

Layer
3 (Vermittlung)
See an example
See demo

The idea

A router normally has one routing table. With VRF (virtual routing and forwarding) it gets several, each with its own interfaces and routes. A packet stays in the VRF of the interface it comes in on. This way two customers can both use 10.0.0.0/24 and still run over the same router without seeing each other.

Use

WhereFor
Providerseparating customer networks (in large networks together with MPLS)
Data centreseparating tenants
Companyseparating the management network from the production networks

Setting up

Router(config)# vrf definition CUSTOMER-A
Router(config)# interface eth2
Router(config-if)# vrf forwarding CUSTOMER-A
Router(config-if)# ip address 10.0.0.1/24
Router(config)# ip route vrf CUSTOMER-A 0.0.0.0/0 10.9.0.2
Router# show ip route vrf CUSTOMER-A
Router# ping vrf CUSTOMER-A 10.0.0.10

First vrf forwarding, then the address: only inside the VRF may the same network appear a second time. In leyoNET, OSPF, RIP, BGP, NAT and automatic routing only apply to the global table.

How to do it in leyoNET

The same text as in the app’s help (F1 key).

VRF

VRF (virtual routing and forwarding) gives a router several separate routing tables. Typical at a provider: customer A and customer B both use 10.0.0.0/24, run through the same router and still never see each other.

  • Every port (also subinterface, VLAN interface, loopback) belongs to the global table or to a VRF.
  • A packet stays in the VRF of the port it arrives on. Replies of the router (ping) go back into the same VRF.
  • Each VRF has its directly connected networks and its own static routes. OSPF, RIP, BGP, NAT and automatic routing only work in the global table.

In the form: tab VRF. Command line:

  • vrf definition CUSTOMER-A
  • on the interface vrf forwarding CUSTOMER-A
  • ip route vrf CUSTOMER-A 0.0.0.0/0 10.1.1.2
  • show vrf, show ip route vrf CUSTOMER-A, ping vrf CUSTOMER-A 10.9.0.10

See an example

  • Demo “VRF: two customers, same addresses” in leyoNETDemo “VRF: two customers, same addresses” in leyoNET
    VRF: two customers, same addresses

    A provider router separates two customers with VRFs. Both use 10.0.0.0/24 and 10.9.0.0/24 and still never see each other.

    Both PCs open http://10.9.0.10/, the same address. Customer A gets the page of its server, customer B its own. Filter «http».

    Watch live Project file

“Watch live” opens the network in leyoNET, the simulation runs in a loop. In the app you find it under File → Demo networks, with a step-by-step tour.

Practise

  • ★★★★☆ VRF: two customers with the same networks · 3 goals · Worksheet (German)

In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.

Read on

Found a mistake or have an idea? Source of this page on GitHub.