Howto add ipv6 to remoteip.conf?

I’m trying to apply these configurations to my apache2 web server with the help of Cloudflare original documentation here. In the 4th step it says;

  1. Define trusted proxy addresses by creating /etc/apache2/conf-available/remoteip.conf by entering the following code and Cloudflare IPs:
RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 192.0.2.1 (example IP address)
RemoteIPTrustedProxy 192.0.2.2 (example IP address)
(repeat for all Cloudflare IPs listed at https://www.cloudflare.com/ips/)

In the link there are 2 lists, one for IPv4 and one for IPv6. I can add IPv4 list to remoteip.conf file without any issue but I don’t know how to add IPv6 list to the file. Actually I even don’t know if IPv4 list is a must or not. Is there anyone facing with this, how can I add the IPv6 list?

Just add the IPv6 addresses to the same file…

RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 173.245.48.0/20
RemoteIPTrustedProxy 103.21.244.0/22
RemoteIPTrustedProxy 103.22.200.0/22
RemoteIPTrustedProxy 103.31.4.0/22
RemoteIPTrustedProxy 141.101.64.0/18
RemoteIPTrustedProxy 108.162.192.0/18
RemoteIPTrustedProxy 190.93.240.0/20
RemoteIPTrustedProxy 188.114.96.0/20
RemoteIPTrustedProxy 197.234.240.0/22
RemoteIPTrustedProxy 198.41.128.0/17
RemoteIPTrustedProxy 162.158.0.0/15
RemoteIPTrustedProxy 104.16.0.0/13
RemoteIPTrustedProxy 104.24.0.0/14
RemoteIPTrustedProxy 172.64.0.0/13
RemoteIPTrustedProxy 131.0.72.0/22
RemoteIPTrustedProxy 2400:cb00::/32
RemoteIPTrustedProxy 2606:4700::/32
RemoteIPTrustedProxy 2803:f800::/32
RemoteIPTrustedProxy 2405:b500::/32
RemoteIPTrustedProxy 2405:8100::/32
RemoteIPTrustedProxy 2a06:98c0::/29
RemoteIPTrustedProxy 2c0f:f248::/32
2 Likes

It would be nice if the documentation is very clear about this and says add both IPv4 and IPv6 lists to remoteip.conf file. IP lists are seperated and it was confusing for me.

Many thanks @sjr

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.