2 pieces defaultrouter

Hello.
My system FreeBSD 12.0-RELEASE amd64.
How do I set up my defaultrouter for network aliases?
now.
Code:
netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            1.1.1.1       UGS        igb0
1.1.1.0/24    link#1             U          igb0
1.1.1.1     link#1             UHS         lo0
127.0.0.1          link#3             UH          lo0

Code:
ifconfig_igb0="inet 1.1.1.10 netmask 255.255.255.0"
ifconfig_igb0_alias0="inet 1.1.2.9 netmask 255.255.255.0"
ifconfig_igb0_alias1="inet 1.1.2.4 netmask 255.255.255.0"
defaultrouter="1.1.1.1"
For aliases(alias0-alias1), another defaultrouter="1.1.2.1" is needed.
How do I do better?
 
AFAIK you are not able to specify multiple default routes (at the end it is the one location where you send packets you can not route better), but you may have some luck with multiple routing tables, setfib(1) and multiple routing tables support in some programs, for example see nginx setfib directive.
 
Back
Top