RT_Tables and VRF simulation inside host
I use software to simulate routers, that software creates two interfaces in system for each of two interfaces of the router.
That interfaces are routed interfaces via which i can communicate with simulated router.
Lets call that interfaces:
netio0 - linux ip address 172.16.10.1, router: 172.16.10.10
netio1 - linux ip address 172.16.11.1, router: 172.16.11.10
i wanted to send packet thru that router, but normally of course when i send packet from 172.16.10.1 to 172.16.11.1 it would never be send via any of interfaces because these are locally configured interfaces (or the response problem even for static routing entries) So i used:
echo 1 VRF1 >> /etc/iproute2/rt_tables
echo 2 VRF2 >> /etc/iproute2/rt_tables
ip route add default via 172.16.10.10 dev netio0 table VRF1
ip route add default via 172.16.11.10 dev netio1 table VRF2
And created rules which for the traffic from one side to another use specific RT_Table:
ip rule add from 172.16.10.0/24 table VRF1
ip rule add from 172.16.11.0/24 table VRF2
And it works, but only partially.
Traffic from 172.16.10.1 to 172.16.11.10 (other interface of router) works fine.
Traffic from 172.16.10.1 to 172.16.11.1 is sent through router and i can sniff it on other side (netio1), but linux system never respond to that traffic.
It looks like linux kernel limitation to me: it will discard the packet from one of it's interfaces to another.
Could you confirm ?
Do you have any way to simulate VRFs on Linux ? I need independent routing tables which are really separated (like on cisco/juniper routers which are based on ...linux).