Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
How to add artificial latency to WAN interface
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to add artificial latency to WAN interface (Read 1844 times)
derril
Newbie
Posts: 7
Karma: 0
How to add artificial latency to WAN interface
«
on:
December 06, 2023, 07:07:19 pm »
Hello guys! I am new here i just installed OPNsense on a xeon machine i had laying around and everything pretty much works without issues. I am wondering how can i add artificial latency to the WAN interface. On my last router which had linux installed i was using these commands in order to add or remove the latency.
sudo tc qdisc add dev eth0 root netem delay 50ms
sudo tc qdisc del dev eth0 root netem
I did find dummynet but i really don't have a clue how to use it, all the delay examples are from 15 years ago and my english is not so good. I just need a little help please, i know how to move around in console and i know my WAN interface name is igb0 so that's not really an issue. Also is it possible to add the delay only for outbound packets?
Logged
meyergru
Hero Member
Posts: 1659
Karma: 164
IT Aficionado
Re: How to add artificial latency to WAN interface
«
Reply #1 on:
December 07, 2023, 12:08:32 am »
That should be possible via Firewall->Shaper->Pipes->Delay.
You could follow the
bandwidth limiting instructions
, but set a delay instead of really limiting the bandwidth - however, I never tried that.
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
derril
Newbie
Posts: 7
Karma: 0
Re: How to add artificial latency to WAN interface
«
Reply #2 on:
December 07, 2023, 04:32:57 pm »
Thanks for the reply i just gave it a try and it seems i don't know how to successfully add a rule to delay the packets, could you share an example ? My line is 350/300 MB i don't mind to have bandwidth limit ON, that way i don't exceed the line speed and lose packets when downloading etc.
Logged
meyergru
Hero Member
Posts: 1659
Karma: 164
IT Aficionado
Re: How to add artificial latency to WAN interface
«
Reply #3 on:
December 07, 2023, 05:42:26 pm »
The delay parameter is not in the rule, but in the pipe, you can see it when you enable "advanced mode" on the form. Just follow the example and add the delay.
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
derril
Newbie
Posts: 7
Karma: 0
Re: How to add artificial latency to WAN interface
«
Reply #4 on:
December 08, 2023, 02:58:10 am »
Yes i have seen the delay box but it doesn't work or maybe i'm not doing it as i should, can you provide a pic with an example please?
Logged
meyergru
Hero Member
Posts: 1659
Karma: 164
IT Aficionado
Re: How to add artificial latency to WAN interface
«
Reply #5 on:
December 08, 2023, 10:47:38 am »
I just tried to add a delay of 100 ms to my downstream pipe and called
https://www.waveform.com/tools/bufferbloat
, which showed the increased roundtrip time right away.
I have a traffic shaping setup for my internet connection using
these instructions
. You can test its effectiveness (and thus if you set it up correctly) using the Waveform test site before you add the delay to the pipe.
«
Last Edit: December 08, 2023, 10:50:02 am by meyergru
»
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
derril
Newbie
Posts: 7
Karma: 0
Re: How to add artificial latency to WAN interface
«
Reply #6 on:
December 08, 2023, 05:40:31 pm »
Oh OK i can see where i failed now, the tutorial is very good thank you very much for this. I will test high ping for inline FPS games because you know... lagcompensation, my real ping is always 5ms and i get crippled by network algorithm a lot, specially notable in games like Counter-Strike 2. One more question, if i only want outbound lag i just leave enabled the "Out" rule?
Logged
meyergru
Hero Member
Posts: 1659
Karma: 164
IT Aficionado
Re: How to add artificial latency to WAN interface
«
Reply #7 on:
December 08, 2023, 06:05:52 pm »
You can add a delay in any pipe/direction you want.
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
derril
Newbie
Posts: 7
Karma: 0
Re: How to add artificial latency to WAN interface
«
Reply #8 on:
December 08, 2023, 10:21:37 pm »
Nice yes i have tried its working the problem i have is that it also drops a lot of packets. It used to drop a few on my isp router but it seems since i activated this queue it drops 2 or 3 times more. Anyway man thanks for the help this is what i wanted. Are there any other queues i can use instea of fq codel?
Logged
meyergru
Hero Member
Posts: 1659
Karma: 164
IT Aficionado
Re: How to add artificial latency to WAN interface
«
Reply #9 on:
December 08, 2023, 10:39:54 pm »
The purpose of the shaper is to drop packets when too many of them arrive.
If you want delay only, you could set the limits above your real speeds, I would expect no more packet drops.
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
derril
Newbie
Posts: 7
Karma: 0
Re: How to add artificial latency to WAN interface
«
Reply #10 on:
December 08, 2023, 11:21:08 pm »
AHA ok now i understand how this works. Digging around i have currently found a way to add latency from bash:
ipfw pipe 1 config delay 15ms
ipfw pipe 2 config delay 15ms
ipfw add 15 pipe 1 all from any to any in via igb0
ipfw add 15 pipe 2 all from any to any out via igb0
15ms in and 15ms out + my real ping
Do you think this is correct, i mean can i use this just to add delay and not drop anything ?
BTW how can i delete all i did in the "Shaper" category?
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
How to add artificial latency to WAN interface