How to block an IP address or network block with Varnish VCL

blockipvarnish

How does one block either IP address of network range inside of Varnish's VCL file?

Best Answer

acl unwanted {
    "69.60.116.0"/24;
    "69.90.119.207";
}

sub vcl_recv {
    if (client.ip ~ unwanted) {
        error 410;
    }
...
}