Replacing a server while keeping the ip

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
Hello,
Current server runs on linux and gets a dynamic ip. About 10 devices map to it's share. I do not know how long are the leases or even know the hardware (don't have access yet). I want to avoid having to set a new mapping on each and every device. So I thought maybe if I can assign the same ip and just copy all the files to datasets with the old folders' names - it will all be the same as the old server and just work. Is this the right approach? Thank you.
 
Joined
Jan 27, 2020
Messages
577
In your router, give your FreeNAS a static IP, the same as it is now.
When switch servers no copying should be requiered.

Simply backup your FreeNAS config -> shut-down you old server -> remove your storage drives -> put them in the new server -> re-install FN on boot device -> import config -> voilá

It may even work without re-installing FN but better be safe.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
So I thought maybe if I can assign the same IP and just copy all the files to datasets with the old folders' names - it will all be the same as the old server and just work. Is this the right approach? Thank you.

Assuming you don't use dynamic associated DNS or something... Just replace server 1 with server 2 and set Server 2 to use a static IP thats the same as the dynamic IP server 1 used before. Networking wise thats all thats needed.
 
Joined
Jan 27, 2020
Messages
577
It'd be a pretty good trick to have a FreeNAS config on a Linux server.
Uhh, I've missed that part. Yeah, switching from linux to FN is something for itself.
 

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
In your router, give your FreeNAS a static IP, the same as it is now.
When switch servers no copying should be requiered.

Simply backup your FreeNAS config -> shut-down you old server -> remove your storage drives -> put them in the new server -> re-install FN on boot device -> import config -> voilá

It may even work without re-installing FN but better be safe.

Thank you.
I feared that I have to release the IP for it to be available for the new server. Can I just plug the old out and the new in and set the same IP? wouldn't it be taken already and searching for the old MAC?

I still haven't learned about importing. I thought it is irrelevant since the old server does not have FN on it. So I'll read about it before asking further about this. Anyway it is just 60-70GB so it might be simpler to copy it over the net (before replacing). I also want them to have another machine ready in case of problems.
 

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
Assuming you don't use dynamic associated DNS or something... Just replace server 1 with server 2 and set Server 2 to use a static IP thats the same as the dynamic IP server 1 used before. Networking wise thats all thats needed.
Thank you.
So just to make sure - I shouldn't worry about the lease not expiring?
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Thank you.
So just to make sure - I shouldn't worry about the lease not expiring?
Okey:

