Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Removing all traffic from a network device?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 78

PostPosted: Sat Mar 05, 2016 9:47 pm    Post subject: Removing all traffic from a network device? Reply with quote

Hi,

I have four PCs, each of them have two network cards built-in.
One is connected to a router to access the internet.
The second network card of each PC is connected to a switch and should be used only by one program.

I use these two programs to send an receive raw ethernet frames:
https://gist.github.com/austinmarton/1922600
https://gist.github.com/austinmarton/2862515

However, I receive other frames, which are not send by the above program.

I tried to configure the interface with and without an IP address and tried to switch off ARP.
But it seems that I get other packets nevertheless.

Is it possible to remove alle traffic from a network device aceept packets that are send by the above program?
Would it be possible to achive this with iptables?
Or is it possible to unregister a network device and send data "by hand" by using ioctl-commands?
(It should be possible because the RTNet project is doing it, but I think they are modifying the network drivers, which I think should be the last option.)

Thanks for any hints.

regards

Wilfried
Back to top
View user's profile Send private message
memph
n00b
n00b


Joined: 30 Aug 2015
Posts: 3

PostPosted: Mon Mar 07, 2016 1:13 am    Post subject: That's not really gentoo related, but... Reply with quote

how many of these other packets are you getting?
if not many, you may be best to add a header to your packets and have your programs ignore everything else.
those other packets could be from the ethernet layer or hardware itself (cards or switch), and be part of dealing with ethernet.

memph
Back to top
View user's profile Send private message
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 78

PostPosted: Mon Mar 21, 2016 10:03 am    Post subject: Reply with quote

Sporadic a few packets... but I want to measure what could be the maximum transfer for my application. So I think I will use a modified driver.

Thanks for your reply.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Mon Mar 21, 2016 5:29 pm    Post subject: Reply with quote

You can block all traffic but explicitly allowed using iptables (on layer3) or ebtables (layer2).
However, if there are so few of those packets, why won't you simply ignore them? Their impact on performance won't even be measurable.
Back to top
View user's profile Send private message
justXi
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2007
Posts: 78

PostPosted: Thu Mar 24, 2016 10:32 am    Post subject: Reply with quote

If there is a working tool, I don't have to implement it on my own ;).

Do you know a good tutorial/howto to learn how to use iptables and ebtalbes for this purpose?

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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