Coder Social home page Coder Social logo

luckman212 / rut-conntrack-parser Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 5 KB

small awk program to parse conntrack details into meaningful form on Teltonika RUTx routers running RutOS (OpenWrt fork)

Home Page: https://community.teltonika-networks.com/66676/realtime-connections-showing-impossible-incorrect-information

Awk 100.00%
awk-script openwrt rutos teltonika

rut-conntrack-parser's Introduction

rut-conntrack-parser

This is a small awk program to parse /proc/net/nf_conntrack into meaningful form on Teltonika RUTx routers running RutOS (OpenWrt fork). See forum thread for more info.

Only tested on firmware 7.04.3.

Instructions

  1. ssh to your RUTx router as root
  2. download conntrack.awk from this repo to the router, e.g. with this command:
curl -Lso /etc/conntrack.awk https://raw.githubusercontent.com/luckman212/rut-conntrack-parser/main/conntrack.awk
  1. run the command (example):
awk -f /etc/conntrack.awk /proc/net/nf_conntrack | sort -rn | head -20
  • It should display the top 20 traffic senders, sorted by MB sent
  • Adjust the -20 argument to head to see different # of results.

Example output

the columns are: MB, #packets, protocol, src[:port], dst[:port]

52.6 160761 tcp4 23.21.95.209:5672 → 41.52.63.74:38622
37.6 112630 tcp4 23.21.95.209:5672 → 41.52.63.74:49082
34.2 27998 udp4 65.206.58.209:443 → 41.52.63.74:45517
4.0 34294 tcp4 52.72.68.64:9999 → 41.52.63.74:48686
3.7 15180 tcp4 72.4.242.105:6801 → 41.52.63.74:6936
3.7 14946 tcp4 72.4.242.105:6801 → 41.52.63.74:6957
3.5 14125 tcp4 72.4.242.106:6801 → 41.52.63.74:6943
3.4 14108 tcp4 72.4.242.104:6801 → 41.52.63.74:6924
3.1 7705 tcp4 3.138.240.185:443 → 41.52.63.74:60043
2.8 2330 udp4 65.206.58.146:443 → 41.52.63.74:54149
2.8 2299 udp4 63.117.14.80:443 → 41.52.63.74:52619
1.7 12669 udp4 34.201.228.143:4000 → 41.52.63.74:30020
1.5 18146 udp4 67.212.145.11:3478 → 41.52.63.74:40114
1.5 18140 udp4 67.212.145.11:3478 → 41.52.63.74:47748
1.3 1066 udp4 63.117.14.14:443 → 41.52.63.74:34889
1.2 10014 tcp4 3.69.112.66:15010 → 41.52.63.74:36910
1.1 12917 udp4 192.168.1.1:53 → 192.168.1.203:59234
1.1 12746 udp4 192.168.1.1:53 → 192.168.1.138:36474
1.0 12029 udp4 192.168.1.1:53 → 192.168.1.147:39190
1.0 11640 udp4 192.168.1.1:53 → 192.168.1.207:60045

rut-conntrack-parser's People

Contributors

luckman212 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.