IP not deleted succesfully

mmgenius

Verified User
Joined
Jan 20, 2004
Messages
180
I tried to delete an IP address from the server (in IP Management). From directadmin the IP is deleted but when I login with SSH I still see the IP address in ifconfig under eth0:0. How can I restore this IP address (I allready tried to add it again, but then directadmin let me know that it can't be added because it allready exists on the system), or how can I delete the IP address manually?
 
If DirectAdmin's deletion of the IP address seemed to work but the server still answers onthat IP# and shows it when you run ifconfig, then it's likely it was added by automatic scripts at startup.

On most Linux boxes you'll find a file for the eth0:0 IP# at /etc/sysconfig/network/ifcfg-eth0:0 You can simply remove (renaming it may not work) the file and restart your network.

But when you try to add an IP# through DirectAdmin and the file already exists DirectAdmin should give you a warning but add the IP# anyway, so be sure to check.

Jeff
 
Jeff,

The IP address was added by Directadmin.
There is no file /etc/sysconfig/network-scripts/ifcfg-eth0:0 (OS is centos), this was also the first thing I checked :)

If I try to readd the IP address I get the message 'IP 164.138.105.58 already exists on eth0' now he does add it, (strange, yesterday not).
When I delete the IP address from directadmin, he doesn't delete it from ifconfig.
I added an other IP address and also for this ip address there is no ifcfg-eth0:1 file but it shows up in ifconfig.

How are these IP address added then?

Kind regards,
Maarten
 
DirectAdmin doesn't manipulate the files in /etc/sysconfig/network-scripts to manage ip#s; it uses it's own files, called ip.list.

The one it uses to start networks at startup is at /usr/local/directadmin/data/admin/ip.list, and contains a list of all the IP#s on the server. The script it uses to add the IP#s is /usr/local/directadmin/scripts/startips.

Writing now specifically about CentOS servers, because that's the distribution I'm most familar with and use on a regular basis, in recent versions of DirectAdmin the scrit is managed with chkconfig, and is copied into /etc/rc.d/init.d (it's called from /etc/rc.d/rc3.d). It's called immediately after the network is setup, at system startup.

Note it's not called with a standard network restart, which is why it needs to bec alled separately if you ever do a network start or restart from the command line in order for the IP#s controlled by DirectAdmin to work.

While it can be run as case stop, (with the K50 prefix), if it is, it does nothing but simply exists without error.

When new IP#s are added or removed in DirectAdmin, they are done so with a direct call to the OS, I believe using ifconfig (if I recall correctly).

Jeff
 
Back
Top