2

Due to a particular network configuration, I would like to associate MAC addresses to outgoing Ethernet frames using iptables instead of the ordinary ARP resolution, or at least have the ability to mangle packets after they have already received their destination MAC address. Is this possible with Linux?

What in particular I would like to do is to mangle an outgoing packet so that it is sent to a certain MAC address while carrying the IP address of another host.

  • You might want to use ebtables for this instead. – saiarcot895 Feb 6 '16 at 14:15
  • @saiarcot895 I specified better what I need. I can see no way to do this with ebtables. Do you have any specific advise? – Giovanni Mascellani Feb 6 '16 at 14:55
2

It seems what you want can be done easier than with ebtables (redirect target).

If you want all packets with a certain IP target address to be sent to a certain MAC address then you can simply create a static ARP entry for this address:

ip neighbour add 1.2.3.4 lladdr 11:22:33:44:55:66 dev eth0 nud permanent

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.