OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • How do I detect "bad" packets and prevent them from hitting the WAN?
« previous next »
  • Print
Pages: [1]

Author Topic: How do I detect "bad" packets and prevent them from hitting the WAN?  (Read 5135 times)

RNHurt

  • Newbie
  • *
  • Posts: 26
  • Karma: 2
    • View Profile
    • KangarooBox
How do I detect "bad" packets and prevent them from hitting the WAN?
« on: January 16, 2019, 09:11:38 am »
I'm using OPNSense to protect a small elementary school's network and we have been having frequent outages for the past 4 months.  We've investigated everything we can think of and so far haven't been able to fix the problem. 

Our ISP has suggested that our problem looks similar to other issues they've seen where there is a bad or failing component on the network that is sending out malformed packets and disrupting our service.  The cable modem sees these "bad" packets and starts dropping legitimate packets.

To me, our problem feels like a lack-of-bandwidth type of issue but everything we can see tells us that we are not oversubscribed.  When the outage happens, OPNSense is not reporting any type of bandwidth spike, our WAN traffic isn't topped out, even the firewall hardware looks fine (CPU, RAM, temp, etc.)

My question then is how do I track down the device that is causing the issue?  Is it possible to do a tcpdump on OPNsense and export that data for later evaluation?  I've installed the VnStat plugin but I don't think that is going to help.  Are there any other plugins that I should try?
Logged
Later...
Richard

bartjsmit

  • Hero Member
  • *****
  • Posts: 2023
  • Karma: 194
    • View Profile
Re: How do I detect "bad" packets and prevent them from hitting the WAN?
« Reply #1 on: January 16, 2019, 12:57:21 pm »
Hi Richard,

You can capture packets on the interface and/or configure ntopng to show your most prolific talkers.

Interfaces, diagnosis, packet capture

Another option is to push netflow data to an external host for analysis. Solarwinds is a common option.

Bart...
Logged

ArrayElement

  • Newbie
  • *
  • Posts: 3
  • Karma: 2
    • View Profile
Re: How do I detect "bad" packets and prevent them from hitting the WAN?
« Reply #2 on: January 16, 2019, 02:05:37 pm »
Seems like you're going to have a ton of packets to deal with, and tcpdump will very likely fill up your hard drive if you are using smallre equipment.

If that is the case, you can do this:

1. SSH into your box
2. Run this command:

tcpdump -s 0 -U -n -i reX -w - | nc [ip you want to send to] [port number]

This will fire up tcpdump on your specified interface (re0? re1?), and pipe the output to netcat, which will send that data to an ip and port of your choosing.

Let's assume you have a (linux) workstation at 192.168.1.100, you would do:

tcpdump -s 0 -U -n -i re0 -w - | nc 192.168.1.100 8888

No, on that workstation, you need to have netcat start listening to that traffic, and allow it to be read:

First, we have to make a named pipe:

mkfifo /tmp/fwdump

Next, we need to have netcat listen to the traffic and run it to that pipe:

nc -l 8888 /tmp/fwdump

Lastly, start wireshark to listen to that pipe:

wireshark -k -i /tmp/fwdump

Now, you can watch the traffic in real-time on your local workstation, and dump the *giant* file to disk for perusal.
Logged

xames

  • Full Member
  • ***
  • Posts: 110
  • Karma: 3
    • View Profile
Re: How do I detect "bad" packets and prevent them from hitting the WAN?
« Reply #3 on: January 16, 2019, 09:36:39 pm »
Wow, array solution seems advanced mode.
Logged

RNHurt

  • Newbie
  • *
  • Posts: 26
  • Karma: 2
    • View Profile
    • KangarooBox
Re: How do I detect "bad" packets and prevent them from hitting the WAN?
« Reply #4 on: January 16, 2019, 09:49:17 pm »
Quote from: bartjsmit on January 16, 2019, 12:57:21 pm
You can capture packets on the interface and/or configure ntopng to show your most prolific talkers.

Interfaces, diagnosis, packet capture

Another option is to push netflow data to an external host for analysis. Solarwinds is a common option.

I don't think the amount of traffic is a problem, it seems to be the type of traffic.  I'm using the built-in flow logs to watch things happen and at no point does our bandwidth spike and no individual IP address has a lot of activity.

I do like your idea about SolarWinds, unfortunately they seem to be focused on Windows and we're more of a Unix/macOS shop.  Any other, possibly open source, suggestions for similar network monitoring?

Thanx!
Richard
Logged
Later...
Richard

bartjsmit

  • Hero Member
  • *****
  • Posts: 2023
  • Karma: 194
    • View Profile
Re: How do I detect "bad" packets and prevent them from hitting the WAN?
« Reply #5 on: January 16, 2019, 10:00:39 pm »
There is a netflow add-on for Splunk: https://splunkbase.splunk.com/app/1658/

Bart...
Logged

RNHurt

  • Newbie
  • *
  • Posts: 26
  • Karma: 2
    • View Profile
    • KangarooBox
Re: How do I detect "bad" packets and prevent them from hitting the WAN?
« Reply #6 on: January 18, 2019, 10:06:37 pm »
I installed and enabled the ntopng plugin and it has the ability to capture and download the most recent packets.  I'm guessing it captures them in a round-robin sort of fashion and allows you to download the last 5 seconds --> 10 minutes of packets captured with pcap.

I think what I'll do is wait until the problem happens and then grab the last 10 minutes of packets.  I should be able to load that up into Wireshark and see what's going on.

Thanx!
Logged
Later...
Richard

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • How do I detect "bad" packets and prevent them from hitting the WAN?
 

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