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

Messages - hboetes

#1
Thanks for the excellent addition, gilvanio!
#2
Hast du das CA deiner ACME Server schon installiert?
#3
I just replaced the certificate and noticed I have to manually replace the used certificate entry in the web interface, in the radius server, in the OpenVPNs. And since I forgot about the radius server the company couldn't use WLAN until I fixed that.

Wouldn't it be nice if you could simply designate one certificate as the default certificate and that after that all services that depend on it use the default certificate and get restarted if needs be?
#4
20.7 Legacy Series / Re: lost wan ip
January 07, 2021, 12:40:38 PM
I can think of 2 solutions, you can explain your family to reconnect the external cable after the connection got restored.

You could also set up a cronjob which checks internet connection with a ping to the gateway and restarts if it's unreachable.
#5
To warn me before certificates expire I wrote this little script. I hope this might be useful to someone.

If anyone knows about a more elegant method — preferably already implemented in opnsense itself — please let me know.


#!/bin/sh
# Email recipient of the warning emails.
recp=root
# List of servers
servers="firewall01 firewall02 firewall03"

nextmonth=$(TZ=GMT LC_TIME=C date '+%b.*%Y' --date='00:00 next Month')
for server in $servers; do
    exp=$(ssh root@$server openssl x509 -in /var/etc/cert.pem -text -noout | grep 'Not After')
    if echo $exp|grep -q $nextmonth; then
        msg="${server}'s certificate is about to expire, go fix that ASAP"
        echo "$msg" | mail -s "$msg" $recp
    fi
done

#6
20.7 Legacy Series / Re: lost wan ip
November 19, 2020, 12:09:14 PM

  • According to the local network engineer there was a power outage, because of the UPS our devices didn't shut down.
  • dhclient kept asking for an ip, even though the dhcpserver was already up it kept reporting it had no route to it.
  • Restarting dhclient(by pressing the save button)got dhclient working again.
#7
20.7 Legacy Series / lost wan ip
November 19, 2020, 11:08:35 AM
Yesterday I was called out of bed because one of our VPNs was down. When I finally got access to the remote OPNsense box, with the help of a junior support engineer who was on site, I discovered the WAN interface had no external IP. So I pressed the save button to restart dhclient and lo and behold the interface came up again.

I just checked the log output and it sort of baffles me. Have a look for yourself.


# strings system.log | sort | grep dhclient
(SNIP)
Nov 18 09:16:47 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:17:01 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:17:01 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:17:18 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:17:18 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:17:56 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:17:56 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:19:24 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:19:24 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:21:52 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:21:52 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:22:08 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:22:08 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:22:22 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:22:22 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:22:50 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:22:50 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:23:32 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:23:32 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:24:25 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:24:25 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:25:52 kiwifw dhclient[3610]: send_packet: No route to host
Nov 18 09:25:52 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 09:27:43 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 255.255.255.255 port 67
Nov 18 09:29:18 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 255.255.255.255 port 67
Nov 18 09:32:30 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 255.255.255.255 port 67
Nov 18 09:34:27 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 255.255.255.255 port 67
Nov 18 09:37:39 kiwifw dhclient[43029]: DHCPREQUEST on igb1 to 255.255.255.255 port 67
Nov 18 09:39:03 kiwifw dhclient[3610]: connection closed
Nov 18 09:39:03 kiwifw dhclient[3610]: exiting.
Nov 18 09:39:04 kiwifw dhclient: Comparing IPs: Old: 192.168.2.116 New: 
Nov 18 09:39:04 kiwifw dhclient: Comparing IPs: Old: 192.168.2.116 New: 192.168.2.116
Nov 18 09:39:04 kiwifw dhclient: Creating resolv.conf
Nov 18 09:39:04 kiwifw dhclient: New Broadcast Address (igb1): 192.168.2.255
Nov 18 09:39:04 kiwifw dhclient: New IP Address (igb1): 192.168.2.116
Nov 18 09:39:04 kiwifw dhclient: New Routers (igb1): 192.168.2.1
Nov 18 09:39:04 kiwifw dhclient: New Subnet Mask (igb1): 255.255.255.0
Nov 18 09:39:04 kiwifw dhclient: Removing states from old IP '192.168.2.116' (new IP '')
Nov 18 09:39:04 kiwifw dhclient: Starting delete_old_states()
Nov 18 09:39:04 kiwifw dhclient: Starting delete_old_states()
Nov 18 09:39:04 kiwifw dhclient: route add default 192.168.2.1
Nov 18 09:39:04 kiwifw dhclient[57449]: DHCPACK from 192.168.2.1
Nov 18 09:39:04 kiwifw dhclient[57449]: DHCPREQUEST on igb1 to 255.255.255.255 port 67
Nov 18 09:39:07 kiwifw dhclient[57449]: bound to 192.168.2.116 -- renewal in 43200 seconds.
Nov 18 21:39:04 kiwifw dhclient: Creating resolv.conf
Nov 18 21:39:04 kiwifw dhclient[7973]: DHCPACK from 192.168.2.1
Nov 18 21:39:04 kiwifw dhclient[7973]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 18 21:39:04 kiwifw dhclient[7973]: bound to 192.168.2.116 -- renewal in 43200 seconds.
Nov 19 09:39:04 kiwifw dhclient: Creating resolv.conf
Nov 19 09:39:04 kiwifw dhclient[7973]: DHCPACK from 192.168.2.1
Nov 19 09:39:04 kiwifw dhclient[7973]: DHCPREQUEST on igb1 to 192.168.2.1 port 67
Nov 19 09:39:04 kiwifw dhclient[7973]: bound to 192.168.2.116 -- renewal in 43200 seconds.


