OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of BusinessTux »
  • 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 - BusinessTux

Pages: [1]
1
Hardware and Performance / Second ZFS-Raid-Member doesn't boot after swap
« on: February 18, 2023, 11:52:52 am »
Hi there,

I have Scope-7 appliance with two ssd's. One of them is faulty, because my system didn't start after reboot this morning. After I removed the faulty one, OPNsense come online again.

So I swapped the ada1 device with a new one. This new ssd was not empty, but I backuped/restored the layout from ada0, like describe here.

Code: [Select]
root@OPNsense:~ # zpool attach zroot ada0p4 ada1p4
root@OPNsense:~ # zpool status
  pool: zroot
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Sat Feb 18 10:37:03 2023
        6.74G scanned at 363M/s, 1.13G issued at 60.9M/s, 6.74G total
        1.20G resilvered, 16.77% done, 00:01:34 to go
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada0p4  ONLINE       0     0     0
            ada1p4  ONLINE       0     0     0  (resilvering)

errors: No known data errors
root@OPNsense:~ # zpool status
  pool: zroot
 state: ONLINE
  scan: resilvered 6.98G in 00:01:52 with 0 errors on Sat Feb 18 10:38:55 2023
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada0p4  ONLINE       0     0     0
            ada1p4  ONLINE       0     0     0

errors: No known data errors
root@OPNsense:~ # dd if=/dev/ada0p1 of=/dev/ada1p1
532480+0 records in
532480+0 records out
272629760 bytes transferred in 97.602079 secs (2793278 bytes/sec)
root@OPNsense:~ # dd if=/dev/ada0p2 of=/dev/ada1p2
1024+0 records in
1024+0 records out
524288 bytes transferred in 0.065542 secs (7999318 bytes/sec)
root@OPNsense:~ # zpool status
  pool: zroot
 state: ONLINE
  scan: resilvered 6.98G in 00:01:52 with 0 errors on Sat Feb 18 10:38:55 2023
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada0p4  ONLINE       0     0     0
            ada1p4  ONLINE       0     0     0

errors: No known data errors
root@OPNsense:~ # gpart show
=>       40  468862048  ada0  GPT  (224G)
         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528   16777216     3  freebsd-swap  (8.0G)
   17311744  451549184     4  freebsd-zfs  (215G)
  468860928       1160        - free -  (580K)

=>       40  488397088  ada1  GPT  (233G)
         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528   16777216     3  freebsd-swap  (8.0G)
   17311744  451549184     4  freebsd-zfs  (215G)
  468860928   19536200        - free -  (9.3G)

I've copied ada0p1 for efi und ada0p2 for freebsd-boot via dd. But if I start the the applicance with only ada1 there is no bootable device.

How can I make ada1 bootable?

Thanks
Ulf




2
German - Deutsch / Erledigt: zfs boot loader hängt beim Neustart
« on: November 01, 2022, 08:14:19 pm »
Hallo zusammen,

ich suche momentan nach der Ursache, warum sich der OPNsense Bootloader beim Neustart aufhängt. Zuletzt hatte ich immer wieder diese zwei Ansichten, bei denen die Einsen immer weiter gezählt haben, aber nichts passiert ist (siehe Bilder im Anhang). Nach mehrmaligem Reset ist die Maschine dann hochgefahren (Landitec     scope7-303-Fiber R).

Der Spiegel aus zwei 240 GB SSDs sieht für mich aber in Ordnung aus.
Code: [Select]
root@OPNsense:~ # zpool status
  pool: zroot
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada0p4  ONLINE       0     0     0
            ada1p4  ONLINE       0     0     0

errors: No known data errors

In welche Richtung kann ich suchen, um den nächsten Neustart etwas entspannter zu erleben?

Danke
Ulf

3
Virtual private networks / [Solved] Second IPsec Site2Site Tunnel down
« on: December 29, 2021, 08:02:53 pm »
Hi at all,

I have a problem with a setup on three locations with with two ipsec S2S tunnels to the main office.

