haproxytech / vmware-haproxy

Apache License 2.0
51 stars 24 forks source link

A route rule is added for each line in route-tables.cfg #11

Closed brakthehack closed 3 years ago

brakthehack commented 3 years ago

We observed that route rules are added for each route in /etc/vmware/route-tables.cfg. See below:

root@haproxy [ ~ ]# ip rule show
0:  from all lookup local
32762:  from 172.16.10.2/24 lookup rtctl_frontend
32763:  from 172.16.10.2/24 lookup rtctl_frontend
32764:  from 192.168.1.2/16 lookup rtctl_workload
32765:  from 192.168.1.2/16 lookup rtctl_workload
32766:  from all lookup main
32767:  from all lookup default
root@haproxy [ ~ ]# cat /etc/vmware/
anyip-routes.cfg  route-tables.cfg
root@haproxy [ ~ ]# cat /etc/vmware/route-tables.cfg
...
2,workload,00:50:56:b8:10:00,192.168.1.2/16,192.168.1.1
2,workload,00:50:56:b8:10:00,192.168.1.2/16
3,frontend,00:50:56:b8:48:f1,172.16.10.2/24,172.16.10.1
3,frontend,00:50:56:b8:48:f1,172.16.10.2/24

Instead we should see only a single lookup for each network for each route table, which means it should look something like this:

root@haproxy [ ~ ]# ip rule show
0:  from all lookup local
32764:  from 172.16.10.2/24 lookup rtctl_frontend
32765:  from 192.168.1.2/16 lookup rtctl_workload
32766:  from all lookup main
32767:  from all lookup default

There's no harm with this bug per se, but it may be confusing to users.