FreeBSD Assign IP from Mysql

Can anyone tell me how to do this?

I`m a newbie in FreeBSD and I have to admin a network here. I did a script that will write the MACs into a mysql DB but I don't know how to use that DB in order to assign IPs. I`ll have two columns: MAC and IP. I want the server to give each MAC from the table the corresponding IP address.

Thanks in advance.
 
My bad...

I already have a DHCP server but at the moment, I log onto the server and change the MACs manually... I want this to be done automatically, MACs being taken from a MySQL db. Is it possible?
 
hac3ru said:
I already have a DHCP server but at the moment, I log onto the server and change the MACs manually. I want this to be done automatically, MACs being taken from a MySQL db. Is it possible?
For starters, why on earth are you locking MACs and IPs? Let DHCP do the job it's supposed to do.

As for servers, they shouldn't use DHCP at all, they should have static IP addresses.

But if you're hellbent on making your life more complex than it should be then I guess you could write a simple perl script to get the data from MySQL and create the lease file that's needed for DHCP.
 
I took this server as it is and I want to make the process easier for the user. There's a network where campus network with lots of rooms and lots of IPs. Each floor has something like xxx.xxx.1 (floor).xxx so you have some control over who has what IP.

Anyways. I`ll try using perl and see what`s happening :)
 
hac3ru said:
Each floor has something like xxx.xxx.1(floor).xxx so you have some control over who has what IP...
Stick each floor in its own VLAN and use a DHCP relay. Each machine will then get an IP address from a specific range. All neatly compartmentalized.
 
hac3ru said:
I took this server as it is and I want to make the process easier for the user. There's a network where campus network with lots of rooms and lots of IPs. Each floor has something like xxx.xxx.1 (floor).xxx so you have some control over who has what IP.

Anyways. I`ll try using perl and see what`s happening :)

Why are you wanting to do this? IPs are not worth keeping track of for end user machines, this is what DNS is for.

Get used to dealing with DNS, because with the coming of ipv6, you sure as hell aren't going to be remembering subnet/IP information to figure out where a particular machine is.

How is this going to be easier for the user than just using DHCP?
 
Well, those are the rules for now. As I said, I took over the network in this state and I`m not allowed to alter it at the moment. Still, if I do this it`s not an alteration :)
 
Talk to your boss, tell him the network is a mess. Hire a proper network engineer to redesign the whole lot.
 
Back
Top