Skip to contentSkip to conversation

VRF and PBR question

DISCUSSION Pavel Balaev 1 participant 1 message Aug 3, 2017

lore
Share & tools
lore
#0 lore raw

Hi all.

I've got network:

+------+        +----------------+
| isp1 |<------>|eth0            |
+------+        |                |       +--------------------+ 
                |           eth2 |<----->|  LAN:10.10.2.0/24  |
+------+        |                |       +--------------------+
| isp2 |<------>|eth1            |
+------+        +----------------+

Interfaces eth0,eth1 and eth2 are enslaved in VRF:

# ip link add vrf0 type vrf table 10
# ip link set dev vfr0 up
# ip link set dev eth0 master vrf0
# ip link set dev eth1 master vrf0
# ip link set dev eth2 master vrf0

I need to route some clients via ips1 and others via isp2. So and I got two rules:

# ip rule add from 10.10.2.2 table isp1
# ip rule add from 10.10.2.3 table isp2

But I cannot add route to tables isp1 and isp2 because there are no link-local routes in main table, they are inside vrf:

# ip r show vrf vrf0:
10.10.0.0/24 dev eth0 ....

So when I tries to add route I got error:

# ip r add 10.100.0.0/24 via 10.10.0.2 table isp1
RTNETLINK answers: Network in unreachable.

How can I use source routing inside VRF?