short 101 on DHCP:
DHCP tells PC's what IP to get... Before it gives out a "lease" it checks if it already has a lease, based on the MAC-address the request came from.
Thats the only thing DHCP does, after a PC gets a IP using DHCP, it acts just like any other PC (with either a static or dhcp IP, it doesn't mater).

The New server has a new MAC-adress, so would get a new IP if you put it on DHCP. However: if you remove the old server and put the new server with the same IP on "static" it would just act like it has that IP. No one cares(*) it didn't get it via DHCP.

As long as there are no 2 PC's with the same IP, online at the same time, you won't have a problem with a simple home network. How the PC got that IP is irrelevant.

Thank you.
I still haven't learned about importing. I thought it is irrelevant since the old server does not have FN on it. So I'll read about it before asking further about this. Anyway it is just 60-70GB so it might be simpler to copy it over the net (before replacing). I also want them to have another machine ready in case of problems.

However:
Now you are talking about a network copy, while you where previously talking keeping the same IP. To be VERY clear: you can't network copy from 2 PC's having the same IP

You also didn't talk about importing and didn't even tell us it was a Linux ZFS system and you where planning importing. There are quite some cases you can't "simply" import a ZoL pool into freenas

All things considered:
I get a feeling you are in over your head and are skipping very relevant information to help you.


(*) professional switches and some specific professional security configs might care.
 

Kcaj

Contributor
Joined
Jan 2, 2020
Messages
100
- Are you using DHCP and or static leases?
- Are the shares mapped to a IP or hostname?
 
Last edited:

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
Assuming you don't use dynamic associated DNS or something... Just replace server 1 with server 2 and set Server 2 to use a static IP thats the same as the dynamic IP server 1 used before. Networking wise thats all thats needed.
Thank you.
So just to make sure - I shouldn't worry about the lease not expiring
Okey:

short 101 on DHCP:
DHCP tells PC's what IP to get... Before it gives out a "lease" it checks if it already has a lease, based on the MAC-address the request came from.
Thats the only thing DHCP does, after a PC gets a IP using DHCP, it acts just like any other PC (with either a static or dhcp IP, it doesn't mater).

The New server has a new MAC-address, so would get a new IP if you put it on DHCP. However: if you remove the old server and put the new server with the same IP on "static" it would just act like it has that IP. No one cares(*) it didn't get it via DHCP.

As long as there are no 2 PC's with the same IP, online at the same time, you won't have a problem with a simple home network. How the PC got that IP is irrelevant.



However:
Now you are talking about a network copy, while you where previously talking keeping the same IP. To be VERY clear: you can't network copy from 2 PC's having the same IP

You also didn't talk about importing and didn't even tell us it was a Linux ZFS system and you where planning importing. There are quite some cases you can't "simply" import a ZoL pool into freenas

All things considered:
I get a feeling you are in over your head and are skipping very relevant information to help you.


(*) professional switches and some specific professional security configs might care.

Yeh I'm way over my head. Just doing this for my brother. They still have that old server in case anything goes wrong. but I'm doing my best to learn.
That's a great explanation about IP. I was searching the web but this is just what I didn't find.
About the copy procedure - I plan on connecting the new with dhcp while the old is still connected, so naturaly they will have different IP. As far as I know the old one is no ZFS. I think it is unubtu server with ext but it is just a guess. So I thought of just copying the files and assign them guest permission (which is what they have now because anybody can do anything there) but I haven't yet figured out how to do it.
 

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
- Are you using DHCP and or static leases?
- Are the shares mapped to a IP or hostname?

-DHCP leases
- In most cases to a hostname but sometimes we didn't see the hostname so we mapped to an IP
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Thank you.
So just to make sure - I shouldn't worry about the lease not expiring


Yeh I'm way over my head. Just doing this for my brother. They still have that old server in case anything goes wrong. but I'm doing my best to learn.
That's a great explanation about IP. I was searching the web but this is just what I didn't find.
About the copy procedure - I plan on connecting the new with dhcp while the old is still connected, so naturaly they will have different IP. As far as I know the old one is no ZFS. I think it is unubtu server with ext but it is just a guess. So I thought of just copying the files and assign them guest permission (which is what they have now because anybody can do anything there) but I haven't yet figured out how to do it.


Thats the way to do it:

- New one added just with DHCP
- Network copy (or usb disks for all I care)
- remove the old one
- New one -> static IP to the IP that was previouslt used by the old one.

done.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
- In most cases to a hostname but sometimes we didn't see the hostname so we mapped to an IP

Be aware that the new system can't use the same hostname or IP while the old one is still at work.
After the old one is removed it doesn't really mater, because there is nothing left to conflict with ;)
 

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
Thats the way to do it:

- New one added just with DHCP
- Network copy (or usb disks for all I care)
- remove the old one
- New one -> static IP to the IP that was previouslt used by the old one.

done.
About the network copy - can i do it through the dashboard or do I need a command line? from what is saw - import is not supported from ext3-4
 

Kcaj

Contributor
Joined
Jan 2, 2020
Messages
100
-DHCP leases
- In most cases to a hostname but sometimes we didn't see the hostname so we mapped to an IP

  • Are they static DHCP leases?
  • Since you are also mapping to a hostname you will need to make changes regarding that. Depend how the hostname is resolved you may need to alter other network services
 

Harlem

Cadet
Joined
Feb 21, 2020
Messages
7
When your old server has a DHCP address, that address will be in the address space, which is under control of your DHCP server. Having said that, it isn't a good idea to set such an IP address from the client side because it could interfere with the DHCP server's address management.

Better, after migrating the data to the new server and removing the old server from the network apply the old system's MAC address to the new system. You can do that in FreeNAS' Web GUI:
  • Unplug your new system from network,
  • Edit the NIC in Network Interfaces and add in Options: hwaddr <oldMacAddress> ether <oldMacAddr>.
  • Save the change
  • Plug in and your DHCP should give your new server the old lease.
An final thought: It isn't a good idea to use DHCP addresses for infrastructure components. Perhaps you could supersede your brother to make a cut and change the IP address to a new fixed one.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
When your old server has a DHCP address, that address will be in the address space, which is under control of your DHCP server. Having said that, it isn't a good idea to set such an IP address from the client side because it could interfere with the DHCP server's address management.
It would (indeed) be preferable if he would give it a new IP outside of adress space.

old system's MAC address to the new system. You can do that in FreeNAS' Web GUI:

Ohh PLEASE, don't advice people to do MAC shuffles just to trick DHCP. if you need to force an IP through DHCP use a static DHCP lease as adviced before, don't shuffle mac adresses.
There are about 100 things that can go wrong with this and no one on a forum would figure out that you shuffled mac adresses.


An final thought: It isn't a good idea to use DHCP addresses for infrastructure components. Perhaps you could supersede your brother to make a cut and change the IP address to a new fixed one.

Yes, this is the BEST advice... If you need to use fixed IP's use static IP's. Don't go mess with DHCP.

Anyhow:
- I think OP now has a shit ton of different options how we would possibly solve this issues giving the constraints.

The problem is: We also agree those constraints ("it has to be using dynamic dhcp or at least the same IP from within the DHCP pool") shouldn't be there.
So I think we should leave this discussion with the fierce note:
YOU CAN, BUT DO NOT. (make it static instead)
 

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
Be aware that the new system can't use the same hostname or IP while the old one is still at work.
After the old one is removed it doesn't really mater, because there is nothing left to conflict with ;)
  • Are they static DHCP leases?
  • Since you are also mapping to a hostname you will need to make changes regarding that. Depend how the hostname is resolved you may need to alter other network services
I think it is a static DHCP (I didn't build the old server).
Can you please elaborate on mapping to a host. Can't I just change the host name from
 

tomerg

Dabbler
Joined
Mar 9, 2020
Messages
37
It would (indeed) be preferable if he would give it a new IP outside of address space.



Ohh PLEASE, don't advice people to do MAC shuffles just to trick DHCP. if you need to force an IP through DHCP use a static DHCP lease as adviced before, don't shuffle mac adresses.
There are about 100 things that can go wrong with this and no one on a forum would figure out that you shuffled mac adresses.




Yes, this is the BEST advice... If you need to use fixed IP's use static IP's. Don't go mess with DHCP.

Anyhow:
- I think OP now has a **** ton of different options how we would possibly solve this issues giving the constraints.

The problem is: We also agree those constraints ("it has to be using dynamic dhcp or at least the same IP from within the DHCP pool") shouldn't be there.
So I think we should leave this discussion with the fierce note:
YOU CAN, BUT DO NOT. (make it static instead)
I never meant to use nothing other then static. I have no idea why the former network manager used dhcp. Maybe he set it through the router.
 
Top