Skip to main content
theG
New Member
April 17, 2015
Question

URL Based Routing??

  • April 17, 2015
  • 5 replies
  • 34839 views

Hey Guys,

 

Is there a way to do URL based routing on the FGT? FortiOS v5....

 

We have two ISP lines and would like traffic to certain websites to only go via the one line.

 

Thanks in advance!

 

theG

    5 replies

    GusTech
    New Member
    April 17, 2015

    theG wrote:

    Hey Guys,

     

    Is there a way to do URL based routing on the FGT? FortiOS v5....

     

    We have two ISP lines and would like traffic to certain websites to only go via the one line.

     

    Thanks in advance!

     

    theG

    You can use Policy routes

    theG
    theGAuthor
    New Member
    April 17, 2015

    BrUz wrote:

    You can use Policy routes

    Hi BrUz,

    Policy routes only allows me to add destination IP's...or am I missing something? I need to be able to use the URL instead....?

    Dave_Hall
    New Member
    April 17, 2015

    theG wrote:

    Policy routes only allows me to add destination IP's...or am I missing something? I need to be able to use the URL instead....?

    Static or Policy routing is likely the closest thing to crafting something close to what you want, though you'll have to convert the FQDN of those urls into their IP address equivalent.

     

    If you are adamant about a possible "work-around" solution, maybe designate a TCP port outside the normal standard range, say something like 65480 and 65443, set a policy route that routes that traffic out the desired port, then create a VIP (inside->WAN) that "converts" those ports back into the normal expect ports.  So in theory, accessing http://www.google.com:85480 should be directed out the correct WAN port on port 80.  Very hackish. lol.

     

    Note I haven't tried the above and don't even know if it will work. 

     

    Personally, if the original purpose of the request is to access certain websites on the faster WAN connection, you may be better off just setting up ECMP Load Balancing (weighted Load Balance) favouring the faster connection.

    emnoc
    New Member
    April 17, 2015

    FWIW: There's not such thing as URL based routing. A URL has to be resolved and then routed at a layer3 address by a layer3 device ( router/firewall )

    arshadm
    New Member
    April 17, 2015

    1. Create a FQDN object for the URL

    2. Create a policy using the previously created FQDN and choose the required WAN interface.

    Christopher_McMullan
    Staff
    Staff
    April 17, 2015

    In general, the process for web-based traffic is the following, assuming one step for the entire DNS exchange:

     

    1. Client resolves the web server IP via DNS

    2. FortiGate receives client SYN packet

    3. A session is allocated

    4. A routing lookup is performed based on the routing table (connected, static, and dynamic routes based on destination), in addition and subsequent to policy routes (policy routes are applied before the rest of the routing table)

    5. Based on the source and destination interface and address, service, time of day, and optionally, user or device, a policy is matched, and logging, WANOpt, web cache, NAT, UTM, and disclaimer rules are applied.

     

    Step #4 always happens before policy matching, so crafting a policy on its own will not guarantee egress out a certain port, only that traffic choosing that port already can be blocked. In this manner, though, it is theoretically possible, if you have perfect 50/50 non-random, alternating packet load balancing, that half the requests would exit the right port when they weren't denied by the policy created, or alternately, that didn't hit the implicit deny, but were allowed by the policy you mentioned.

     

    The FortiGate doesn't load balance in this fashion, unfortunately, so a policy wouldn't work.

    CHR57
    Explorer II
    May 17, 2023

    Yes you can do that with Policy Routing.

    We have a SD-WAN and I had to point a specific URL to one of the ISP.policy.jpg