# Lzo adaptive option no longer possible?

**URL:** <https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372>\
**Category:** Pritunl VPN\
**Created:** [September 12, 2024, 8:20am UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372 "2024-09-12T08:20:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hl0r0f0s](https://forum.pritunl.com/user_avatar/forum.pritunl.com/hl0r0f0s/32/948_2.png) [@hl0r0f0s](https://forum.pritunl.com/u/hl0r0f0s)\
**Post date:** [September 12, 2024, 8:20am UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372/1 "2024-09-12T08:20:29Z")

</div>

After input command in mongosh:  
db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo\_compression” : “adaptive”}})  
and reboot server in config file tmp/pritunl no parametr with lzo-comp.

Next commands working:  
db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo\_compression” : true}})  
db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo\_compression” : false}})

Im need type “adaptive” for working VPN client on Mikrotik router.

 ![Screenshot 2024-09-12 161840](https://forum-static.pritunl.com/original/1X/a2fac89a72128aea7376eee51b6dcc70f2e81333.png)

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [September 12, 2024, 12:34pm UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372/2 "2024-09-12T12:34:06Z")

</div>

Setting it to `adaptive` will leave the option blank in the server configuration [**pritunl/server/instance.py**](https://github.com/pritunl/pritunl/blob/master/pritunl/server/instance.py#L369).

With an enterprise subscription a [**plugin**](https://docs.pritunl.com/docs/plugins) can be added with the `server_config` function to change the option.

The code can also be modified at `/usr/lib/pritunl/usr/lib/python3.9/site-packages/pritunl/server/instance.py` then run `sudo systemctl restart pritunl`.

---

<div class="post-metadata">

**Author:** ![hl0r0f0s](https://forum.pritunl.com/user_avatar/forum.pritunl.com/hl0r0f0s/32/948_2.png) [@hl0r0f0s](https://forum.pritunl.com/u/hl0r0f0s)\
**Post date:** [September 13, 2024, 6:13am UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372/3 "2024-09-13T06:13:58Z")

</div>

This was done. But I encountered the following problem: in the web interface it is no longer possible to save changes to server settings. This happens after the command:  
`db.servers.updateOne({“name” : “mtSrv”}, {$set: { “lzo_compression” : “adaptive”}})`

Screen bottom i try change name server and press ‘Save’:

 ![Screenshot 2024-09-13 140106](https://forum-static.pritunl.com/original/1X/b2abf9a5a67266580fbc5dfffce78686ce772dbf.png)

Change to True or False do working again.

PS: MongoDB 7.0, Pritunl v1.32.3805.95 19334b

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [September 14, 2024, 1:29am UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372/4 "2024-09-14T01:29:47Z")

</div>

That option was removed and the type filtering that was added in the pritunl-web process will only accept a boolean when saving from the web console. The only way to change it would be to modify the code.

---

<div class="post-metadata">

**Author:** ![hl0r0f0s](https://forum.pritunl.com/user_avatar/forum.pritunl.com/hl0r0f0s/32/948_2.png) [@hl0r0f0s](https://forum.pritunl.com/u/hl0r0f0s)\
**Post date:** [September 14, 2024, 6:20am UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372/5 "2024-09-14T06:20:38Z")

</div>

Couldn’t find filtering and rewrite it. But I did it differently:

```auto
if not self.server.lzo_compression: and self.server.name == 'mtSrv':
    pass

```

Now, by turning off LZO via mongosh and having a specific server name, we will get a fully working option for connecting Mikrotik routers and a working web interface for server settings.

---

<div class="post-metadata">

**Author:** ![sinotov-alex](https://forum.pritunl.com/user_avatar/forum.pritunl.com/sinotov-alex/32/1324_2.png) [@sinotov-alex](https://forum.pritunl.com/u/sinotov-alex)\
**Post date:** [August 22, 2025, 2:58pm UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372/6 "2025-08-22T14:58:19Z")

</div>

For Mikrotik v7 you need to change Pritunl server transport protocol from UDP to TCP only.

---

<div class="post-metadata">

**Author:** ![sinotov-alex](https://forum.pritunl.com/user_avatar/forum.pritunl.com/sinotov-alex/32/1324_2.png) [@sinotov-alex](https://forum.pritunl.com/u/sinotov-alex)\
**Post date:** [August 25, 2025, 8:08am UTC](https://forum.pritunl.com/t/lzo-adaptive-option-no-longer-possible/2372/7 "2025-08-25T08:08:05Z")

</div>

I apologize. We need to change transport protocol from to TCP and modify the code:

```auto
    #if self.server.lzo_compression == ADAPTIVE:
    if self.server.name == 'your-server-name':
        pass
    elif self.server.lzo_compression:
        server_conf += 'comp-lzo yes\npush "comp-lzo yes"\n'
    else:
        server_conf += 'ignore-unknown-option allow-compression\n'
        server_conf += 'allow-compression no\n'
        server_conf += 'comp-lzo no\npush "comp-lzo no"\n'

```

Because the connection is not stable and error occurred on Pritunl side: **“Bad compression stub decompression header byte: xx“**

In the code, we commented out the condition lzo\_compression == ADAPTIVE and created a new condition that checks the name of your server on which you want to disable writing the comp-lzo configuration in parameters.
