Sending all lan traffic to monitor PC

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page 1, 2, 3  Next
Author Message
goofy3785
DD-WRT Novice


Joined: 30 Jun 2022
Posts: 14

PostPosted: Thu Jun 30, 2022 16:30    Post subject: Sending all lan traffic to monitor PC Reply with quote
I have a server on the network that's connected via ethernet that I would like to send all traffic to be monitored with wireshark.

This is the code I found in the forum to do this but it seems be obsolete and there's a new way to go about this. Here's a screenshot:
https://i.imgur.com/TCtI8cz.png

When I wireshark the ethernet adapter I don't see any mirrored traffic. Any ideas what I am missing?

Here's the specs of the router:
Router Name DD-WRT
Router Model Netgear R6400 v2
Firmware Version DD-WRT v3.0-r44627 (10/22/20)
Kernel Version Linux 4.4.240 #1265 SMP Wed Oct 21 08:34:03 +04 2020 armv7l
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12881
Location: Netherlands

PostPosted: Thu Jun 30, 2022 16:50    Post subject: Reply with quote
First of all your build is old and outdated current is 49392.

After update reset to defaults and rebuild manually, is strongly recommended.

Remove the entries from startup and firewall.

First test from command line and if it works Save startup.

You need the -j TEE.

The negation has been changed it should now precede the -d e.g ! -d
(or was it the other way around)

Anyway test from command line and view with iptables -vnL -t mangle

P.S not all builds have the TEE target

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Jun 30, 2022 17:03    Post subject: Reply with quote
IIRC, the old method used the TEE module, but now requires the ROUTE module.

Also, you may have to load the ROUTE module explicitly.

Code:
modprobe ipt_ROUTE


But there's no guarantee the ROUTE (or TEE) module is even available. The above works w/ FreshTomato, but I can't get it to load this module, nor accept these same firewall rules on my own RT-AC68U running DD-WRT.

ALL firewall rules belong in the firewall script, NEVER the startup script.

Anytime you add firewall rules, you should verify they got added, and are getting hits (pkts field > 0).

Code:
iptables -t mangle -vnL

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Jun 30, 2022 17:07    Post subject: Reply with quote
P.S. What you might want to consider instead is capturing an output file w/ tcpdump (which will likely require an Entware install, plus the tcpdump package), then import that to WireShark.

Depending on what you're trying to do, dealing w/ an *active* flow of traffic during analysis can be difficult. It's sometimes better to just capture the data for some defined period of time and deal w/ it offline.

In some cases, such as no support for TEE and/or ROUTE, that may be your *only* viable option.

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
goofy3785
DD-WRT Novice


Joined: 30 Jun 2022
Posts: 14

PostPosted: Thu Jun 30, 2022 17:34    Post subject: Reply with quote
eibgrad wrote:
IIRC, the old method used the TEE module, but now requires the ROUTE module.

Also, you may have to load the ROUTE module explicitly.

Code:
modprobe ipt_ROUTE


But there's no guarantee the ROUTE (or TEE) module is even available. The above works w/ FreshTomato, but I can't get it to load this module, nor accept these same firewall rules on my own RT-AC68U running DD-WRT.

ALL firewall rules belong in the firewall script, NEVER the startup script.

Anytime you add firewall rules, you should verify they got added, and are getting hits (pkts field > 0).

Code:
iptables -t mangle -vnL


I telnetted into the router and got the follow:

Code:
root@DD-WRT:~# modprobe ipt_ROUTE
modprobe: module ipt_ROUTE not found
modprobe: failed to load module ipt_ROUTE: No such file or directory
root@DD-WRT:~# iptables -t mangle -vnL
Chain PREROUTING (policy ACCEPT 208K packets, 105M bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT (policy ACCEPT 8905 packets, 982K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 198K packets, 104M bytes)
 pkts bytes target     prot opt in     out     source               destination
 8296  443K TCPMSS     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 TCPMSS clamp to PMTU

Chain OUTPUT (policy ACCEPT 7681 packets, 3296K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 206K packets, 107M bytes)
 pkts bytes target     prot opt in     out     source               destination
root@DD-WRT:~#


I don't want to update my firmware if I don't have to. The version I am on now is pretty stable. How do I find and load the `ROUTE` module?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12881
Location: Netherlands

PostPosted: Thu Jun 30, 2022 17:41    Post subject: Reply with quote
@eibgrad is not the ROUTE for older kernels and TEE for newer?

I can use TEE and tcpdump on my router (R6400)

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Jun 30, 2022 17:42    Post subject: Reply with quote
goofy3785 wrote:
I don't want to update my firmware if I don't have to. The version I am on now is pretty stable. How do I find and load the `ROUTE` module?


It would only make sense to update the *dd-wrt* firmware if we knew a recent update contained the module. But I have no way of knowing that.

That's why I said, if it's NOT available, you're stuck, and may have to consider a capture file w/ tcpdump (who knows, maybe some dd-wrt firmware already has this installed). If NOT, then you need to install Entware and the tcpdump package. This does NOT change your firmware! It installs additional packages of apps and services on USB (or temporarily in memory, if you prefer, so it won't survive a reboot).

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12881
Location: Netherlands