I've configured two routed IPSec Tunnels, like described here: https://docs.opnsense.org/manual/how-tos/ipsec-s2s-route.html.

Homeoffice 1          Main Office                Homeoffice 2
100.64.21.2/30      100.64.21.1/30
                              100.64.22.1/30        100.64.22.2/30
                   
                   
The tunnel to Homeoffice 1 works like a charm. The tunnel to Homeoffice2 is active, but routing isn't functionally.

In short:
- WAN-Rules in Firewall (IPSec, ISAKMP, ESP) are active on all three locations
- Gateways for both home office are created and configured as "far gateway"
- Routes for the remote networks of both home offices are created in the main office
- Routes for the networks of the main office are created in both home offices
- Firewall-Rules on ipsec interface in the main office are created
- Firewall-Rules on ipsec interface in the home offices are created


Traceroute main office to Homeoffice 1: works
Traceroute main office to Homeoffice 2: hangs on main office gateway

The route to home office 2 is in the active routing table of then main office gateway.

But the mainofficerouter says network is down:
Code: [Select]
root@mainofficerouter:~ # ping -t 3 100.64.22.2
PING 100.64.22.2 (100.64.22.2): 56 data bytes
ping: sendto: Network is down

I doublechecked all configurations twice, but I can't figure it out.

The box versions are

mainofficerouter: OPNsense 21.10.2 (amd64/OpenSSL)
homeoffice 1:       OPNsense 21.7.7 (amd64/OpenSSL)
homeoffice 2:       OPNsense 21.10.2 (amd64/OpenSSL)

My ipsec.conf (completely generated)
Code: [Select]
root@mainofficerouter:~ # cat /usr/local/etc/ipsec.conf
# This file is automatically generated. Do not edit
config setup
  uniqueids = yes

conn con1
  aggressive = no
  fragmentation = yes
  keyexchange = ikev2
  mobike = yes
  reauth = yes
  rekey = yes
  forceencaps = no
  installpolicy = no
  type = tunnel





  left = 80.153.119.52
  right = custwar02.edvnet.biz
  rightallowany = yes
  leftid = userfqdn:site2siteHQBN@cust-bonn.de
  ikelifetime = 28800s
  lifetime = 3600s
  ike = aes256-sha512-modp2048!
  leftauth = pubkey
  rightauth = pubkey
  leftcert = /usr/local/etc/ipsec.d/certs/cert-1.crt
  leftsendcert = always
  rightca = "/C=DE/ST=NRW/L=Bonn/O=cust XXXXXX GmbH/OU=cust XCA/CN=custVpnCA/emailAddress=edv@cust-bonn.de/"
  rightid = userfqdn:site2sitehowa@cust-bonn.de
  reqid = 1
  rightsubnet = 0.0.0.0/0
  leftsubnet = 0.0.0.0/0
  esp = aes256-sha512-modp2048!
  auto = add

conn con2
  aggressive = no
  fragmentation = yes
  keyexchange = ikev2
  mobike = yes
  reauth = yes
  rekey = yes
  forceencaps = no
  installpolicy = no
  type = tunnel





  left = 80.153.119.52
  right = custror02.edvnet.biz
  rightallowany = yes
  leftid = userfqdn:site2siteHQBN@cust-bonn.de
  ikelifetime = 28800s
  lifetime = 3600s
  ike = aes256-sha512-modp2048!
  leftauth = pubkey
  rightauth = pubkey
  leftcert = /usr/local/etc/ipsec.d/certs/cert-2.crt
  leftsendcert = always
  rightca = "/C=DE/ST=NRW/L=Bonn/O=cust XXXXXX GmbH/OU=cust XCA/CN=custVpnCA/emailAddress=edv@cust-bonn.de/"
  rightid = userfqdn:site2sitehoro@cust-bonn.de
  reqid = 2
  rightsubnet = 0.0.0.0/0
  leftsubnet = 0.0.0.0/0
  esp = aes256-sha512-modp2048!
  auto = add