Apparently the provider does something to the network at night, I can't tell what.

I like the flexibility of DHCP ensuring that whatever the external provider changes things keep working. But in this case dhclient wasn't very resilient in keeping the connection working.

What are your thoughts on the matter?
#8
The 4g gateway of our guest WLAN often crashes, after which I have to restart the DHCP client on the opnsense firewall so it picks up the changes. Now restarting the 4g gateway is something my colleagues can do without me, but for restarting the DHCP client you need access. I already set up monitoring the gateway, but how can I ensure the WAN interface is restarted? Or is there a more elegant solution?

Thanks!
Han
#9
19.7 Legacy Series / seting up high availability
April 03, 2019, 11:02:55 AM
Hi there,

We were already using OPNsense as a VM and have now bought a hardware appliance. Of course the VM was not set up with a full trunk, but with separate interfaces, for each VLAN one interface.
The appliance obviously becomes a trunk and will get VLANs as network interfaces.

Is this a problem when setting up a HA and config synchronisation?
#11
Taraaa, that fixes the problem.  :)
#12
Hi there,

So the error is: "DHCP Server is currently enabled. Cannot enable the DHCP Relay service while the DHCP Server is enabled on any interface."

Well it's not enabled.

After googling that I found this: https://forum.netgate.com/topic/42997/can-t-enable-dhcp-relay

