# Domain based tunnel / Beryl AX / 4.9 beta 2

**URL:** <https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594>\
**Category:** Router\
**Created:** [May 8, 2026, 9:28am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594 "2026-05-08T09:28:56Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnirtS](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/ba8739/32.png) [@gnirtS](https://forum.gl-inet.com/u/gnirtS)\
**Post date:** [May 8, 2026, 9:28am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/1 "2026-05-08T09:28:56Z")

</div>

Experimenting with shovelling specific traffic down my tunnel based on domain to get UK based bbc websites (it wont work for cdn reasons i think but thats another story) but have come across an issue.

When i enter domains in the GUI and restart the tunnel i get errors in the server log:

> Fri May 8 15:51:48 2026 daemon.crit dnsmasq[13242]: FAILED to start up
> 
> Fri May 8 15:51:53 2026 daemon.crit dnsmasq[13299]: bad option at line 1 of /tmp/dnsmasq.d/via\_domain
> 
> Fri May 8 15:51:53 2026 daemon.crit dnsmasq[13299]: FAILED to start up
> 
> Fri May 8 15:51:53 2026 daemon.crit dnsmasq[13301]: bad option at line 1 of

The file itself contains:

> ~# cat /tmp/dnsmasq.d/via\_domain
> 
> nftset=/bbcstatic.com/4#inet#vpn\_table#dst\_net10
> 
> nftset=/26u.co/4#inet#vpn\_table#dst\_net10
> 
> nftset=/account.bbc.com/4#inet#vpn\_table#dst\_net10
> 
> nftset=/bbci.co.uk/4#inet#vpn\_table#dst\_net10
> 
> nftset=/static.bbci.co.uk/4#inet#vpn\_table#dst\_net10
> 
> nftset=/bbc.co.uk/4#inet#vpn\_table#dst\_net10
> 
> nftset=/mybbc.co.uk/4#inet#vpn\_table#dst\_net10
> 
> nftset=/session.bbc.com/4#inet#vpn\_table#dst\_net10
> 
> nftset=/bbc.com/4#inet#vpn\_table#dst\_net10
> 
> nftset=/ichef.bbci.co.uk/4#inet#vpn\_table#dst\_net10

After a few seconds i lose all dns (not just to those domains) on the connected clients, nothing shows in AGH or anywhere else. Turning tunnel off or deleting those rules and all is fine again.

Is this some sort of parsing error with the GUI here?

Tunnel policy works on a device level but im getting this using the gui for a domain based filter.

AGH is running on the Beryl, Override DNS Settings of All Clients and Allow Custom DNS to Override VPN DNS are both turned on but have tried them off.

---

<div class="post-metadata">

**Author:** ![xize11](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/xize11/32/5340_2.png) [@xize11](https://forum.gl-inet.com/u/xize11)\
**Post date:** [May 8, 2026, 9:40am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/2 "2026-05-08T09:40:43Z")

</div>

> [@gnirtS](#):
>
> Is this some sort of parsing error with the GUI here?

It looks to a invalid policy passed to nftables which then fails, dnsmasq fails to start by it.

What is your raw policy given in?

It could be there is a strange white space character after a new line which invalidates the dnsmasq configuration, since they may get stripped on the forum in case of posting.

---

<div class="post-metadata">

**Author:** ![gnirtS](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/ba8739/32.png) [@gnirtS](https://forum.gl-inet.com/u/gnirtS)\
**Post date:** [May 8, 2026, 9:52am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/3 "2026-05-08T09:52:00Z")

</div>

Its a bog standard text-only raw paste from notepad into the GUI.  
Also tried typing manually  
I dont see any hidden control codes or characters and typing manually should exclude that.

---

<div class="post-metadata">

**Author:** ![xize11](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/xize11/32/5340_2.png) [@xize11](https://forum.gl-inet.com/u/xize11)\
**Post date:** [May 8, 2026, 9:54am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/4 "2026-05-08T09:54:06Z")

</div>

How long is this list?, i know that nftsets have a limit atleast that is what I learned from Stangri's PBR it could be that the ipset is becoming too big.

---

<div class="post-metadata">

**Author:** ![will.qiu](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@will.qiu](https://forum.gl-inet.com/u/will.qiu)\
**Post date:** [May 8, 2026, 9:56am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/5 "2026-05-08T09:56:55Z")

</div>

Hi

MT3000 v4.9.0 Beta 2 should use `ipset` instead of `nftset`.

Did you import a LuCI backup file from another device or from an OP24-based firmware version?

Please try checking the following:

```bash
uci show route_policy.global.use_fw4
# If it exists, delete it
uci delete route_policy.global.use_fw4
uci commit route_policy

```

After that, restart the VPN and it should work normally again.

---

<div class="post-metadata">

**Author:** ![gnirtS](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/ba8739/32.png) [@gnirtS](https://forum.gl-inet.com/u/gnirtS)\
**Post date:** [May 8, 2026, 10:05am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/6 "2026-05-08T10:05:13Z")

</div>

OK that was active and that did fix it.

I was on op24 a while ago but downgraded due to wanting Amnezia support so its likely left over from that despite multiple 4.8 and 4.9 firmwares.

I did try a factory reset 4.9b2 to install from scratch but found it refused to recognise my vpn config files as Amnezia, marked them as normal wireguard and refused to connect hence restoring.

Thanks for that, sorted for now. a test domain now does go through the tunnel. (Admittedly bbc still redirects somehow to international page but that’s unrelated)

---

<div class="post-metadata">

**Author:** ![will.qiu](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@will.qiu](https://forum.gl-inet.com/u/will.qiu)\
**Post date:** [May 9, 2026, 7:34am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/7 "2026-05-09T07:34:45Z")

</div>

Thank you for the update. We’re glad to hear that the VPN is now working properly.

> [@gnirtS](#):
>
> I did try a factory reset 4.9b2 to install from scratch but found it refused to recognise my vpn config files as Amnezia, marked them as normal wireguard and refused to connect hence restoring.

That sounds a bit unusual, as MT3000 v4.9.0 beta2 should be able to import Amnezia VPN client profiles properly.

Could you please share the configuration file with us (with the server address and public/private keys redacted) so we can check it locally?

---

<div class="post-metadata">

**Author:** ![gnirtS](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/ba8739/32.png) [@gnirtS](https://forum.gl-inet.com/u/gnirtS)\
**Post date:** [May 13, 2026, 9:37am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/8 "2026-05-13T09:37:32Z")

</div>

Ill do so but in a few days when im back from the current trip. Is it better as a PM due to server addresses (not sure i want my private infrastructure IPs on public forums).

I will do another full factory reset off this trip and paste it again along with log gathering.

---

<div class="post-metadata">

**Author:** ![will.qiu](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@will.qiu](https://forum.gl-inet.com/u/will.qiu)\
**Post date:** [May 13, 2026, 9:39am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/9 "2026-05-13T09:39:41Z")

</div>

Yes, if you have privacy concerns, you can send us a private message, or contact us via email at [support@gl-inet.com](mailto:support@gl-inet.com).

---

<div class="post-metadata">

**Author:** ![gnirtS](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/ba8739/32.png) [@gnirtS](https://forum.gl-inet.com/u/gnirtS)\
**Post date:** [May 28, 2026, 12:40pm UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/10 "2026-05-28T12:40:49Z")

</div>

Ive just factory reset and installd 4.9 beta 4 again from scratch to ensur things are ok.

This exact config was working fine on the same firmware on my old ported beta 1 onwards settings.

However when i try to enter them into the new one it wont accept. I think on the parameters.

[Interface]  
Address = 10.12.0.10/24,fd11:0:0:2::10/64  
PrivateKey =Redact  
DNS = 172.17.2.1, fda8:421a:f699:0:fd79:3dd7:85a4:6451  
MTU = 1280  
Jc = 3  
Jmin = 64  
Jmax = 800  
S1 = 8  
S2 = 16  
H1 = 3339112198  
H2 = 4238541520  
H3 = 2940724556  
H4 = 1065151814  
I1 = \<b 0xc1c6163b00000001000000000000013aff000001000001280000000000000000060040f4000100003c0200000000ffffffffffffffff00070010d9da4bd0ad7e71fd18eabf6f92edde6b003c0010001d00120010168772d32602068332d32602068330020001400040000000a00050003026833001000050003026833001c0002400100150019a1d6bc73f27f7df8e1b04e7d5e8c9b0e4a3f2\>\<r 10\>

[Peer]  
AllowedIPs = 0.0.0.0/0  
Endpoint =myAmz2  
PersistentKeepalive = 15  
PublicKey = Redacted

In “Text” apply wont work - red border. In “Item” list it highlights the obfuscation parameters and wont save.

If i import the .conf directly then it “accepts” it and “connects” but doesnt work. Poking round the CLI suggests its trying to treat it as a Wireguard instead and as such no obfuscation so wont work at all.

The same settings work on mobiles, laptops and previously on 4.9 beta 1 (where i entered it) and beta 2, 3, 4 prior to reset.

FWIW if i strip I1 and H and paste the text in, the config does save at least so it suggests the parsing is getting stuck here.

Further update. This looks like a parser error. I can manually fix it by creating a file in /etc/wireguard/profiles/group/peerxxxx and echoing all the obuscation parameters there.

If i do that the the entire config works. Errors seems to be not parsing therefore not saving obfuscation.

---

<div class="post-metadata">

**Author:** ![will.qiu](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@will.qiu](https://forum.gl-inet.com/u/will.qiu)\
**Post date:** [May 29, 2026, 11:40am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/11 "2026-05-29T11:40:26Z")

</div>

> [@gnirtS](#):
>
> H1 = 3339112198  
> H2 = 4238541520  
> H3 = 2940724556  
> H4 = 1065151814

It appears that **H1–H4 exceed the limits currently supported by our implementation**.

Could you please clarify the following:

1. Is this a self-hosted server, or is it provided by a third-party service provider?
2. If it is a self-hosted server, could you try adjusting the values to fall within the following ranges and see whether that helps?

```plaintext
H1: [5, 2147483647]
H2: [5, 2147483647]
H3: [5, 2147483647]
H4: [5, 2147483647]

```

---

<div class="post-metadata">

**Author:** ![gnirtS](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/ba8739/32.png) [@gnirtS](https://forum.gl-inet.com/u/gnirtS)\
**Post date:** [May 29, 2026, 11:47am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/12 "2026-05-29T11:47:30Z")

</div>

Its self-hosted with the official git Amnezia on a RaPi.

Changing params isnt really practical due to 20 or so clients (not all mine) id have to re-configure.

The Beryl DOES work though if i manually set the file in /etc/wireguard/profile/group/peerxxxx with the values.

If i do that it all connects and all works so it seems the client implementation itself is fine using those values but the parser is rejecting them on both the text input or conf file input.

But the .conf input DID work on 4.9 beta 1 as thats how my original config got added in the first place.

Best i can do next week is set up a new server with new values as a test bed.

Is there a list of what parameters and values are currently accepted?

EDIT to add:

Even using H values in the ranges you specific the text paste parser wont accept them.

Remove I1 it still wont accept.

 ![image](https://forum-static.gl-inet.com/original/3X/f/a/fad41de5b355a792a922204fe9d9dcb1f206a205.png)

Can see the red highlight.

It will ONLY save with all H and I1 removed. S1,S2 is fine. Obviouslyy then it doesnt think its AWG so creates as a standard peer so i have to manually create the file in profiles/group/peerxxx with them.

---

<div class="post-metadata">

**Author:** ![will.qiu](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/w/b38774/32.png) [@will.qiu](https://forum.gl-inet.com/u/will.qiu)\
**Post date:** [May 30, 2026, 9:12am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/13 "2026-05-30T09:12:11Z")

</div>

> [@gnirtS](#):
>
> ![image](https://forum-static.gl-inet.com/original/3X/f/a/fad41de5b355a792a922204fe9d9dcb1f206a205.png)

It looks like you've run into another AWG limitation: **the ranges defined by H1–H4 must not overlap**.

We have already tested this locally, and after adjusting the H1–H4 values, the configuration file could be imported successfully:

 ![image](https://forum-static.gl-inet.com/original/3X/7/a/7adc6d6e7324e3c4f7b79753b3c32e8534f73bbc.png)

* * *

> [@gnirtS](#):
>
> Is there a list of what parameters and values are currently accepted?

Please refer to the following:

```plaintext
Jc: [1, 128]
Jmin: [0, 1279]
Jmax: [0, 1279]
S1: [0, 1132]
S2: [0, 1188]
S3: [0, 1216]
S4: [0, 32]
H1: [5, 2147483647]
H2: [5, 2147483647]
H3: [5, 2147483647]
H4: [5, 2147483647]

```

The following constraints must also be satisfied:

- `Jmin` and `Jmax` must appear together.
- `Jmin < Jmax`.
- `S1 + 56 ≠ S2`.
- The ranges defined by `H1`–`H4` must not overlap.
- `I1`–`I5` must each be ≤ 64 KB.

---

<div class="post-metadata">

**Author:** ![system](https://forum-static.gl-inet.com/original/3X/7/7/77e28f6cb342ac4bd641bd9a6254595d61b2812a.png) [@system](https://forum.gl-inet.com/u/system)\
**Post date:** [August 28, 2026, 9:12am UTC](https://forum.gl-inet.com/t/domain-based-tunnel-beryl-ax-4-9-beta-2/68594/14 "2026-08-28T09:12:41Z")

</div>

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