• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

DNS/Domain Based Routing

Scheduled Pinned Locked Moved Routing and Multi WAN
4 Posts 3 Posters 2.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C
    ccmks
    last edited by Dec 30, 2017, 9:38 AM

    Hello,

    I am currently have 2 different ISP which ISP1 is for regular use and ISP2 offers free youtube access unlimited and also for fail-over.

    I would like to implement all youtube traffic will be going to ISP2 and rest of traffic will be going to ISP1 in order to take the advantage of the offer.

    How can I implement that since youtube server are all over the place and there are too many of them which I don't even know which server/IP I am connected to. I was think if there is a way for PFSENSE to know if this is a youtube traffic by detecting the DNS or such then can implement policy based routing to ISP2.

    Thank you so much!

    1 Reply Last reply Reply Quote 0
    • V
      viragomann
      last edited by Dec 30, 2017, 12:34 PM

      You may add an alias of type IP and add all youtube host names to it like "youtube.com", "www.youtube.com". Then use this alias in the firewall rule for policy routing.

      Alternatively you can search for youtube IP addresses in the Web. You will find lists like this one: http://artica-proxy.com/youtube-tcpip-addresses-list
      Copy the addresses into a text file, then import it into an alias.

      1 Reply Last reply Reply Quote 0
      • C
        ccmks
        last edited by Jan 2, 2018, 4:06 AM

        Thanks for the reply.

        How can you add alias with wildcard? After analyzing youtube traffic, I realize that they have thousands subdomain under youtube.com as well as googlevideo.com. Each subdomains points to different IP. If I decide to create Alias then use the entire network CIDR to route, then it will affect the entire google service such as gmail, drive, and others.

        What I really want to have route policy is just youtube server only.

        For artica-proxy.com, the list of server is no longer valid.

        Thank you

        1 Reply Last reply Reply Quote 0
        • F
          forceps
          last edited by Jan 8, 2018, 7:01 AM

          There is an alternative way.

          First, you need build a custom kernel to enable multiple routing table.

          http://wiki.stocksy.co.uk/wiki/Multiple_default_routes_in_FreeBSD_without_BGP_or_similar

          Then use DNS forwarder (dnsmasq), which provide a nice feature called ipset. It will add the resolved IPs from matching hostname to a pf table. You also need to manually edit /etc/inc/filter.inc, to add a custom pf rule, which force IPs listed in a pf table go through a route other than the default WAN.

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
            This community forum collects and processes your personal information.
            consent.not_received