Linux – tool like ‘route’ in Linux to configure the forwarding entry (dst mac address –> interface)

linuxmac addressroute

I have a problem in configuring the forwarding table in Linux.
We call IP tables for routing table in layer 3, MAC tables for forwarding table in layer 2.
Now I want to add an entry in forwarding table. I know the tool route command can be used to add routing entry in routing table like:

#[root]# route add -net 192.168.10.0 netmask 255.255.255.0 dev eth0

So, is there a tool like 'route' can let me add entry in forwarding table like:

#[root]# 'command name' add 01:02:03:04:05:06 dev eth1

All I required is how to bind the destination MAC address to a fixed network interface?!


Thanks for replying, all of you. Now it seems that I didn't introduce my goal clearly, so most of you were wondering my requirement. We are now working on a data center network experiment that mainly focusing on the forwarding tables size of the switches. In this scenario it is a fat tree topology and another research team have developed a new addressing and routing method that can guarantee two properties: multi-path and small forwarding table size. Here we called the layer 2 table a forwarding table since it is the same calling by Cisco. There is a controller in this network so all the forwarding tables can be obtained by this controller's work. The experiment now is bothering how to write the forwarding table from controller to the switches. That means, how to write the entries like MAC_ADDR—>OUTPUT INTERFACE. Please note that this network is like a big 'LAN' that no need to do the IP routing.

Best Answer

You should be able to do this using the 'arp' utility.

arp -i eth0 -s

Related Topic