PostPosted: Thu Jun 30, 2022 17:45    Post subject: Reply with quote
I just checked unfortunately it is just me I added tcpdump and the TEE module myself.

It looks like both are missing from regular builds

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Jun 30, 2022 17:49    Post subject: Reply with quote
egc wrote:
@eibgrad is not the ROUTE for older kernels and TEE for newer?

I can use TEE and tcpdump on my router (R6400)


TBH, I don't recall. All I know is that I was using TEE for ages on FT (FreshTomato), then it suddenly stopped working w/ more recent FT firmware (that was probably a couple years ago). I had to switch to ROUTE. So I *assumed* they deprecated TEE in favor of ROUTE. But I could be wrong.

BTW, FWIW, neither TEE nor ROUTE work on my RT-AC68U running a relatively recent dd-wrt firmware (DD-WRT v3.0-r48432 std (03/01/22)).

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Jun 30, 2022 17:50    Post subject: Reply with quote
egc wrote:
I just checked unfortunately it is just me I added tcpdump and the TEE module myself.

It looks like both are missing from regular builds


Lucky you. Those are useful for serious debugging purposes.

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Jun 30, 2022 18:11    Post subject: Reply with quote
Another option for the OP is to install FT (FreshTomato). Even if only for diagnostic purposes. As I said, it works fine for me, at least w/ my RT-AC68U. And FT supports the Netgear r6400 v2 as well. Just save your current dd-wrt config before updating to FT, so you easily return to it.

Of course, if the diagnosis is specific to the behavior of the dd-wrt router itself, that's doesn't make sense. But I don't know the OP's intentions here.

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)


Last edited by eibgrad on Thu Jun 30, 2022 18:18; edited 2 times in total
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12881
Location: Netherlands

PostPosted: Thu Jun 30, 2022 18:12    Post subject: Reply with quote
That is why I have those Smile

I will upload modules tomorrow if I can find what is necessary.
I think it is something more besides TEE

About upgrading, I would recommend it, lots of updates and security fixes, that build is from 2020 I think

Besides the modules I have are for the latest kernel version and might not work with older kernels Sad

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6436
Location: UK, London, just across the river..

PostPosted: Thu Jun 30, 2022 18:23    Post subject: Reply with quote
yep as it's advised TEE or ROUTE...i had some struggle to make TEE to work, reading tons of threads in the past...
best bet Wireshark on TAP or tcpdump exported, but to have all the traffic stored on the router side, or on USB or fetched anywhere especially on high traffic it could be a playful game...that's where tap device comes handy...you can add a switch or hub to this port and try via those instead of tap, but on high load same issue...

also 3.0-r44627 is old and full of unpatched security flaws as well lacks of updated binaries, two of those are DNSmasq (the back bone of DDWRT) and SSL... so, if you prefer stability over security, at least you know now..!!

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12881
Location: Netherlands

PostPosted: Thu Jun 30, 2022 18:28    Post subject: Reply with quote
attached tcpdump for Broadcom arm/ K4.4
for AC68U /R7000 / R6400 etc.

I am not sure if it has any dependencies but otherwise simply extract, copy to /tmp, make executable and run from /tmp with ./tcpdump

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6436
Location: UK, London, just across the river..

PostPosted: Thu Jun 30, 2022 18:43    Post subject: Reply with quote
i simply have it via Entware although is one version older..
tcpdump - 4.9.3-4

but its installed by default on my R7000 as well R7800...no idea witch version..i guess BS maintains the most recent...
is sure need lib libpcap - 1.10.1-1

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum