I created a custom routing table (num: "22" name: "table_name") in /etc/iproute2/rt_tables.
root@192.168.1.1:~# cat /etc/iproute2/rt_tables
#
# reserved values
#
128 prelocal
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
22 table_name
I trying to set a default route for this table. If I execute the following commands, it fixes my routing issue:
ip route add <ip_address> dev <if_name> table <table_name>
ip route add default via <ip_address> table <table_name>
ip route flush cache
However, this "fix" reverts on boot, so I'd like to make it survive the next boot.
How do I setup the default route for an interface in the custom table, replicating the ip commands above, using uci commands?
I see in the pbr_extras there is a set network.default'${IPV%4}' command, but I'm not sure how to use it and can't find any references online. Also, it probably requires pbr to be installed.
Than you in advance.