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 - sco01

#1
20.7 Legacy Series / Re: Restart OpenVPN client
November 19, 2020, 04:55:58 PM
Thanks. I had in fact tried the suggestion in that post but without success. The problem is that:

/usr/local/etc/rc.d/client2 onestatus responds with client2 is not running when the client is up and running. The same applies for start and stop.

That thread is from 2018. Maybe something has changed since then?
#2
20.7 Legacy Series / Restart OpenVPN client
November 18, 2020, 09:46:47 PM
I have a problem that I've been fighting with for quite some time.

I have two OPNsense instances connected via a site-2-site OpenVPN tunnel. Node1 is acting as a client to Node2. About once every month (sometimes more) I wake up to a monit alarm telling me that Node2 is down. This means that the OpenVPN client on Node1 has crashed and I have to start it again. Troubleshooting this has been hard as all I can see in the log on Node1 is "openvpn[78610]: Exiting due to fatal error". I figured there must be some way to monitor the service and try to start it automatically if it is down as a workaround and so I went down the monit path. All went well until I had to configure a start script for the service. Is there a way to stop/start the OpenVPN client command line? Alternatively: How can i troubleshoot the root cause to prevent it from happening in the first place? 
#3
I think this may be a bug in FreeBSD but I'm not sure.

Telegraf uses netstat to pull the counters (see here: https://github.com/shirou/gopsutil/blob/master/net/net_freebsd.go#L19). It runs netstat -ibdnW and it looks like it takes the first entry for each interface (Link). The problem is that the command returns the same value over and over again but only for the first device (em0 in my case)

Example:


root@OPNsense:~ # netstat -ibdnW
Name        Mtu Network                  Address                                    Ipkts Ierrs Idrop     Ibytes    Opkts Oerrs     Obytes  Coll  Drop
em0        1500 <Link#1>                 00:15:17:a0:6a:da                          44296   504     0 17680705579    10954     0    2005083     0     0
em0           - fe80::%em0/64            fe80::215:17ff:fea0:6ada%em0                   0     -     -          0        6     -        336     -     -
em0           - 82.209.187.128/27        82.209.187.149                           6051436     -     - 8874534492  6070280     -  322586433     -     -
em1        1500 <Link#2>                 00:15:17:a0:6a:db                        3562759     0     0  451479188 13284089     0 17642901362     0     0
em1           - fe80::%em1/64            fe80::215:17ff:fea0:6adb%em1                   0     -     -          0        1     -         96     -     -
em1           - 192.168.0.0/24           192.168.0.1                               435054     -     -   33502003  6951591     - 8825493425     -     -

root@OPNsense:~ # netstat -ibdnW
Name        Mtu Network                  Address                                    Ipkts Ierrs Idrop     Ibytes    Opkts Oerrs     Obytes  Coll  Drop
em0        1500 <Link#1>                 00:15:17:a0:6a:da                          44296   504     0 17688104362    10954     0    2005083     0     0
em0           - fe80::%em0/64            fe80::215:17ff:fea0:6ada%em0                   0     -     -          0        6     -        336     -     -
em0           - 82.209.187.128/27        82.209.187.149                           6051762     -     - 8874585001  6070515     -  322604505     -     -
em1        1500 <Link#2>                 00:15:17:a0:6a:db                        3564057     0     0  451623136 13289557     0 17650327129     0     0
em1           - fe80::%em1/64            fe80::215:17ff:fea0:6adb%em1                   0     -     -          0        1     -         96     -     -
em1           - 192.168.0.0/24           192.168.0.1                               435363     -     -   33524826  6952012     - 8825556416     -     -



You can see how Obytes stays at 2005083 for em0 between the calls while the counter increases from 17642901362 to 17650327129 for em1.

I'm not sure if telegraf is doing the right thing when it takes the Link value. What do you think?
#4
Thanks. This solved the problem for me too. I guess the OpenVPN wizard should have added it automatically.
#5
Hi. I just migrated over to OPNsense and this is the first problem I have encountered.

I have configured Telegraf to report net stats to InfluxDB. The stats for em1 (LAN) works great but the value for bytes_sent on em0 (WAN) is the same value over and over again. The problem seems to be related to the Telegraf package but I'm not sure if this is specific to OPNsense or the FreeBSD package. Another user reported the exact same problem in March: https://community.influxdata.com/t/telegraf-inputs-net-not-correctly-reporting-bytes-sent-on-single-interface-freebsd/4308

I'm on v18.7 (fresh install)