include ipsec.opnsense.d/*.conf

Where is my error?

4
German - Deutsch / [Gelöst] Intranet von Android über SSL VPN nicht aufrufbar
« on: July 18, 2021, 05:38:32 pm »
Hallo zusammen,

ich stehe gerade vor dem Rätsel, warum interne Webseiten über einen SSL VPN auf Android-Geräten nicht erreichbar sind. Mit der gleichen SSL-VPN-Verbindung auf einem Windows-Rechner kann ich die Webseiten aufrufen.

Ziel ist, dass ich die Apps von Synology oder Unifi direkt auf dem Handy/Tablet nutzen kann, wenn ich mich per VPN nach Hause verbunden habe.

Aktuell kann ich die OpenVPN-Verbindung sowohl von Android, als auch von Windows-Geräten erfolgreich verbinden. Aber nur auf Windows kann ich danach im Browser die jeweiligen Webseiten im interenen LAN aufrufen (Unifi, Synology, Netbox).

Auf dem Android-Geräte (hier Tablet) sieht netzwerktechnisch alles ok aus.
* VPN ist verbunden
* In der Routing-Tabelle zeigen die konfigurierten Einträge auf das tun-Device
* Ein Portscan zeigt die offenen Ports

Und trotzdem kommt es zu einem Timeout, wenn ich die interne Webseite im Browser aufrufe. Gleiches gilt dann natürlich für die Android-Apps.


Netzwerk-Aufbau:
Code: [Select]
#
# Stand: 18.07.2021
#

   WAN / Internet                       WAN / Internet
         :                                    :
         : Mobilfunk (Telekom)                : Telekom/VDSL 100
         :                                    :
    .----+----------.                   .-----+----------.
    |  LTE-Gateway  |                   |  VDSL-Gateway  |  (Zyxel VMG3006-D70A)
    '----+----------'                   '-----+----------'
         | 192.168.8.1/24                     |
         |                                    |
         |   Gatewaygruppe WANGWGroup         |
         \----------  ------------------------/
                    \/
   192.168.8.104/24 || PPPoE
             Tier 2 || Tier 1
  WANLTE (opt2,re3) || WAN (wan,re0)
                    ||
    .---------------::----------------------.
    |  OPNsense.opn.mydomain.com            |
    |  21.1.7_1-amd64                       |- IPsec 100.64.1.0/24
    |  CPU: i3-4130T 4x2,9 GHz              |- ovpn1 100.64.2.0/24
    |  RAM/HDD: 8GB / 2x128 GB SSD Mirror   |
    '--------------:---------:--:-----------'
                   |      re1|  | re2
                   |          \/   
                   |          ++--lagg0
                   |          ||  |
                   |          ||  |    VLAN            IP            Subnet           DHCPv4  OPT
       10.0.1.253  |          ||  +--- 20 Intra        10.0.2.253    10.0.2.0/24        off   opt4
  MGMT (lan,alc0)  |          ||  +--- 30 Gäste        10.0.3.253    10.0.3.0/24        off   
      10.0.1.0/24  |          ||  +--- 40 Test         10.0.4.253    10.0.4.0/24        off   opt3
                   |          ||  +--- 41 WLAN intern  192.168.1.253 192.168.1.0/24     off 
                   |          ||  +--- 70 IoT          10.0.7.253    10.0.7.0/24        on    opt1
                   |          ||
                   |          ||
                   |          ||
                   |          ||
      .------------+------.   ||
      | LAN-Switch        +---'|
      | Unifi USW-48      +----'
      '-----+-+-+-+-+-----'
            | | | | |
            | | | | '----... (Netzwerkdevices/Servers)  VLAN 10  mgmt.mydomain.com
            | | | |
            | | | '------... (Clients/Servers)          VLAN 20 intra.mydomain.com
            | | |
            | | '--------... (Clients)                  VLAN 30
            | |
            | '----------... (Clients/Servers)          VLAN 40  test.mydomain.com
            |
            '------------... (IoT Devices)              VLAN 70   han.mydomain.com
           

Aktivierte Dienste
- C-ICAP
- ClamAV
- DHCPv4
- Dynamisches DNS
- Unbound DNS
- Web-Proxy
  + http
  + https
  + transparent proxy
  + ICAP
  + Remote Access Lists
- VPN-Server
  + IPsec
    * Site2Site
  + OpenVPN
    * SSL VPN   

DHCPv4 auf Schnittstelle VLAN 70
- Subnetz       10.0.7.0
- Subnetzmakse  255.255.255.0
- Bereich       10.0.7.100 - 10.0.7.199
- DNS-Server    10.0.7.253 (OPNsense)
- Gateway       10.0.7.253 (OPNsense)
- Domain Name   han.mydomain.com

DHCPv4 auf Schnittstelle MGMT
- Subnetz       10.0.1.0
- Subnetzmakse  255.255.255.0
- Bereich       10.0.1.100 - 10.0.1.199
- DNS-Server    10.0.1.253 (OPNsense)
- Gateway       10.0.1.253 (OPNsense)
- Domain Name   mgmt.mydomain.com

Hat jemand eine Idee für mich, warum es auf Window funktioniert und auf Android nicht?

Danke

5
German - Deutsch / [SOLVED] resolv.conf nach Hardware-Neustart falsch
« on: October 31, 2020, 02:53:02 pm »
Hallo zusammen,

ich bin aktuell dabei meine Netzwerke zu Hause von einem Lancom-Router auf die OPNsense mit MultiWAN umzubauen. Bisher habe ich lediglich zwei Subnets umgebaut, Hausautomation und Test.

Nach dem letzten Update auf 20.7.4 ist mir aufgefallen, dass mein Hausautomations-Netzwerk nicht mehr richtig läuft. Ursache war, dass die DNS-Auflösung auf der OPNsense nicht mehr funktioniert hat. Da diese DNS- und DHCP-Server für das Hausautomationsnetzwerk ist, ist es nur dort aufgefallen.

Zusätzlich haben dann auch ein Großteil meiner Firewall-Regeln nicht mehr funktioniert, da die Firewall-Aliase nicht aufgelöst werden konnten und damit die entsprechenden pfTables leer waren :-(.

Bedingt durch MultiWAN und den Unbound-DNS-Server sieht meine resolv.conf auf der OPNsense standardmäßig so aus:
Code: [Select]
root@OPNsense:~ # cat /etc/resolv.conf
domain opn.mydomain.com
nameserver 127.0.0.1
nameserver 192.168.8.1
nameserver 192.168.165.1
nameserver 8.8.8.8
nameserver 9.9.9.9

Wird die OPNsense-Installation neugestartet, sieht sie nur noch so aus:
Code: [Select]
root@OPNsense:~ # cat /etc/resolv.conf
# Generated by resolvconf
nameserver 10.0.4.2

Beheben kann ich das nur, indem ich in "Dienste: Unbound DNS: Allgemein" einmal speichere und die Änderungen anwende. Danach sieht die resolv.conf wieder so aus, wie im ersten Block.

Für mich stellen sich die folgenden Fragen:
  • Warum wird die resolv.conf mit falschen Werten befüllt?
  • Warum wird gerade diese IP-Adresse eingetragen? Das ist der DC meines Test-Netzwerkes.
  • Gibt es eine Möglichkeit das Speichern/Anwenden von Unbound DNS zu automatisieren (als Workaround)
  • Ist das ein Fehler oder habe ich was falsch konfiguriert?

Hier zum bessern Verständnis noch mein Netzaufbau (ohne Lancom-Router)
Code: [Select]
   WAN / Internet                       WAN / Internet
         :                                    :
         : Mobilfunk (Telekom)                : /PPPoE/Telekom/VDSL 100
         :                                    :
    .----+----------.                   .-----+----------.
    |  LTE-Gateway  |                   |  VDSL-Gateway  |  (Vigor 165)
    '----+----------'                   '-----+----------'
         | 192.168.8.1/24                     | 192.168.165.1/24
         |                                    |
         |   Gatewaygruppe WANGWGroup         |
         \----------  ------------------------/
                    \/
   192.168.8.104/24 || 192.168.165.11
             Tier 2 || Tier 1
  WANLTE (opt2,re3) || WAN (wan,re0)
                    ||
    .---------------::----------------------.
    |  OPNsense.opn.mydomain.com            |
    |  20.7.4-amd64                         |
    |  CPU: i3-4130T 4x2,9 GHz              |
    |  RAM/HDD: 8GB / 2x128 GB SSD Mirror   |
    '--------------:---------:--:-----------'
                   |      re1|  | re2
                   |          \/   
                   |          ++--lagg0
                   |          ||  |
                   |          ||  |    VLAN            IP            Subnet           DHCPv4  OPT
       10.0.1.253  |          ||  +--- 20 Intra        10.0.2.253    10.0.2.0/24        off   opt4
  MGMT (lan,alc0)  |          ||  +--- 30 Gäste        10.0.3.253    10.0.3.0/24        off   
      10.0.1.0/24  |          ||  +--- 40 Test         10.0.4.253    10.0.4.0/24        off   opt3
                   |          ||  +--- 41 WLAN intern  192.168.1.253 192.168.1.0/24     off 
                   |          ||  +--- 70 IoT          10.0.7.253    10.0.7.0/24        on    opt1
                   |          ||
                   |          ||
                   |          ||
                   |          ||
      .------------+------.   ||
      | LAN-Switch        +---'|
      | Unifi USW-48      +----'
      '-----+-+-+-+-+-----'
            | | | | |
            | | | | '----... (Netzwerkdevices/Servers)  VLAN 10  mgmt.mydomain.com
            | | | |
            | | | '------... (Clients/Servers)          VLAN 20 intra.mydomain.com
            | | |
            | | '--------... (Clients)                  VLAN 30
            | |
            | '----------... (Clients/Servers)          VLAN 40  test.mydomain.com
            |
            '------------... (IoT Devices)              VLAN 70   han.mydomain.com
           

Aktivierte Dienste
- C-ICAP
- ClamAV
- DHCPv4
- Dynamisches DNS
- Unbound DNS
- Web-Proxy
  + http
  + https
  + transparent proxy
  + ICAP
  + Remote Access Lists

DHCPv4 auf Schnittstelle VLAN 70
- Subnetz       10.0.7.0
- Subnetzmakse  255.255.255.0
- Bereich       10.0.7.100 - 10.0.7.199
- DNS-Server    10.0.7.253 (OPNsense)
- Gateway       10.0.7.253 (OPNsense)
- Domain Name   han.mydomain.com

Bisher habe ich nur diesen Fehler gefunden: https://github.com/opnsense/core/issues/2828, der etwas ähnlich aussieht. Der Workaround einen Neustart des Unbound DNS in den Start einzubauen, hat leider nicht geholfen. Nur ein erneutes Anwenden der gespeicherten Konfiguration triggert bei mir ein erneutes Erzeugen der resolv.conf.

Hat jemand Tipps für mich, wie diesen Fehler beheben umgehen kann?

Danke
Ulf

6
German - Deutsch / DHCP Client-Registrierungen für DNS-Subdomain pro VLAN
« on: October 03, 2020, 03:03:23 pm »
Hallo zusammen,

ich arbeite mich gerade in OPNsense ein, um etwas flexibler in der Konfiguration zu werden. Mein Aufbau sieht aktuell so aus:
Code: [Select]
        WAN / Internet
              :
              : DialUp-/PPPoE-/Cable-/whatever-Provider
              :
        .-----+-----.
        |  Gateway  |  (Vigor 165)
        '-----+-----'
              | 192.168.165.1/24
    WAN (em1) |
192.168.165.11|
      .-------:-----------------------------.
      |  OPN:sense    20.7.3-amd64          |
      |  (Br:dge)                           |
      '-------:--------------:-:-:-:--------'
    10.0.1.253|               \/         VLAN            IP            Subnet           DHCPv4
   MGMT (em0) |               || LAGG0 - 20 Intra        10.0.2.253    10.0.2.0/24        off
  10.0.1.0/24 |               ||       - 30 Gäste        10.0.3.253    10.0.3.0/24        off
              |               ||       - 40 Test         10.0.4.253    10.0.4.0/24        off
              |               ||       - 41 WLAN intern  192.168.1.253 192.168.1.0/24     off
              |               ||       - 70 IoT          10.0.7.253    10.0.7.0/24        on
              |               ||
              |               ||
              |               ||
      .-----+-------------.   ||
      | LAN-Switch        +---'|
      | Unifi USW-48      +----'
      '-----+-+-+-+-+-----'
            | | | | |
            | | | | '----... (Netzwerkdevices/Servers)  VLAN 10  mgmt.mydomain.com
            | | | |
            | | | '------... (Clients/Servers)          VLAN 20 intra.mydomain.com
            | | |
            | | '--------... (Clients)                  VLAN 30
            | |
            | '----------... (Clients/Servers)          VLAN 40  test.mydomain.com
            |
            '------------... (IoT Devices)              VLAN 70   han.mydomain.com

Ich möchte meine Subnets eins nach dem anderen von meinem bisherigen Router (Lancom) umstellen auf die OPNsense. Dazu soll funktionieren
  • Clients soll eine IPv4-Adresse per DHCP bekommen
  • pro VLAN soll eine eigene DNS-Subdomain verwendet werden
  • OPNsense soll die DNS-Namen der DHCP-Clients ausliefern
  • es sollen statische DHCP-Reservierungen möglich sein

Testweise habe ich schon mal den DHCP-Server auf dem Lancom deaktiviert, so dass die OPNsense die IP-Adressen verteilt. Den Unbound-Server habe ich eingestellt, dass der DHCP-Leases und statische DHCP Reservierungen registriert.

Der DHCP-Server ist wie folgt eingerichtet:
Code: [Select]
DHCPv4 auf Schnittstelle VLAN 70
- Subnetz       10.0.7.0
- Subnetzmakse  255.255.255.0
- Bereich       10.0.7.100 - 10.0.7.199
- DNS-Server    10.0.7.253 (OPNsense)
- Gateway       10.0.7.253 (OPNsense)
- Domain Name   han.mydomain.com

Beim Testen ist mir dann aufgefallen, dass die dynamische DHCP-Hostnamen mit der Domain der OPNsense verknüpft werden (testhanvm2.mgmt.mydomain.com) und nicht mit der Domain die im DHCP-Servers eingetragen ist (testhanvm.han.mydomain.com):
Code: [Select]
root@OPNsense:~ # unbound-control -c /var/unbound/unbound.conf list_local_data | grep -i han
10.0.7.101.     3600    IN      PTR     testhanvm2.opn.mydomain.com.
OPNsense.han.mydomain.com.     3600    IN      A       10.0.7.253
testhanvm.han.mydomain.com.    3600    IN      A       10.0.7.201
testhanvm2.mgmt.mydomain.com.   3600    IN      A       10.0.7.101
101.7.0.10.in-addr.arpa.        3600    IN      PTR     testhanvm2.mgmt.mydomain.com.
201.7.0.10.in-addr.arpa.        3600    IN      PTR     testhanvm.han.mydomain.com.
253.7.0.10.in-addr.arpa.        3600    IN      PTR     OPNsense.han.mydomain.com.

Die statischen DHCP-Reservierungen (testhanvm) werden korrekt im Unbound DNS eingetragen.

Mein Workaround war jetzt der OPNsense eine eigene Subdomain (opn.mydomain.com) zu geben und diese Subdomain per DHCP als searchlist zu verteilen. Das klappt auch.

Wie bekomme ich die Subnet-/VLAN-spezifische DNS-Domain in die Einträge der DHCP-Clients?

Danke
Ulf

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