changing subnetmask on all servers

CoolMike

Well-Known Member
Sep 6, 2001
309
0
316
Hi

I have to change the subnet mask on all my cpanel servers in a few days. I'm wondering, is it enough if I change the file "/etc/sysconfig/network-scripts/ifcfg-eth0"? Or is there anything else needed? After I made the change there, do I need to restart a service?

I use Centos 3.5.

Thanks
Michael
 

CoolMike

Well-Known Member
Sep 6, 2001
309
0
316
I just realized in this file I have only the main IP adress, what about the second IP which I have configured on this servers? I did expect that there will be also a file ifcfg-eth0:1, but I did not find it.

Michael
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
Run ifconfig to check how your IP addresses are bound. After making changes you need to down and up the interface. Remotely, this is best done with:

/etc/init.d/network restart

But do be aware that this can render the server inaccessible and may require a manual restart of the network from the console. If you have access to the console remotely, do that restart from there. If not, it might be better to simply reboot.
 

CoolMike

Well-Known Member
Sep 6, 2001
309
0
316
Hi Chirpy

ipconfig shows this:

eth0 Link encap:Ethernet HWaddr 00:C0:9F:3E:38:EF
inet addr:194.xxx.xxx.xxx Bcast:194.xxx.xxx.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:93779895 errors:0 dropped:0 overruns:0 frame:0
TX packets:143716683 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3245413184 (3095.0 Mb) TX bytes:2427647214 (2315.1 Mb)
Base address:0xece0 Memory:fe2e0000-fe300000

eth0:1 Link encap:Ethernet HWaddr 00:C0:9F:3E:38:EF
inet addr:194.xxx.xxx.xxx Bcast:194.xxx.xxx.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0xece0 Memory:fe2e0000-fe300000
But I have only a /etc/sysconfig/network-scripts/ifcfg-eth0 file and not a second one for eth0:1.

Where can I change the subnetmask for the second ip address?

Thanks
Michael
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
They're setup by /etc/init.d/ipaliases and take the information from the file /etc/ips which contains, among other things, the network mask information.