On Tue, Mar 26, 2013 at 02:45:23PM +0530, ajeet singh wrote:
Hello All,
I saw in the batman-adv code that random MAC address is being assigned to BAT0 Interface. I need some clarification regarding this.
I have tested the following tests, Test Scenarios: Batman_Node_ A (192.0.0.1) ---------------------- Batman_Node_B (192.0.0.2)
Test 1: First, I used batman code without any change. I used eth_hw_addr_random () for BAT0 MAC assignment. Result: I am able to ping from node A to Node B
Test 2: I commented “eth_hw_addr_random ()” and assigned MAC address of primary interface to BAT0 interface at both nodes. Now, we have same MAC for primary interface and BAT0 at both nodes. Result: I am able to ping from node A to Node B
As you guys have assigned the random MAC to BAT0 interface, I wanted to know that what would be potential problems if we assign the MAC addresses of primary interface to the bat0 interface.
Hello Ajeet,
personally I think that using the primary_if mac address for bat0 might lead to mac collisions whenever a user removes the primary_if from bat0 and add it to bat1 (for example). What would you do? whatever your answer is, using a random mac address is probably the cleanest way to address any possible issue like that.
Any user which prefer to set a particular address to bat0 can easily change it using ifconfig or macchanger (no need to change the source code).
Cheers,