Forum Discussion

Wasfi_182818's avatar
Wasfi_182818
Icon for Nimbostratus rankNimbostratus
Aug 26, 2016

Split DNS with IPV6

Hi;

 

The following irule achieves split DNS in IPV4 world

 

when DNS_REQUEST { if { [IP::addr [IP::remote_addr] equals 10.0.0.0/8] \ or [IP::addr [IP::remote_addr] equals 192.168.0.0/16] \ or [IP::addr [IP::remote_addr] equals 172.16.0.0/12] } { pool poola }

 

else { pool poolb

 

}

 

How do achieve this in an IPV6 world and can I have one rule for both worlds.

 

Kindly Wasfi

 

1 Reply

  • The irule is the same:

    when DNS_REQUEST {
    log local0. [IP::remote_addr]
        if { [IP::addr [IP::remote_addr] equals 10.0.0.0/8] or [IP::addr [IP::remote_addr] equals 192.168.0.0/16] or [IP::addr [IP::remote_addr] equals 172.16.0.0/12] } {
            pool pool
        } elseif { [IP::addr [IP::remote_addr] equals 2a02:1111:2222:3333::0/64] } {
            log local0. [IP::remote_addr]
            pool pool
        }
        else {
            pool poolb
        }
    }