Openlitespeed – Restore original IPs using Cloudflare

This is essential if you use Cloudflare proxy, otherwise software that blocks IPs will not work properly. Follow the steps bellow. 

    1 – Login to your OpenLitespeed web panel:

				
					https://YOUR_IP:7080
				
			

   1.1 – Default login username is admin. If you are using cyberpanel, your password is located inside the file bellow.

				
					/etc/cyberpanel/webadmin_passwd
				
			

           If you don’t have such file or you are not using cyberpanel and don’t know your password, run the following command to reset it (you can also change your username if you wish):

				
					/usr/local/lsws/admin/misc/admpass.sh
				
			

    2 – At the OLS web admin panel, go to Server Configuration.

         At General -> General Settings, click the Edit button and change Use Client IP in Header to Trusted IP Only

    3 – Go to Server Configuration -> Security.

         Scroll down to Access Control, click the Edit button and at Allowed List replace “ALL” with the text bellow:

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

        This contains all the Cloudflare IP ranges with an T appended. You can manually verify does ranges at Cloudflare website:

				
					https://www.cloudflare.com/ips-v4
https://www.cloudflare.com/ips-v6
				
			

    4 – Restart your OpenLitespeed for changes to take effect, by clicking the Graceful Restart button at the top of the page.

Quick Links

Social

© Copyright 2022 Tierri Lopes. All right reserved.