A
A
Alexander Buliterov2020-01-12 00:06:46
Electronics
Alexander Buliterov, 2020-01-12 00:06:46

How to properly connect two ethernet interfaces and do packet filtering?

Hello dear experts!
There is a device with two ethernet ports/interfaces. It is necessary to transfer packets from one to another only to a specific ip. Everything is possible in the other direction. Network settings may vary.
What is the name of this forwarding mode? Bridge? Routing?
Is it possible to just transfer packets from one interface to another without modifying the packet?
What is the easiest way to implement this? The device is on micro stm32, there is a tcp stack.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
ky0, 2020-01-12
@ky0

This is a question for the device - is it able to analyze packets and make some decisions in accordance with the data or not.
What you need is usually implemented by a firewall on the same Linux - just having a TCP stack is not enough if you need something more than combining two interfaces into a bridge, i.e., in fact, into one L2 domain.

P
pfg21, 2020-01-12
@pfg21

the question is the power of stm32. enough power - write your own / cross-port the router to stm32.
IMHO it is more direct and more efficient to take a ready-made piece of iron with ready-made Linux (from a router like nexx wt3020h to raspberries / bananas / etc.) and draw routing rules in it.

O
oam2oam, 2020-01-12
@oam2oam

Such a device is called a hub if it does not filter packets. The problem with stm32 is that it has only one MAC - therefore, you can connect only one eth interface. Now NXP has a CORTEX-M7 processor with two MACs - it's very easy to do it on it: you need to take packets and filter (even a TCP stack is not needed).
I have about the same development on stm32f107, but it does not filter packets, but monitors and injects as needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question