OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of knebb »
  • Show Posts »
  • Topics
  • Profile Info
    • Summary
    • Show Stats
    • Show Posts...
      • Messages
      • Topics
      • Attachments

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.

  • Messages
  • Topics
  • Attachments

Topics - knebb

Pages: [1] 2
1
24.1 Legacy Series / HowTo/ Hint: Spamassassin getting blocked due too many queries
« on: June 11, 2024, 08:12:03 am »
Hi,

I have Unbound running on my OPNSense and a public mailserver with spamassassin behind.

I noticed log messages on my mailserver like this:
Code: [Select]
Jun 11 06:16:23 net spamd[9635]: check: dns_block_rule URIBL_BLOCKED hit, creating /root/.spamassassin/dnsblock_multi.uribl.com (This means DNSBL blocked you due to too many queries. Set all affected rules score to 0, or use "dns_query_restriction deny multi.uribl.com" to disable queries)
Jun 11 06:16:23 net spamd[9635]: check: dns_block_rule RCVD_IN_ZEN_BLOCKED_OPENDNS hit, creating /root/.spamassassin/dnsblock_zen.spamhaus.org (This means DNSBL blocked you due to too many queries. Set all affected rules score to 0, or use "dns_query_restriction deny zen.spamhaus.org" to disable queries)
Jun 11 06:30:12 net spamd[9635]: check: dns_block_rule URIBL_BLOCKED hit, creating /root/.spamassassin/dnsblock_multi.uribl.com (This means DNSBL blocked you due to too many queries. Set all affected rules score to 0, or use "dns_query_restriction deny multi.uribl.com" to disable queries)
Jun 11 08:00:35 net spamd[9635]: check: dns_block_rule RCVD_IN_VALIDITY_CERTIFIED_BLOCKED hit, creating /root/.spamassassin/dnsblock_sa-trusted.bondedsender.org (This means DNSBL blocked you due to too many queries. Set all affected rules score to 0, or use "dns_query_restriction deny sa-trusted.bondedsender.org" to disable queries)
Jun 11 08:00:35 net spamd[9635]: check: dns_block_rule RCVD_IN_VALIDITY_SAFE_BLOCKED hit, creating /root/.spamassassin/dnsblock_sa-accredit.habeas.com (This means DNSBL blocked you due to too many queries. Set all affected rules score to 0, or use "dns_query_restriction deny sa-accredit.habeas.com" to disable queries)
Jun 11 08:00:35 net spamd[9635]: check: dns_block_rule RCVD_IN_VALIDITY_RPBL_BLOCKED hit, creating /root/.spamassassin/dnsblock_bl.score.senderscore.com (This means DNSBL blocked you due to too many queries. Set all affected rules score to 0, or use "dns_query_restriction deny bl.score.senderscore.com" to disable queries)
All with different but similar error messages.
Initially I did not have unbound configured but used some default open DNS servers.

Doing a search for the above errors lead into "install a local resolver like unbound". So did I. Same result, just less frequent.

For those who have similar issues, here's the solution.

The root cause is the blacklist queries are coming from very high frequent nameservers like Google (1.1.1.1) or Quad (9.9.9.9) which I had configured as forwarder. And the blacklists saw the queries only from these IPs and blocked them due to high volume.
I noticed this by doing a dig command:
Code: [Select]
root@netp:/# dig @opnsense 2.0.0.127.multi.uribl.com txt +short
"127.0.0.1 -> Query Refused. See http://uribl.com/refused.shtml for more information [Your DNS IP: 172.70.241.83]"
So this revealed a Cloudflare IP. But where did it come from?

In my Unbound I had configured forward servers. So my Unbound forwarded all queries to the high volume DNS servers, too.

Obviously using a local cache did not help here.

Finally I configured my Unbound to NOT use any forwarders - or use the local ISP DNS servers.
Once done, the above messages went away and I am back to proper spam protection.

Just in case it helps for some guys searching for the same issue.

/KNEBB

2
German - Deutsch / Wie Performanz NGINX Reverse Proxy optimieren?
« on: May 29, 2024, 08:40:49 am »
Moin,