So I made a config backup and searched for dhcp and found:


  <dhcpd>                                                                                                                                                                                                                                                     
    <lan>                                                                                                                                                                                                                                                     
      <range>                                                                                                                                                                                                                                                 
        <from>10.10.10.10</from>                                                                                                                                                                                                                               
        <to>10.10.10.245</to>                                                                                                                                                                                                                                 
      </range>                                                                                                                                                                                                                                                 
    </lan>                                                                                                                                                                                                                                                     
    <opt2>                                                                                                                                                                                                                                                     
      <enable>1</enable>                                                                                                                                                                                                                                       
      <gateway>10.10.30.1</gateway>                                                                                                                                                                                                                           
      <domain>axis-guest</domain>                                                                                                                                                                                                                             
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>                                                                                                                                                                                                     
      <numberoptions/>                                                                                                                                                                                                                                         
      <range>                                                                                                                                                                                                                                                 
        <from>10.10.30.100</from>                                                                                                                                                                                                                             
        <to>10.10.30.200</to>                                                                                                                                                                                                                                 
      </range>                                                                                                                                                                                                                                                 
      <dnsserver>1.1.1.1</dnsserver>                                                                                                                                                                                                                           
      <dnsserver>8.8.8.8</dnsserver>                                                                                                                                                                                                                           
    </opt2>                                                                                                                                                                                                                                                   
    <opt3>                                                                                                                                                                                                                                                     
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>                                                                                                                                                                                                     
      <numberoptions/>                                                                                                                                                                                                                                         
      <range>                                                                                                                                                                                                                                                 
        <from>10.10.40.10</from>                                                                                                                                                                                                                               
        <to>10.10.40.240</to>                                                                                                                                                                                                                                 
      </range>                                                                                                                                                                                                                                                 
      <dnsserver>10.10.10.11</dnsserver>                                                                                                                                                                                                                       
      <dnsserver>10.10.10.12</dnsserver>                                                                                                                                                                                                                       
    </opt3>                                                                                                                                                                                                                                                   
    <opt5>                                                                                                                                                                                                                                                     
      <ddnsdomainalgorithm>hmac-md5</ddnsdomainalgorithm>                                                                                                                                                                                                     
      <numberoptions>                                                                                                                                                                                                                                         
        <item/>                                                                                                                                                                                                                                               
      </numberoptions>                                                                                                                                                                                                                                         
      <range>                                                                                                                                                                                                                                                 
        <from>172.16.6.200</from>                                                                                                                                                                                                                             
        <to>172.16.6.250</to>                                                                                                                                                                                                                                 
      </range>                                                                                                                                                                                                                                                 
      <winsserver/>                                                                                                                                                                                                                                           
      <dnsserver/>                                                                                                                                                                                                                                             
      <ntpserver/>                                                                                                                                                                                                                                             
    </opt5>                                                                                                                                                                                                                                                   
  </dhcpd>
                                                                                                                                                                                                                                                   

That opt2 config with the enabled dhcp entry is from an old removed interface. So apparently removing an interface does not remove the dhcp entry and after that you can't remove the matching dhcp entry.
I tried working around the issue by enabling dhcp on another interface and then removing it again. Still the same entry remains.

I will now try downloading the config and editing it, as mentioned in the linked URL.

I think this is a bug. Is this a valid report or should I report it elsewhere?

Thanks
Han
#13
After hours of fiddling with a peer to peer SSL that did not work, whereas a peer to peer with shared key did work the following workaround:

Set the tunnel network to a /30

Let me explain: First I set the tunnel network to a /24, and then I noticed the IP on the client side of the tunnel was 10.3.0.6 and 5 and on the server side of the tunnel it was 10.3.0.1 and 2 and the route from the server to the client was pointed at 10.3.0.2.

So then I added the option topology30, which fixed the IP addresses, but no traffic was possible to the client.

After that I came up with a clever workaround, use a /30 for the tunnel network and disable the topology30 option. And... lo and behold... I got my SSL encrypted site to site working.

#14
Hi there,

We were already using OPNsense as a VM and have now bought a hardware appliance. Of course the VM was not set up with a full trunk, but with separate interfaces, for each VLAN one interface.
The appliance obviously becomes a trunk and will get VLANs as network interfaces.

Is this a problem when setting up a HA and config synchronisation?
#15
Tutorials and FAQs / Freeipa LDAP authentication HOWTO.
January 04, 2019, 01:30:39 PM
We have a FreeIPA server for authentication and to allow group members of sysadmins and firewallobservers to access via LDAP I proceeded like this:


  • Import the FreeIPA CA if you didn't already, it's probaby on your worstation over here:/etc/ipa/ca.crt
  • Create a user in Freeipa: opnsense, with a strong password
  • Create a group firewallobservers and add the right users to this group, I already had a sysadmin group.
  • In opensense: System → Access → Add a server like in the screenshot, always use the full LDAP account names, with the FQDN.
  • In the extended query you can decide which groups have access to the firewall: Since it's hard to read:
    |(memberof=cn=systemadministration,cn=groups,cn=accounts,dc=example,dc=com)(memberof=cn=firewallobservers,cn=groups,cn=accounts,dc=example,dc=com)



After that you can go to testers and check if everything works. If that works you can go to users and press the cloud button at the right to import the FreeIPA users. Add them to the right groups and Bob's your uncle.  8)

If there is anything unclear, please let me know and I'll improve this How-to.