netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to implement transparent proxy in bridge through nftables
@ 2019-10-22 13:04 Ttttabcd
  2019-10-22 13:25 ` Florian Westphal
  0 siblings, 1 reply; 4+ messages in thread
From: Ttttabcd @ 2019-10-22 13:04 UTC (permalink / raw)
  To: netfilter-devel

In ebtables, I can pull the direct Layer 2 forwarding traffic to the network layer through the "broute" table, but I can't find the "broute" table in nftables.

Later, I want to perform target MAC address redirection in PREROUTING, and change the target MAC to the bridge itself or the MAC of the slave interface, so that the data frame can reach the network layer.

But nftables doesn't seem to be able to perform MAC address redirection in bridge families, so there is no way to use it.

Finally, I searched the Internet for a long time, found br_netfilter, can open bridge-nf-call-iptables to pass the bridge frame to the iptables hook processing, but nftables does not support this feature.

Now I have tried all the methods that I can think of and can search. All of them are not working. I can only come here for help.

Can someone tell me how to run transparent proxy in the bridge with nftables, and the transparent proxy uses the tproxy module.

Does anyone know how to do it?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to implement transparent proxy in bridge through nftables
  2019-10-22 13:04 How to implement transparent proxy in bridge through nftables Ttttabcd
@ 2019-10-22 13:25 ` Florian Westphal
  2019-10-24  7:57   ` Ttttabcd
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Westphal @ 2019-10-22 13:25 UTC (permalink / raw)
  To: Ttttabcd; +Cc: netfilter-devel

Ttttabcd <ttttabcd@protonmail.com> wrote:
> In ebtables, I can pull the direct Layer 2 forwarding traffic to the network layer through the "broute" table, but I can't find the "broute" table in nftables.

Its not yet implemented, but this will be supported in nft as well at
some point.

> Later, I want to perform target MAC address redirection in PREROUTING, and change the target MAC to the bridge itself or the MAC of the slave interface, so that the data frame can reach the network layer.
> 
> But nftables doesn't seem to be able to perform MAC address redirection in bridge families, so there is no way to use it.
>
> Finally, I searched the Internet for a long time, found br_netfilter, can open bridge-nf-call-iptables to pass the bridge frame to the iptables hook processing, but nftables does not support this feature.
> 
> Now I have tried all the methods that I can think of and can search. All of them are not working. I can only come here for help.
> 
> Can someone tell me how to run transparent proxy in the bridge with nftables, and the transparent proxy uses the tproxy module.
> 
> Does anyone know how to do it?

You can try this example from nft man page, you need to replace the mac
address of course.

bridge prerouting meta pkttype set unicast ether daddr set 00:11:22:33:44:55


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to implement transparent proxy in bridge through nftables
  2019-10-22 13:25 ` Florian Westphal
@ 2019-10-24  7:57   ` Ttttabcd
  2019-10-24 11:46     ` Florian Westphal
  0 siblings, 1 reply; 4+ messages in thread
From: Ttttabcd @ 2019-10-24  7:57 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

> You can try this example from nft man page, you need to replace the mac
> address of course.
>
> bridge prerouting meta pkttype set unicast ether daddr set 00:11:22:33:44:55

I have been busy with other things in recent days. I didn’t read the mail. Thank you very much.

This is very helpful. Replace the destination MAC address with the bridge interface MAC address to get the packet to the network layer.

But there is a problem here, that is, the specified MAC address is fixed, this is not universal, I have to modify the command on different devices.

Is there a way for nftables to automatically get the MAC address of the interface?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to implement transparent proxy in bridge through nftables
  2019-10-24  7:57   ` Ttttabcd
@ 2019-10-24 11:46     ` Florian Westphal
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Westphal @ 2019-10-24 11:46 UTC (permalink / raw)
  To: Ttttabcd; +Cc: Florian Westphal, netfilter-devel

Ttttabcd <ttttabcd@protonmail.com> wrote:
> But there is a problem here, that is, the specified MAC address is fixed, this is not universal, I have to modify the command on different devices.

Yes.

> Is there a way for nftables to automatically get the MAC address of the interface?

Not yet, but we could extend nft/ nft_meta.c so you could do
"ether daddr set meta ifaddr" or something like that.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-24 11:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 13:04 How to implement transparent proxy in bridge through nftables Ttttabcd
2019-10-22 13:25 ` Florian Westphal
2019-10-24  7:57   ` Ttttabcd
2019-10-24 11:46     ` Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).