OPNsense Forum

English Forums => 24.7, 24.10 Legacy Series => Topic started by: fathibn on January 21, 2025, 04:57:38 PM

Title: Static route by ASN
Post by: fathibn on January 21, 2025, 04:57:38 PM
Hi,
I have twwo internet connections to two different ISPs and would like to direct outgoing traffic to some ASN (mainly facebook, instagram, ...) to go through a given one of them.
I added an alias to the desired destination facebook_Meta_asn_32934_n_63293 and would like to add a static route to that ASN, so non production traffic goes through a given ISP.
Couldn't find how to do it.
Could someone help me please ?
TIA.
Fathi B.N.
Title: Re: Static route by ASN
Post by: Seimus on January 21, 2025, 05:26:12 PM
Did you try using PBR?

As per my knowledge Static routes do not allow Alias as object for destination.

FW rule with destination of the ASN Alias and pointing to a specific GW?
https://docs.opnsense.org/manual/aliases.html#bgp-asn
https://docs.opnsense.org/manual/firewall.html#policy-based-routing

Regards,
S.
Title: Re: Static route by ASN
Post by: fathibn on February 02, 2025, 07:36:55 PM
Thank you @Seimus, will investigate this.