cancel
Showing results for 
Search instead for 
Did you mean: 

Change IP address ?

SOLVED
Go to solution
Rob Yohn
Advisor

Change IP address ?

We need to move our server over to a new network from the current one. Can I just edit /etc/hosts put in the new IP address, edit /etc/rc.config.d/netconf enter the new IP, gateway and subnet for that interface, then restart /sbin/init.d/net and have the changes take?
2 REPLIES
Ismail Azad
Esteemed Contributor

Re: Change IP address ?

Hi,

Change IP address with ifconfig on that interface.... Edit /etc/rc.config.d/netconf... Use set_parms and assign same IP address... This should pretty much update everything... And ofcourse for netconf to be "re-read" you need to start and stop the service. Just need to do a few of em but doin' all keeps you on the safe side...

Since you have mentioned routes... you should take a nice look at set_parms.

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
Bob_Vance
Esteemed Contributor
Solution

Re: Change IP address ?

The procedure you have will work (I've done it many times),
EXCEPT:
the net script only ADDS routes.
Thus after you run 'net start',
you'll still have the previous defaut route in the route table:

# netstat -rvn | grep def
default/0.0.0.0 10.1.0.198 UG 0 lan0 1500
default/0.0.0.0 10.1.0.199 UG 0 lan0 1500

so, you'll have to delete the old one:

# route delete net 0.0.0.0 10.1.0.198

# netstat -rvn | grep def
default/0.0.0.0 10.1.0.199 UG 0 lan0 1500


Note that DNS would also need to be changed,
if you use it in your network.
"The lyf so short, the craft so long to lerne." - Chaucer