IP# assignments totall wrong on newly built server

NoBaloney2

NoBaloney Internet Svcs.
Joined
Jun 17, 2007
Messages
498
Location
California
Please see this old thread for referene:

http://forum.directadmin.com/newreply.php?do=newreply&p=200657

Is this the only way to do it?

I've got a totally messed up set of ip# assignment files.

We had a server crash, so we restored to a new one. But we used a new IP# for the new server. Probably a mistake, because we're having lots of problems.

We created the new server on it's own ip# (.80).

Then we added to it all the IP#s previously assigned to the broken sever, including the old server IP#, #66.

First we restored all the resellers, selecting for them to use the IP# in the backup. We did verify that all the IP#s in the backup were active and free on the new server.

When the resellers were restored we may have made another mistake; we didn't check to see to which IP# the resellers had been restored. This probably meant (we can't be sure) that all of the resellers were created with the server IP# (.80).

We didn't check so I can't be sure, but I can tell you that's the way they are now.

Then we restored all the users for all the resellers (one pass), again selecting for them to use the IP# in the backup.

They appear to have all been restored to the IP# in the backup.

But at the admin level and at the individual resellers logins the IP# assignments are totally wrong. IP#s which were supposed to be marked as shared by the resellers aren't. They ended up instead being assigned to one of the restored users, as assigned. And as a result the resellers can't create new users; they haven't got free IP#s.

Is there any way to fix DirectAdmin's reporting of which IP#s are whose, and whether or not they're shared or server IP#s, depending on which IP#s are actually assigned (because the assignments are correct)? If not, then how can I do it by hand? This server has 27 resellers on it; I really don't want to make any mistakes.

Thanks.

Jeff
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,005
Hi Jeff,

Basically, you'd want to make sure the IPs are assigned to their respective Resellers first, then ensure they're set as "shared" (if they're supposed to be), before restoring the Users.

----

1)
First we restored all the resellers, selecting for them to use the IP# in the backup. We did verify that all the IP#s in the backup were active and free on the new server.
Are these IPs intended to be "owned" or "shared"?
I'm guessing they're owned now, if they were "free" before doing the restore.

2)
When the resellers were restored we may have made another mistake; we didn't check to see to which IP# the resellers had been restored. This probably meant (we can't be sure) that all of the resellers were created with the server IP# (.80).
As for the IP assignments (eg: the ip.list of the Reseller), you'd probably want to assign IPs to that Reseller before restoring the Users (after the Reseller is restored)
Admin Level -> IP Manager -> Assign To

if any IP is to be shared over many Reseller, this is where the trick in your referenced thread would apply (manually add a shared IP to the ip.list file for each Reseller).


3) Are all IPs that belong to Users set correctly?

If yes, then it might be an easier task of just editing the IPs files:
Code:
/usr/local/directadmin/data/admin/ips/[B]1.2.3.4[/B]
and set any "owned" IP to be shared, if it should be shared.

A sample shared IP file:
Code:
gateway=
netmask=255.255.255.0
ns=
reseller=[B]somereseller[/B]
status=shared
value=1
A sample owned IP file:
Code:
gateway=
netmask=255.255.255.0
ns=
reseller=[B]somereseller[/B]
status=owned
value=[B]someuser[/B]
so if you end up manually changing any of the IP files (any would be "ok" just leave the the server IP alone) then you'd need to rewrite the ips.conf... or just rewrite everything:
Code:
cd /usr/local/directadmin/custombuild
./build rewrite_confs
For a shared IP, the value=1 will be updated by DA each night, so you don't need to worry if the count is off.

I hope I correctly understood the current setup state.. let us know if it's different and what is wrong.

John
 
Top