-1

My knowledge: Still at the beginning of my linux knowledge, so please correct me if I am doing something stupid or give me your opinions on that.

My Problem: I want to configure a bunch of single board computers (Raspberry Pi/BeagleBone) all in the same way. I want to use a script on a PC for that and access them via SSH/SFTP.

My Idea: I want to use a linux PC for that and install a second network card for my purpose. On that PC I want to run a DHCP server and reduce the address pool to only one address. So everytime I plug a Pi/Beagle to that extra network card it will be accessible over this IP, dispite it´s MAC address. Of course there will be only one Pi plugged at the same time but that is ok for me.

Is that a 'working' solution or isn´t it even worth trying. Do you have any hints or better ideas?

Sneha
  • 1,959
  • 6
  • 20
  • 34
  • 1
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Raspberry Pi Stack Exchange](http://raspberrypi.stackexchange.com/), [Internet of Things Stack Exchange](http://iot.stackexchange.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Feb 08 '18 at 08:39
  • You can configure DNS and call the Pi/BB with domain name, not IP. The IP can be the same or different - you configure the SSH client to open e.g. `pi-bb` and it will find the necessary IP. – i486 Feb 08 '18 at 08:53

1 Answers1

0

I've actually been doing something similar but with a different approach. I made a base image with some placeholder names/variables. I use a script to dd the image on an SD card. After that I mount the rootfs of the written SD card and and change some variables like the hostname. This is all done by a script, however I have not implemented the automatic mounting of the new sd card. I simply pop out the usb card reader and insert it again.

I don't know how many variables have to be different per device but perhaps this could approach could work for you.

One thing that could be a flaw in your approach is that the DHCP leases will be too long so your DHCP server won't be able to give out the same address to a new device.

Fuwan
  • 121
  • 1
  • 6