Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - GeoffW

#1
First, I thought explaining the connection situation might let someone who knows jump straight to what I suspect might be conclusion: you cannot reliably shape this.

I operate from a remote location via a 4G wireless connection.  In simple terms:

   WiFi----\
          OPNsense---4G---ISP---Internet
   LAN-----/


The quality and speed of the 4G connection varies significantly with the weather and time of day.  Download: rarely I might see 25Mbps, most of the time I see 8Mbps..15Mbps (it really does vary that much even over a brief period), but sometimes it will drop to 3Mbps or even lower.  Upload: tends to be more consistent, anything from 7Mbps to 20Mbps; it regularly tests faster than download.

How do you define shaper pipes to encompass such variability?  I don't want to constrain the traffic unnecessarily, which would seem to exclude the possibility of dedicated pipes for certain traffic (unless I want to constrain the total traffic down to a very low value).

Without reliable pipe definitions, I have trouble seeing how the shaper can make appropriate choices, most especially as it relates to download traffic (which is where I see the worst of my problems).


What I wanted to achieve:

My mobile phone currently uses a VoIP app for a business line, and WiFi Calling for mobile calls.  (The office 4G wireless uses an antenna on an 11m mast, so it gets a much better connection than the mobile phone.)  During problem times (Internet being used as well as calls) the download side of the call in particular seems to experience lengthy transmission delays (up to 5 seconds) and sometimes whole words or sentences get dropped.  VoIP is worse than WiFi Calling.  So I was hoping to use the traffic shaper to prioritise calls over other traffic.

The VoIP traffic is easy to identify, I have a list of IPs used by the service provider.  Watching the traffic graph shows it using around 120kbps each way, and both ways are constantly active while a call is active, so utilising 240kbps even if no one speaks (which is higher than I was expecting).

WiFi Calling uses IPSec, but is not the only IPSec service being passed through this firewall, however, setting up shaper rules based the ports (4500 and 500) and the mobile IP address appears to do the job in this case.  WiFi Calling seems more efficient than VoIP, sending traffic only while speaking, but this makes it harder to get a direct measure of its bandwidth requirement.


What I have tried:

I tried setting up a dedicated pipe for VoIP but that seemed to be the worst for download delays - I think because I had oversized the lower priority pipe (so Shaper tried to give it bandwidth it assumed must exist but didn't at the time).  Using queues appeared to make some difference, but often not enough to make for reliable phone calls.

I started off using separate upload and download pipes but was still seeing problems.  When I experimented with running multiple network speed-tests it seems that upload does significantly influence download (at least in those tests, I could not find a test that does proper full duplex speed testing).

So then I moved to a single pipe and just prioritise queues inside that single pipe (up and down).  While it's unclear how much this helped, at least it was simpler.  It made it easier, for example, to test reducing this pipe down to lower speeds.  When I cut the pipe to 5Mbps and ran a speed test while talking, I saw very little delay and break-up in the voice call, but - obviously - the total bandwidth was reduced to under 5Mbps (the speed-test I ran while on the call showed 4.6Mbps).


Possibilities?

* Operate using a shaper pipe defined to the lowest commonly available speed.  Not really an option, but it would be possible.

* If I'm sitting at my desk when a call comes in I could bring up the Shaper and set the pipe according to current connection quality.  I'm not sure how dynamically the shaper responds, but I'm sitting at my desk enough of the day that this is probably feasible if not attractive.

* Maybe there are some advanced options in the Shaper that apply to this situation?


Suggestions welcome.
#2
In the user interface, under Interfaces, Overview, you can expand out the WAN interface and get offed "Reload" and "Renew" buttons that do what I need.   How do I do this in a script?

I've been searching all night.  dhclient in OPNsense doesn't have a -r option, and anyway, running that appears to result in multiple instance issues; sometimes it looks like it has worked (when you do an ifconfig) but the change never appears on the user interface, so something gets missed, or maybe it's because it's running a separate instance.


Yes, I'm talking the years old problem, known both here and on pfSense, of some modems (in this case NetGear) that don't appropriately notify the DHCP client (whose address comes over the bridge provided by the modem) when the address has changed as the result of a reboot of the modem, or other disruption on their side.  The connection is there but OPNsense doesn't know and never gets around to asking.

It appears we're stuck with running a cron job to check whether the network has fallen over and then take action accordingly - and that much I've found examples of here, but the examples I've found resort to rebooting OPNsense, which seems a bit extreme.

I've tried using ifconfig to take the interface down and back up, but that doesn't appear to result in a DHCP renewal ... or is there a hidden option somewhere?

Do I have any other choices, or is a full reboot really it?


(Actually, I suspect there may be another solution: change the modem from bridge to router mode and let it take care of the WAN address change while giving OPNsense a static address.  But that adds another layer, so if I can avoid it I will.)
#3
(Edited to say this was my mistake, see my later post https://forum.opnsense.org/index.php?topic=31769.msg154049#msg154049.)

I notice that devices that have not yet logged in to the Captive Portal - and do not have an exception listed - are still making some connections to the Internet.  I did not expect this.  ( I don't recall it happening on the pfSense firewall I was running up to now - but I guess it's possible it happened without me noticing it. )

I can confirm the connections on the device (eg: a Windows 10 VM running TinyWall lets me see the established connections), but it was ZenArmor showing the sessions that first brought it to my attention.

For example, when I start Firefox on a Windows 10 VM it brings up the expected "You must log in to the network before you can access the Internet".  Meanwhile, in the background the Internet is already being accessed.  At the very least "detectportal.firefox.com" and "safebrowsing.googleapis.com" are getting through, but I also use a speed-dial set up and it seems that at least some of those are updating too.

With Vivaldi (a Chromium based browser) I see much the same thing, with connections to "update.vivaldi.com" and "update.googleapis.com" amongst others.


Is this supposed to happen, or is this a bug in 22.7 that I should be reporting?
#4
Having just solved a problem that's been bugging me half the day I thought I would share.  Maybe the behaviour should have been expected and obvious, but it wasn't to me.

OPNsense 22.7 with WAN, LAN and DMZ interfaces.  Also two separate Captive Portal zone definitions, one for LAN and one for DMZ, and each defined a few addresses (that being the only option) that could access the network without seeing the login screen.

I could have used just one captive portal zone, but since I find the interface for managing allowed devices to be a bit cramped and awkward, I thought it would be easier to use separate zones ... and therein lies the problem.

I later introduced a firewall rule to let LAN devices access a HTTP server on the DMZ and it didn't seem to be working.  What I found was that a connection would make to the server, but the responses never got back.  It appears Captive Portal was blocking it.

The device in question did have its address in the LAN Captive Portal zone, but did not have it in the DMZ Captive Portal zone.  As soon as I added it there too, the connection started working.

All good, I have merged the two Captive Portal zones into one, so I have just one list of device exceptions, and now I can move on.  In my situation this arrangement is not going matter very much, but I can imagine it could be inconvenient in some more complex networks.
#5
Zenarmor (Sensei) / Local vs Remote confusion
January 06, 2023, 01:43:04 AM
I've got a new OPNsense installation, and now I'm trying ZenArmor v1.12.3 in Passive mode.  I'm mostly interested in the session details capability, I don't really want all the extra block/filtering smarts so Passive mode seems the best fit.   Installed using MongoDB.  OPNsense is running as a VM inside ESXi v7 using three physical interfaces I called WAN, LAN, DMZ.  ZenArmor set to monitor LAN and DMZ (but insists on using the underlying interface name vmx1 and vmx2).

Anyway the confusion coming in when I see that "Top Local Hosts" reports mostly Internet names/addresses, although there are a couple of LAN address in there too, while "Top Remote Hosts" is showing only LAN addresses.

Much the same on "Top Local Server Ports" vs "Top Remote Ports".  The "local" is showing stuff I know to be destination ports on the Internet, while the "remote" is showing stuff I'm pretty sure is LAN only.

I have set up to use DNS over TLS with LAN and DMZ port-forward rules to enforce this.  So there is port 53 traffic on the LAN and DMZ interfaces but should only be 853 over the WAN.  Could this be confusing ZenArmor.

Or maybe I am the one who is confused and perhaps "local" and "remote" mean different things in this context?

PS: or is this a duplicate of this question: https://forum.opnsense.org/index.php?topic=31674.0
#6
A few days ago I set up OPNsense v21.1 (and updated to v21.1.1) on a virtual machine (VMware), to experiment with as a replacement for a pfSense installation.  Lots to like after I got my head around the things that are different, but I've got intermittent network errors that I was not getting with the other firewall.

The actual errors vary, but mostly they seem to be either ERR_SSL_PROTOCOL_ERROR, or sometimes ERR_CONNECTION_RESET.

They sometimes manifest in the browser as a page not loading, but more often it is just some of the images on the page that fail to load.  I've attached a screen capture of a browser console log after loading a news website.  (Ignore the last item in the list, that's a real/persistent error.)  Simply reloading the page (or right-click "Load Image") is enough to have the page/image load properly - so the errors are intermittent and transient.

The nature of the problem makes it really hard to analyse - especially since you can't just use a previous page to verify any change, and there is no guarantee the next page/site will see the problem this time around.

I am using Unbound DNS with secure DNS (CloudFlare), but I can't really see that being the problem.  I have disabled IPv6 (I have no use for it on such a simple network so prefer to remove the complication).

I have have Captive Portal turned on, but no proxy.

This is a very small network.  Just half-a-dozen machines connecting out (and some more devices that are intentionally being blocked by the Captive Portal).

Can anyone offer and suggestions on what I might try to resolve this?  I've lost the last three days to my experiments with no change, so I could really use some hints.

Thanks.