Is it possible to set up static routes for aliasses with subnets?



  • Hello,

    i've created 2 lists:

    • whitedomains
    • whitenets

    whitedomains consists of single IP addresses per line. and it works fine with "Static Routes"
    and whitenets looks like that:

    54.92.128.0/17
    54.93.0.0/16
    54.94.0.0/16
    54.95.0.0/16
    64.233.160.0/18
    66.102.0.0/20
    66.249.64.0/19
    67.202.0.0/18
    70.132.0.0/18
    71.152.0.0/17

    is it possible to create Static Routes for subnets?



  • looks like not.

    one of solution - sh script on every route changes in web GUI



  • @mrpsycho:

    Hello,

    i've created 2 lists:

    • whitedomains
    • whitenets

    whitedomains consists of single IP addresses per line. and it works fine with "Static Routes"
    and whitenets looks like that:

    is it possible to create Static Routes for subnets?

    Yes, when creating a static route, put the alias name in the Destination Network field.  This works for both host lists and network lists.  Downside is that if the alias name is changed, although pfSense will update other tables with the new name, it will not update the static routes entries, you'll have to update the name change in the static route entry manually.  Also if your host list has domain names that round-robbin, your route table will not be updated each time the DNS record is refreshed.  Best to use only fixed IP's in host list if using for static routes.

    As an added note, you can include single IP address in a network alias list by using /32 mask. (host list just assumes all entries are /32 mask).  This would allow you to only have to maintain one list and one static route entry associated to that list.