Incorrect netmask in network configuration

Status
Not open for further replies.

Divvy

Active Member
806
2009
18
0
Hi guys,

I had some problems with netmask of my additional IPs that was showing 255.255.255.0 instead of 255.255.255.255.
I fixed that and contacted my hosting provider support to confirm if everything was correct with the new IP configuration showing the log of the command "ifconfig":

root@server [~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:22:15:AB:96:62
inet addr:46.105.121.215 Bcast:46.105.121.255 Mask:255.255.255.0
inet6 addr: fe80::222:15ff:feab:9662/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24879514 errors:0 dropped:0 overruns:0 frame:0
TX packets:37628599 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2963209878 (2.7 GiB) TX bytes:45812951640 (42.6 GiB)
Interrupt:20 Memory:fe500000-fe520000

eth0:cp1 Link encap:Ethernet HWaddr 00:22:15:AB:96:62
inet addr:94.23.78.68 Bcast:94.23.78.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:fe500000-fe520000

eth0:0 Link encap:Ethernet HWaddr 00:22:15:AB:96:62
inet addr:178.32.52.69 Bcast:178.32.52.69 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:fe500000-fe520000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1495849 errors:0 dropped:0 overruns:0 frame:0
TX packets:1495849 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:697238017 (664.9 MiB) TX bytes:697238017 (664.9 MiB)


And they said this:
"Regarding the interface 'eth0:0', everything seems to be correct now. However, the interface 'eth0:cp1' IP broadcast is incorrect. As IP has a subnet mask '/32' the broadcast IP should be the IP itself (94.23.78.68)."

I tried to fix by running the command:
Code:
sed -i 's/94.23.78.255/94.23.78.68/g' /etc/ips; /etc/init.d/ipaliases restart

But I think that something is wrong.
Here goes the log:
root@server [~]# sed -i 's/94.23.78.255/94.23.78.68/g' /etc/ips; /etc/init.d/ipaliases restart
Shutting down eth0:0 [ OK ]
UnRouting 94.23.78.68 [ OK ]
Shutting down eth0:cp1 [ OK ]
Bringing up eth0:cp1 [ OK ]
Routing 94.23.78.68 [ OK ]
Bringing up eth0:cp2 [ OK ]
Routing 178.32.52.69 [ OK ]

root@server [~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:22:15:AB:96:62
inet addr:46.105.121.215 Bcast:46.105.121.255 Mask:255.255.255.0
inet6 addr: fe80::222:15ff:feab:9662/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26237619 errors:0 dropped:0 overruns:0 frame:0
TX packets:39680507 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3122661542 (2.9 GiB) TX bytes:48244727511 (44.9 GiB)
Interrupt:20 Memory:fe500000-fe520000

eth0:cp1 Link encap:Ethernet HWaddr 00:22:15:AB:96:62
inet addr:94.23.78.68 Bcast:94.23.78.68 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:fe500000-fe520000

eth0:cp2 Link encap:Ethernet HWaddr 00:22:15:AB:96:62
inet addr:178.32.52.69 Bcast:178.32.52.255 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:20 Memory:fe500000-fe520000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1571468 errors:0 dropped:0 overruns:0 frame:0
TX packets:1571468 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:725252851 (691.6 MiB) TX bytes:725252851 (691.6 MiB)

I notice two things:

1- I don't have 'eth0:0' anymore,now I have a 'eth0:cp1' and 'eth0:cp2', it seems that was renamed. Is this ok?

2- It seems that eth0:cp1 is fine now:
inet addr:94.23.78.68 Bcast:94.23.78.68 Mask:255.255.255.255

But eth0:cp2 (old eth0:0 that was already fine) is not:
inet addr:178.32.52.69 Bcast:178.32.52.255 Mask:255.255.255.255


Any ideas? Can someone help me with these?

Thank you guys!

Regards!!
 
3 comments
You can manually edit each ip one by one using ssh.

edit each cp file and change the broadcast ip then restart the network.

The location is /etc/sysconfig/network-scripts/
 
Hi,

Thank you for your reply and for trying to help me!

I don't understand what file I need to edit:

Code:
root@server [/etc/sysconfig/network-scripts]# ls./                ifdown-ipv6*    ifup-eth*     ifup-sit*
../               ifdown-isdn@    ifup-ippp*    ifup-sl*
ifcfg-eth0        ifdown-post*    ifup-ipsec*   ifup-tunnel*
ifcfg-eth0:0      ifdown-ppp*     ifup-ipv6*    ifup-wireless*
ifcfg-eth0:0.bak  ifdown-routes*  ifup-ipx*     init.ipv6-global*
ifcfg-lo          ifdown-sit*     ifup-isdn@    net.hotplug*
ifdown@           ifdown-sl*      ifup-plip*    network-functions
ifdown-bnep*      ifdown-tunnel*  ifup-plusb*   network-functions-ipv6
ifdown-eth*       ifup@           ifup-post*
ifdown-ippp*      ifup-aliases*   ifup-ppp*
ifdown-ipsec*     ifup-bnep*      ifup-routes*
 
Just add your ips using ifcfg-eth0 as base, copy that file and rename the copy as ifcfg-eth0:0, ifcfg-eth0:1, etc...

And then edit the details inside to match what your provider has given you.

Then do a "service network restart" to restart the network scripts you made. Better google some more on adding ips on Centos.
 
Status
Not open for further replies.
Back
Top