Switch – OpenWRT: Redirect traffic from LAN port #4 to specific IP address

openwrtroutingswitch

I am working with a TP-WR1043ND OpenWRT router which allows port mirroring, as described in the dedicated wikipage. I'm mirroring the WAN port (#0) to LAN port #4. There is no cable in the LAN port #4.

Now, since this device only has 4 LAN ports availble and I need more, I am using a switch (!) to extend the number of LAN ports. The switch connects to LAN port #3 and has 4xLAN ports itself.

I want to recieve the mirrored traffic that goes to LAN port #4 at a specific IP or a specific port, at the switch (!). The device that recieves the mirrored traffic can only be connected to the switch's LAN ports.

Is it somehow possible to accomplish this?

Best Answer

Answer for single cable to port #4:

If it is supported, all you need is to mirror traffic to VLAN 5 and configure your port #4 as normal + tagged VLAN 5 (5 is just for example). Also, on the switch you should set the specific port as untagged VLAN 5. Your router should support VLAN mirroring, not simply port mirroring.

If it does not, you could make it vice versa:

1) mirror WAN port to port #4.
2) configure port #4 as normal + tagged VLAN 5.
3) configure all ports EXCEPT #4 (and of course, WAN) on the router as VLAN 5 untagged.
3) configure all ports on the switch EXCEPT the specific one as VLAN 5 untagged.

Then only the specific port on the switch will get mirrored traffic, all other ports on router and switch will be in VLAN 5.

Finally, you need to configure routing for the VLAN 5 network on your router.