4 managed switches at factory IP, can I upload configurations using MAC device addres to differentiate

2

1

I have four Moxa TN4528A switches on an ethernet network, I know the factory set MAC addresses for each switch. I am trying to create a script that will upload a switch configuration to a set MAC address. The problem being all four switches have the same default factory IP.

I have four configurations, SW1.ini, SW2.ini, SW3.ini and SW4.ini, the script asks the user to input the MAC address of each switch 1 to 4 then will upload the corresponding configuration file for each switch.

Is this possible, normally I isolate each switch and connect using default IP but I am trying to automate the process. Can this be done ?

Thank you for your help.

user2829148

Posted 2019-10-04T08:39:14.127

Reputation: 23

Answers

1

Yes – all packets on Ethernet are already sent to a specific destination MAC address, so it should be possible as long as your computer has the correct MAC address in its ARP cache.

Usually the MAC address is automatically resolved using ARP, and with four devices your computer will choose randomly out of the four ARP responses it receives. However, to avoid this, you can add a static neighbour entry using ip neigh on Linux, arp on most other systems.

For example:

  • Linux: ip nei add 192.168.0.1 dev eth0 lladdr 00:15:5d:21:cf:1c
  • Windows: arp -s 192.168.0.1 00-15-5D-21-CF-1C
  • RouterOS: /ip arp add address=192.168.0.1 mac=00:15:5D:21:CF:1C interface=ether0

Then you can perform your upload, replace the neighbour entry, and repeat. Other devices will discard packets based on the MAC and won't even look at the IP header.

(This is assuming a direct connection to the same Ethernet. If there are routers in the way, then the router nearest to your switches needs its ARP cache to be updated instead.)

user1686

Posted 2019-10-04T08:39:14.127

Reputation: 283 655

Perfect, ill look into this further now i know it can be done. Thank you for your assistance. – user2829148 – 2019-10-04T09:22:51.883