Jump to content

Bash Script - Automate giving IPs

Go to solution Solved by Sauron,
7 minutes ago, spbr said:

 

Thank you both

 

I do want to use DHCP, but I want this to be automatically done, with the user only being asked on how many machines there is on the network, then the bash script dishes out the correct number of ips for that network.

 

Thank you

 

FYI, this will all be done raspberry pi's

run the dhcp service on all connected machines and a dhcp server on your router machine.

4 minutes ago, Nicholatian said:

What do you mean, “giving IPs”? There isn’t a whole lot of context in your post.

 

3 minutes ago, unijab said:

why not dhcp?

Thank you both

 

I do want to use DHCP, but I want this to be automatically done, with the user only being asked on how many machines there is on the network, then the bash script dishes out the correct number of ips for that network.

 

Thank you

 

FYI, this will all be done raspberry pi's

Link to post
Share on other sites

Just now, BubblyCharizard said:

are you assigning subnets that are only the size of how many machines are connected with the correct subnet mask?

 

are you still going to configure the machines IP's manually or do you need an autoconfig utility

 

Thank you

 

I don't want to manually do anything, all done automatically within the bash script

Link to post
Share on other sites

7 minutes ago, spbr said:

 

Thank you both

 

I do want to use DHCP, but I want this to be automatically done, with the user only being asked on how many machines there is on the network, then the bash script dishes out the correct number of ips for that network.

 

Thank you

 

FYI, this will all be done raspberry pi's

run the dhcp service on all connected machines and a dhcp server on your router machine.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

27 minutes ago, BubblyCharizard said:

unless you have a specific use case, writing extra code to try and outsmart the router is pointless

If I understand the question correctly he's using a computer for this, not a dedicated router.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

14 minutes ago, Sauron said:
42 minutes ago, BubblyCharizard said:

unless you have a specific use case, writing extra code to try and outsmart the router is pointless

If I understand the question correctly he's using a computer for this, not a dedicated router.

either way....DHCP servers can usually handle basic requests fairly easily

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×