Results 1 to 10 of 10
Hi all,
I have a Switch, with 5 Servers Connected to it. One of the Switch port(uplink) is connected to the Gateway Router. I have enabled port mirroring for the ...
- 11-19-2008 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 11
Challenging but interesting task.
Hi all,
I have a Switch, with 5 Servers Connected to it. One of the Switch port(uplink) is connected to the Gateway Router. I have enabled port mirroring for the Uplink port.
I have connected a Linux Server to the Mirrored Port. Now all the packets that are transferred between my 5 Servers and Router will hit my Linux Server.
The requirement is, I have generate a traffic report as following,
Source MAC (Server 1) to Dest MAC (Router) - 10 MB in 2 Hours
Source MAC (Router) to Dest MAC (Server1) - 100 MB in 2 Hours
.... likewise for all servers.
I need to Monitor traffic based on the Mac Address. Is there a tool in linux which can do this.
I have tried iptables, which can give the bytes transferred based on a rule. But iptable rules can be written only for Source Mac Address not for Destination Mac.
Anybody has got some clues .. please help out !
Thanks
rssrik
- 11-19-2008 #2
Have you tried wireshark? It might be what you're looking for.
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
Need instant help? Try us on IRC -- #linuxforums on freenode
- 11-19-2008 #3Just Joined!
- Join Date
- Jun 2007
- Posts
- 11
Thanks for replying ,
Wireshark Captures Packets. The traffic is quite heavy, so that I cannot afford to capture all packets. Instead I am looking for some kind of a counter which increments the number of bytes received based on Mac Address.
./rssrik
- 11-19-2008 #4Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
"Quite heavy"? More than 100Mbit link through your router? A P2-3 machine should have no problem collecting everything on a 10MB/sec link.The traffic is quite heavy, so that I cannot afford to capture all packets.
There are a myriad of places to pull stats. If you are not looking to write your own, you may want to consider a larger tool that gives you options down the road. An IDS like Snort may be something to consider.
- 11-19-2008 #5
- 11-20-2008 #6Just Joined!
- Join Date
- Jun 2007
- Posts
- 11
Robert ji, thanks
The Router that I have explained does IP Forwarding for the Network behind it. So the packets wont have the IP Address the Router. And there are many clients (400-500) which makes it impossible to write rules based on IP Address. Moreover I dont have access to the Router.
./rssrik
- 11-20-2008 #7Just Joined!
- Join Date
- Jun 2007
- Posts
- 11
it seems matching packets with -m mac --mac-source xxxxxxxx is possible, how to do for destination mac ???
./rssrik
- 11-20-2008 #8Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Why you can't filter on the destination MAC can be found all around the web - in short, iptables is operating on the IP layer and you don't *know* the destination MAC => Example
You may want to look at ebtables:
# Usage analogous to iptables.
# Ethernet filtering.
# MAC NAT: ability to alter the MAC Ethernet source and destination address. This can be useful in some very strange setups (a real-life example is available).
- 11-20-2008 #9Just Joined!
- Join Date
- Jun 2007
- Posts
- 11
Thanks,
I have already started to look at ebtables. But wonder whether iptables/ebtables is the only way to do traffic analysis. Isn't there any other tool, which could do traffic analysis with mac address.
Thanks again,
./rssrik
- 11-20-2008 #10Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
If you are not looking to write your own, you may want to consider a larger tool that gives you options down the road. An IDS like Snort may be something to consider.
Linux App Finder > Network Monitoring
So few options...


Reply With Quote