hier läuft OPNSense auf einem ThomasKren LE-Server (Celeron J6412 @ 2.00GHz (4 cores, 4 threads)) mit 8G RAM.

Die Speicherauslastung leigt lt. Dashboard bei 48%, die CPU-Auslastung steigt nie über 40%.

Es läuft ein NGINX als Reverse-Proxy, der zwei Ports https:// (via LetsEncrypt) an zwei interne Server per http:// weiterleitet. Funktioniert auch wunderbar.

Ich habe nur mit den URLs Schwierigkeiten.

Im Ideallfall möchte ich für externe als auch interne Zugriffe die gleiche URL verwenden. Das ist natürlich aus zwei Gründen schwierig:
Zum Einen wegen der https:// bvs. http:// Problematik. Beide Anwendungen können kein https. :(
Zum Zweiten wegen den IPs- Ich kann den gleichen Namen intern auf die interne IP zeigen lassen, und extern auf die öffentliche. Nur doof wg. https...

Aktuell habe ich es so, dass ich intern den öffentlichen Namen auch auf die öffentliche IP zeigen lasse und die öffentliche https-URL verwende. D.h. ich greife von intern auf das WAN-Interface der OPNSense zu, diese betreibt den NGINX, der die Anfrage an den internen Server weiterleitet und die Antwort läuft dann ebenfalls wieder via OPNSense/NGINX.
Grundsätzlich funktioniert das, aber die Performanz läßt im Vergleich zum direkten Zugriif doch zu wünschen übrig. Ich vermute, dass das (auch) am NGINX liegt, deshalb die Frage, ob es Optimierungen gibt, so dass die Geschichte etwas schneller vonstatten geht?

danke& Grüße

/KNEBB

3
German - Deutsch / nginx Revrese Proxy und Umleitung zu https:// mit Port?
« on: May 21, 2024, 07:59:59 am »
Moin,

aktuell läuft nginx hier als revese Proxy für eine interne Anwendung. Die Anwendung kann kein TSL/SSL/HTTPS!

Nginx ist für Anfragen aus dem Internet davorgeschaltet, nimmt eingehende HTTPS:// Anfragen (via LetsEncrypt Zertifikat) entgegen, entschlüsselt diese und leitet sie problemlos an die interne Anwendung weiter. Funktioniert soweit sehr gut.

Nun wollte ich gerne, dass die Clients, die diese Anwendung nutzen, sowohl von intern als auch extern die gleiche URL nutzen können. DNS soweit kein Problem, das funktioniert. Der Hostname zeigt im Internet auf meine öffentliche IP und intern auf den Server der Anwendung.

Nur habe ich jetzt das Problem mit https:// vs. http://. Intern kann ich kein https:// verwenden, von außen will ich kein unverschlüsseltes http://.

Ich habe nun bei NGINX den Schalter "Nur HTTP" aktiviert. Klappt auch, eingehende (unverschlüsselte) Anfragen werden an https:// weitergeleitet. Nur dummerweise ohne Angabe des Ports. Der umgeleitete https://-Verkehr versucht es also auf dem üblichen 443. Das ist aber nicht der Port, auf dem die Anwendung läuft.

Kann ich dem NGINX irgendwie beibringen, dass er bei der Weiterleitung auf HTTPS:// den richtigen Port mitgibt?

Danke für Ideen!

/KNEBB

4
Virtual private networks / Troubleshooting WG client (Debian) - why no connection?
« on: April 04, 2024, 07:12:18 pm »
Hi,

I had Wireguard configured for a while and it was running stable and fine. Now I realized one of my clients (Debian10) lost VPN connection for some reason. So I tried to get it back up but it does not work.

At first I relized it was trying to connect to the wrong IP address (I changed the OPNSense WAN interface to fibre with static IP). But even using the correct OPNSense public IP (no NAT, no port forwarding needed) does not bring up the interface.

Do you guys have some idea how to troubleshoot the WG-connetion and why it does not come up?

I already did enable debug logging on the DEbian system through:

Code: [Select]
echo "module wireguard +p" | sudo tee /sys/kernel/debug/dynamic_debug/control
but using
Code: [Select]
dmesg -wT does not show any further details.

I disabled an re-enabled WG on my OPNSense. No change.
I checked the logs from WG but it does not bring any lights in there:

Code: [Select]
2024-04-04T15:36:27 Notice wireguard wireguard instance RemoteAccess (wg2) started
2024-04-04T15:36:27 Notice wireguard /usr/local/opnsense/scripts/Wireguard/wg-service-control.php: ROUTING: keeping inet default route to xx.yyy.zz.www
2024-04-04T15:36:27 Notice wireguard /usr/local/opnsense/scripts/Wireguard/wg-service-control.php: ROUTING: configuring inet default gateway on wan
2024-04-04T15:36:27 Notice wireguard /usr/local/opnsense/scripts/Wireguard/wg-service-control.php: ROUTING: entering configure using 'opt2'
2024-04-04T15:36:27 Notice wireguard wireguard instance RemoteAccess (wg2) can not reconfigure without stopping it first.


On the client I can do a
Code: [Select]
wg:

Code: [Select]
root@debian:~# wg
interface: wg0
No further details.

I even rebooted the client several times but no chance to get the wg0 interface up and running.


How can I check more in detail what is going on here?

Thanks a lot!

/KNEBB

5
German - Deutsch / Unbound mit VIEWS?
« on: March 04, 2024, 10:03:42 am »
Moin,
kann ich (wenn ja, wie?) mit Unbound unterschiedliche Views einrichten?

Also sollen z.B. Anfragen aus dem 5er Netz eine Domainweiterleitung bekommen, Anfragen aus dem 10er Netz aber nicht.

Ich habe nur sowas wie Sperrlisten und Zugriffslisten gefunden, aber das scheint nur pauschal zu erlauben bzw. verbieten.

Tipps?

/KNEBB

6
German - Deutsch / Zweifaches Backup?
« on: March 02, 2024, 07:33:35 pm »
Moin,

ich habe mir auf meinen OPNSense Boxen ein regelmäßiges Backup auf Nextcloud eingerichtet. Das funktioniert auch wunderbar.
Siehe Anhang: Eingestellt auf 05:03 Uhr täglich. Klappt auch, ich sehe die xml-Dateien im entsprechenden Nextcloud-Account. Allerdings sehe ich da noch ein weiteres Backup. Täglich um 01:09 Uhr.

Jetzt frage ich mich, wo das herkommt? Im Cron der UI ist nichts weiter eingeerichtet, auf Anhieb konnte ich auch via Konsole (/etc/crontab) nichts dieser Art feststellen...

Wo kommt das her?

Tipps?

Danke!

/KNEBB

7
German - Deutsch / Hilfe Glasfaser-Verkabelung
« on: January 30, 2024, 07:56:58 pm »
Moin,

ist zwar ein wenig OFf-Topic, aber vielleicht kann mir ja dennoch einer helfen.

Mein Glasfaseranschluß funktioniert grundsätzlich wunderbar. OPNSense gibt die PAkete mit VLAN 1118 and meinen Ethernetswitch, der hat an einem SFP-Port ein Modul stecken, das ebenfalls auf 1118 "tagged" konfiguriert ist. Von dem SFP-Modul geht es über ein 30mLWL-Kabel (blau-blau) zu eier LWL-Kupplung, bei dem auf der anderen Seite ein blauer Stecker steckt. Das andere Ende dieses Kabels ist grün und steckt in dem HAusanschlusskasten des Providers. Funktioniert soweit.

Nun wollte ich gerne noch einen Switch "dazwischen" hängen, um am anderen Ende der 30m Leitung auch noch lokales LAN (via VLAN +ber das Glasfaserkabel) zu haben.

Also nochmal zwei solcher SFP-Module bestell und in den für dort bestimmten Switch rein. Kabel umgestekct.... und dunkel war es!

Das Modul, in dem das Kabel vom Anschluss her kommt, hat "Link".
Das Kabel (30m), das von meinem anderen Switch kommt, hat keinen "Link".
Tausche ich die Module, hat immer nur das Verbindung, dass in Richtung Hausanschlusskasten geht.

Bin jetzt etwas verwirrt, sollte das nicht funktionieren?
Um es grafisch darzustellen.

Das hier geht:
             .---+---.                                              .---+---.                                .---+---.
Switch mit SFP  +----30m, 2x blaue Enden ------Kupplung--blau Kabel grün----+ Hausanschluss | WAN
             '---+---'                                               '---+---'                               '---+---'

Das hier geht nicht:
             .---+---.                                              .---+---.                                       .---+---.
Switch mit SFP  +----30m, 2x blaue Enden ------Switch 2x SFP--blau Kabel grün----+ Hausanschluss | WAN
             '---+---'                                               '---+---'                                       '---+---'

Oder muss ich ein dazu "umgekehrtes" Modul kaufen? Also anstelle 1310/1490 ein SFP mit 1490/1310?

Ich bitte um Aufklärung, bin da echt ein Noob bzgl. GF.

Danke!

/KNEBB


8
German - Deutsch / DHCP & Hostnamen dynamisch eintragen in Unbound?
« on: January 19, 2024, 11:01:17 am »
Moin,

ich habe im Netz einige Laptops, die sowohl per WLAN als auch per Ethernetkabel im NEtz sind. Manchmal auch beides gleichzeitig :D

Diese haben mit ihren beiden Interfaces jedenfalls per DHCP feste IP-ADressen zugewiesen. Das funktioniert auch einwandfrei. Jedes Interface bekommt immer die gleiche IP. Prima.

Nur: wie mache ich das mit dem Hostnamen? Ich möchte diese Laptops gerne immer auch mit Hostnamen ansprechen können. In Unbound habe ich dazu eine Überschreibung eingerichtet, die mir den Hostnamen auf die WLAN-IP bringt. Aber halt nur auf die WLAN-IP. Ja, ich kann jetzt auch eine zweite ÜBerschreibung mit dem gleichen Namen reinpacken mit der LAN-IP. Aber dann gilt ja vermutlich, dass der Unbound mal diese und mal die andere IP "ausliefert". Unabhängig davon, welche gerade aktiv ist.

Jetzt dachte ich, aknn ich dem DHCP Server sagen, er soll doch den Hostnamen eintragen. Ja, diese Option gibt es, aber wohl nur für einen "richtigen" DNS-Server, nicht für den eigenen Unbound.

Hat jemand eine Idee, wie ich den Namen sinnvoll dynamisch eintragen lassen kann?

Danke!

/KNEBB

9
23.7 Legacy Series / How to Ignore a Gateway on a DHCP Interface?
« on: January 12, 2024, 01:35:35 pm »
Hi all!

I have a local network where a DHCP server is running (not OPNSense!). It provides a default gateway to the clients. Unfortunately I can not change configuration of this DHCP server.

Now I have an interface on my OPNSense attached to this network, requesting an IP through DHCP.

The provided gateway is now visible in OPNSense which I do not need.

Is there a way to configure the interface to get an IP address through DHCP and ignore the provided gateway?

Thanks!

/KNEBB

10
23.7 Legacy Series / IPAM compatible to OPNSense?
« on: January 10, 2024, 01:22:55 pm »
Hi,

I am looking for an IP Adress Management tool which ist (more or less) compatible to OPNSense.
I am, responsible for two sites with some small networks. Regularly I am struggling which switch port is connected to a device, which VLAN the switch port is assigned to and which IP addresses match which name and vice versa.

So my first question:
Any recommendation for a really SOHO oriented IPAM (MacOS or Linux) which I can use to manage my networks?
Second,
if this tool would be able to read the settings from OPNSense DHCP static mappings and Unbound AND Firewall aliases it is the perfect tool for me!


Any ideas?

/KNEBB

11
23.7 Legacy Series / Bug? MultiWAN sending packets on wrong interface
« on: December 05, 2023, 04:11:17 pm »
Hi,

I have a Multi-WAN setup an configured it according to the documentation.

Now I tried to access my OPNSense Web-GUI on the configured port from Internet (WAN), but it failed on one of the interfaces.

After checking evry related items a packe capture revealed the reason why it fails:

OPNSense answers th request on the WAN1 interface with the (correct) source IP of the WAN1 interface but sends the packet out on WAN2 which is a different ISP and thus a different IP network. The ISP then obviously drops the packet with the wrong source IP.

Here's the result of the packet capture. ROTDSLDIREKT with $DSLIP is WAN2 and ROT with $GFIP is WAN1.
Code: [Select]
Schnittstelle Zeitstempel SRC DST output
ROTDSLDIREKT pppoe0 2023-12-04 10:50:35.769841 length 48: $GFIP.8443 > $INETPC.37505: tcp 0
ROTDSLDIREKT pppoe0 2023-12-04 10:50:35.942055 length 48: $GFIP.8443 > $INETPC.37507: tcp 0
ROTDSLDIREKT pppoe0 2023-12-04 10:50:37.984069 length 48: $GFIP.8443 > $INETPC.37505: tcp 0
ROT igc1 2023-12-04 10:50:34.751383 84:b8:02:e2:1d:40 dc:58:bc:e0:5c:60 IPv4, length 60: $INETPC.37505 > $GFIP.8443: tcp 0
ROT igc1 2023-12-04 10:50:34.879659 84:b8:02:e2:1d:40 dc:58:bc:e0:5c:60 IPv4, length 60: $INETPC.37507 > $GFIP.8443: tcp 0
 

Any ideas how to fix?
Or is this a bug?
BTW: I already asked in the German forum but I guess it is a very special topic so I did not get any reply.

/KNEBB

12
German - Deutsch / Web-GUI schickt Pakete auf falschem Interface raus
« on: December 04, 2023, 11:03:04 am »
Moin,

hier ist ein Multi-WAN setup. Einmal Glasfaser (feste IPv4) , einmal T-DSL (dynamische IPv4).

Ich möchte meine Web-GUI der OPNSense vom Internet erreichbar machen. Via https:// auf Port 8443. Einstellungen unter "System -> Einstellungen -> Verwaltung" im Screenshot (siehe Anlage1). Alle Schnittstellen sind aktiviert.

Auf der DSL-Adresse ($DSLIP) funktioniert das auch einwandfrei, aber auf der Glasfaser-IP ($GFIP) funktioniert es nicht. Ich bekomme dort keine Antwort.

Die Regeln auf beiden Interfaces sind identisch gesetzt (sieheScreenshots 2+3)

Gehe ich auf die Konsole der OPNSense sehe ich auch, dass auf allen Interfaces tatsächlich ein Prozess "lauscht":
Code: [Select]
root@opnsense:~ # sockstat -4 -l | grep 8443
root     lighttpd   52359 7  tcp4   *:8443                *:*

