Route Specific URL to a different gateway

Home Page Forums Network Management ZeroShell Route Specific URL to a different gateway

This topic contains 2 replies, has 0 voices, and was last updated by  sadnblueish 2 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44219

    sadnblueish
    Member

    Hi,

    I am using Netbalancer with 2 gateways. I also have a 3rd gateway with unfiltered internet access. Thats not currently added in my Netbalancer. My usual traffic should flow from 2 gateways already defined in Netbalancer while I want to force specific URLs (e.g., youtube.com) through 3rd gateway. Just to clarify again, I want to reroute specific URLs and not Destination IPs.

    How can I do that? Appreciate help!

    Regards,

    #53736

    sadnblueish
    Member

    Anyone?

    #53737

    RCWielewski
    Member

    @sadnblueish wrote:

    Hi,

    I am using Netbalancer with 2 gateways. I also have a 3rd gateway with unfiltered internet access. Thats not currently added in my Netbalancer. My usual traffic should flow from 2 gateways already defined in Netbalancer while I want to force specific URLs (e.g., youtube.com) through 3rd gateway. Just to clarify again, I want to reroute specific URLs and not Destination IPs.

    How can I do that? Appreciate help!

    Regards,

    Try to add this gateway (or interface) in Netbalancer and create a rule with the protocol (layer 7) used to acccess the specific site and put the gateway in target gateway at the form… good luck

    #53738

    RCWielewski
    Member

    Hello.

    My data carrier (CLARO) does not charge for facebook, whatsapp and twiter data, so the logic is that access to these sites is done by the 4G connection.
    I tried to create filters on the Net Balancer without success.
    I decided to create the routes manually and as the access IPs change frequently the solution was to search for the IPs to create the correct routes.
    I created a “script” to schedule it to run every 12 hours (time depends on each need).
    Here’s the example for facebook, whatsapp and twitter, I hope they’re useful as an example (obviously they can be improved, but I’m a beginner in “linux script”:

    # Bash script: Routes-Cron

    cd /tmp

    ## Facebook
    whois -h whois.radb.net — ‘-i origin AS32934’ | awk ‘/^route:/ {print $2;}’ | sort | uniq > facebook.routes
    lines=`awk ‘END {print NR}’ facebook.routes`
    i=1
    while (( $i <= $lines ))
    do
    par=”sed -n “$i”p facebook.routes”
    $par > facebook.txt
    ra=`cat facebook.txt`
    route_add=”ip route add “$ra” dev ppp0″
    $route_add
    i=$(( i+1 ))
    done
    ## End for Facebook

    ## whatsapp
    whois -h whois.radb.net — ‘-i origin AS36351’ | awk ‘/^route:/ {print $2;}’ | sort | uniq > whatsapp.routes
    lines=`awk ‘END {print NR}’ whatsapp.routes`
    i=1
    while (( $i <= $lines ))
    do
    par=”sed -n “$i”p whatsapp.routes”
    $par > whatsapp.txt
    ra=`cat whatsapp.txt`
    route_add=”ip route add “$ra” dev ppp0″
    $route_add
    i=$(( i+1 ))
    done
    ## End for whatsapp

    ## Twitter
    whois -h whois.radb.net — ‘-i origin AS13414’ | awk ‘/^route:/ {print $2;}’ | sort | uniq > twitter.routes
    lines=`awk ‘END {print NR}’ twitter.routes`
    i=1
    while (( $i <= $lines ))
    do
    par=”sed -n “$i”p twitter.routes”
    $par > twitter.txt
    ra=`cat twitter.txt`
    route_add=”ip route add “$ra” dev ppp0″
    $route_add
    i=$(( i+1 ))
    done
    ## End for Twitrer

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.