Packets go through, logging is set, but no logs of the traffic
-
It will only log when a new state is opened. An OpenVPN connection like that could be open for months so it's possible any states you see were created before you enabled logging?
-
@silviub said in Packets go through, logging is set, but no logs of the traffic:
What's going on ?!
You were close
Added to what stephenw10 said, go here : Diagnostics > States > States and check the "State Table" box.
Then go for the orange Reset button.
A side effect exists : you also 'kill' your connection the the GUI.
You'll actually kill the connection for everybody ^^ -
@stephenw10
I appreciate the reply, but there isn't really any client here. It's just me, runningnc -u <ip> 1194
and sending some data, therefore the connections are always "new".
@Gertjan as I said, this is not really (yet) alive, because I'm just testing stuff out. But I had clients connect and disconnect and I didn't see them in the logs, so I started to manually test.Any way to log ALL connections, not just new connections? Maybe....?
Any other ideas? -
Ok, so to confirm you see states and packets on the rule as shown in the gui?
Try reloading the ruleset in Status > Filter Reload and make sure it loads cleanly without errors.
-
@stephenw10 Yes, I can see the states and packets next to the rule.
The firewall loads with no issues, just did it.Nothing changed.
-
Hmm, OK. Check the actual ruleset in /tmp/rules.debug. Do you see your custom rule? Does it have 'log' set?
-
@stephenw10
pass in log quick on $WAN reply-to ( vtnet0 a.b.c.d ) inet proto udp from any to 10.151.0.5 port 1194 ridentifier 1702983321 keep state label "USER_RULE: OpenVPN" label "id:1702983321"
Yes, it seems to have the log stanza (pass in log quick).
-
@silviub said in Packets go through, logging is set, but no logs of the traffic:
but there isn't really any client here
Just a refresher coarse.. client device requests... server listens and grants. rinse and repeat.
Very basic.. Cant have a connection between two computers without that.
Carry on.
-
@chpalmer while you're technically right, I was replying to stephenw10, who said
An OpenVPN connection like that could be open for months so it's possible any states you see were created before you enabled logging?
So, in that regard, there wasn't a VPN client that kept the connections open. Please read above.
-
Is the firewall logging anything? If you create some other rule as a test with logging does it work as expected?
-
@stephenw10 Yes, it does. And weirdly enough, some packets in this rule are logged, while others are not. I tried from two different public IPs to
nc -u <IP> <port>
and one got logged, one didn't, even though in States I see both of them.... What's going on?! :DP.S. It can't match a different rule - one that is not logging let's say - because ALL my rules are set to log. So no matter what rule it'd match, I'd have to see it in the logs.
When I opened this forum post I tried to reach the machine from a certain public IP. That was on the 17th of October. I can still see that log line. If I open a new connection (different source port, naturally), the traffic is forwarded properly, the traffic reaches the target machine, but I don't see the connection in the logs, even though I see it in the states.
P.S. could it be an issue that the target machine doesn't reply? Since this is UDP, I get no reply from the target....?
-
Hmm, I mean matching some other unexpected rule is about the only thing I could imagine doing this. It could be something dynamic perhaps.
If you check states created by the traffic using
pfctl -vss
and grep-ing for something do you see the expected rule number? The same rule number on very state? -
# pfctl -vss | grep x.y.z.xx all udp 10.151.0.5:1194 (a.b.c.d:1194) <- x.y.z.xx:56223 NO_TRAFFIC:SINGLE vtnet2.305 udp x.y.z.xx:56223 -> 10.151.0.5:1194 SINGLE:NO_TRAFFIC
I don't see a rule number anywhere.