Dennoch ist der Port nicht offen:
Code: [Select]
root@inetpc:~# nmap $GFIP -p8443
Starting Nmap 7.93 ( https://nmap.org ) at 2023-12-04 10:46 CET
Nmap scan report for $GFIP
Host is up (0.026s latency).

PORT     STATE    SERVICE
8443/tcp filtered https-alt

Nmap done: 1 IP address (1 host up) scanned in 0.92 seconds

Auf $DSLIP sieht das dagegen gut aus:
Code: [Select]
root@inetpc:~# nmap $DSLIP -p 8443
Starting Nmap 7.93 ( https://nmap.org ) at 2023-12-04 10:47 CET
Nmap scan report for host.dip0.t-ipconnect.de ($DSLIP)
Host is up (0.020s latency).

PORT     STATE SERVICE
8443/tcp open  https-alt

Nmap done: 1 IP address (1 host up) scanned in 0.26 seconds

Mache ich ein Packettrace auf der $GFIP sehe ich die eingehenden Pakete, aber die ausgehenden Antwortpakete gehen über die $DSLIP mit der Absender-IP von $GFIP raus.:
Code: [Select]
  View capture
Schnittstelle Zeitstempel SRC DST output
ROTDSLDIREKT pppoe0 2023-12-04 10:50:35.769841 length 48: $GFIP.8443 > $INETPC.37505: tcp 0
ROTDSLDIREKT pppoe0 2023-12-04 10:50:35.942055 length 48: $GFIP.8443 > $INETPC.37507: tcp 0
ROTDSLDIREKT pppoe0 2023-12-04 10:50:37.984069 length 48: $GFIP.8443 > $INETPC.37505: tcp 0
ROT igc1 2023-12-04 10:50:34.751383 84:b8:02:e2:1d:40 dc:58:bc:e0:5c:60 IPv4, length 60: $INETPC.37505 > $GFIP.8443: tcp 0
ROT igc1 2023-12-04 10:50:34.879659 84:b8:02:e2:1d:40 dc:58:bc:e0:5c:60 IPv4, length 60: $INETPC.37507 > $GFIP.8443: tcp 0

Er schickt also ein Paket mit einer anderen Absender-IP über das $DSLIP Interface raus. Das wird dann vermutlich bei der Telekom irgendwie geblockt. Richtigerweise.

Ergänzung: Deaktiviere ich das Interface mit der$DSLIP, funktioniert es einwandfrei über $GFIP.

Ideen, woran das liegt?

/KNEBB

13
Tutorials and FAQs / Hint: Multi-WAN and some IoT vendors
« on: November 23, 2023, 01:25:49 pm »
Hi all,

just as a hint if some of you guys face similar issues.

I have a multi-WAN setup (so two different external IP addresses)My two gateways are configured in a group with same tier and round-robin enabled. It really works fine (despite of the dpinger issue to reset the DSL interface daily).

However, I have two IoT devices from iRobot which live in a separated VLAN but with full Internet access.

Since enabling my multiWAN I had serious connection errors in the app. One device was always connecting while the second one only rarely. I got "no connection" in the app very frequent.

I had a gut it is related to multi-WAN. So I created a second gateway group with my two interfaces but set one to tier1 and the second to tier2. And, tataaaa: my second device get a connection every time.


So there must be some logic on the vendor's side to have both devices on the same IP-address?

I don't know- just in case you have something similar, make sure your two devices use the same gateway.

/KNEBB


14
23.7 Legacy Series / Alias Name vs. Host Name
« on: November 22, 2023, 11:34:54 am »
Hi,

in firewall I make use of "Aliases". It is not allowed to use an alias name with an underscore ("_" - for what reason?).

Now I created an alias which points to a hostname. Which is configured in UnboundDNS as overwrite. In Unbound, I can not create a hostname with a Hyphen ("-").

This is at least somehow confusing as I am always getting dizzy of which hostname is now the correct one.

Regarding to RFC 2181 there is no such limitation on the hostname. Hostname can have either "-" or "_".

There should be either in alias more characters be allowed or let unbound allow correct hostnames.

Any thoughts?

/KNEBB

15
23.7 Legacy Series / Multi-WAN and dynamic IP not Compatible?
« on: November 10, 2023, 12:53:12 pm »
Hi,

I have a fixed IP fibre WAN connection (150Mbit) and one DSL dynamic IP WAN connection (100Mbit).

I configured them as Multi-WAN according to the documentation.
I put a weight of "2" to the (slower) DSL connection and a weight of 3 to the fibre line.

Once setup it works pretty fine. But as soon as the DSL line is periodically reset (every day at 5:55am) Opnsense will route only through the fibre line. Even though both gateway appear in "green" state it looks like nothing is send through DSL. Once I disable and re-enable the DSL line it starts again sending traffic through it.

This is the information I get with netflow (scroll to the right) and it shows the traffic being distributed between the two interfaces- until 5.55am. And redistributing when I reset the DSL interface at 12:30pm.


Additional question: why seems all outgoing trafic only going through the DSL line?

Anyone having an idea what might be wrong here?

Thanks
/KNEBB

Pages: [1] 2
OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2