Okay, it works (but new problems showed up).
I did this:
Code:
#!/bin/bash
ip link add rt0 type vrf table 10
ip link add rt1 type vrf table 20
ip link set dev eth0 master rt0
ip link set dev eth1 master rt1
ip link set up rt0
ip link set up rt1
ip route add 37.x.x.65/32 dev eth0 src 37.x.x.84 table 10
ip route add default via 37.x.x.65 dev eth0 table 10
ip rule add from 37.x.x.84/32 table 10
ip rule add to 37.x.x.84/32 table 10
ip route add 37.x.x.65/32 dev eth1 src 37.x.x.85 table 20
ip route add default via 37.x.x.65 dev eth1 table 20
ip rule add from 37.x.x.85/32 table 20
ip rule add to 37.x.x.85/32 table 20
Now I have devs rt0 and rt1.
The problem is the system does not use them.
I can use tools where I can specify the interface.
For example
Sniffing on the host now shows the right MAC for the floating IP.
But the whole system is unsable because all standard tools without the possibility to specify an interface to bind to don't use rt0/rt1.
When I do a
Code:
ip route add default dev rt0
ICMP starts working (TCP doesn't), but I also fear I might skip the virtual routing tables for rt1 when I do this?
I found this post that explains how to start daemons using the virtual routing tables:
https://access.redhat.com/documenta...f-network_configuring-and-managing-networking
I tried with sshd, but it did not work.
Code:
/usr/sbin/ip vrf exec rt0 /usr/sbin/sshd -D
Failed to load BPF prog: 'Operation not permitted'
So status is now:
- floating IPs are available with the correct MACs. I can ping them from the outside.
- system tools have no internet connectivity, because they don't seem to use devices rt0/rt1
- running daemons with /usr/sbin/ip vrf exec fails with error
Getting closer...