How to block spotify on pfsense?



  • Hi guys,

    Is there any way how to block Spotify application on pfsense? TIA…

    Bui





  • hi Pszafer,

    Where am I going to blocked it? firewall rules?

    Thanks man.. :)



  • Firewall, Alias, add new alias, call it Spotify, add the (Hosts) IP ranges assigned to spotify then create a fw rule to block traffic destined to the alias should do it.

    Then you just need to keep an eye on the spotify ip ranges for changes or additions.


  • Moderator

    If you want to capture all of those IPs on that page without doing it manually, you could run the following script:

    You can change the link or Folder/File Locations or pipe it to a file.

    
    #!/bin/sh
    
    fetch -v -o /tmp/ips.raw "http://bgp.he.net/search?search%5Bsearch%5D=spotify&commit=Search"
    
    grep -aoEw -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0
    -9]?/[0-9]{2})" -e "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0
    -9][0-9]?)" /tmp/ips.raw | sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n | uniq
    
    

    23.92.96.0/22
    23.92.100.0/22
    23.92.104.0/22
    78.31.8.0/22
    78.31.12.0/22
    192.121.53.0/24
    192.121.132.0/24
    192.121.140.0/24
    192.165.160.0/22
    193.181.4.0/22
    193.181.180.0/22
    193.181.184.0/23
    193.182.3.0/24
    193.182.7.0/24
    193.182.8.0/21
    193.182.243.0/24
    193.182.244.0/24
    193.234.240.0/22
    193.235.32.0/24
    193.235.51.0/24
    193.235.203.0/24
    193.235.206.0/24
    193.235.224.0/24
    193.235.232.0/22
    194.14.177.0/24
    194.68.28.0/22
    194.68.116.0/24
    194.68.169.0/24
    194.68.176.0/22
    194.68.181.0/24
    194.68.183.0/24
    194.71.148.0/22
    194.71.232.0/22
    194.103.10.0/24
    194.103.13.0/24
    194.103.36.0/22
    194.132.152.0/22
    194.132.162.0/24
    194.132.176.0/22
    194.132.196.0/22


Log in to reply