LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change subnet mask (https://www.linuxquestions.org/questions/linux-newbie-8/change-subnet-mask-931564/)

gianthawk 02-27-2012 10:07 AM

Change subnet mask
 
Newbie question, searched but cannot find an answer.

I have an RHEL5 server and am being told that the subnet mask is incorrect. The netstat -rn command showed:
xx.xx.xxx.0 0.0.0.0 255.255.254.0 eth1

should be :
xx.xx.xxx.0 0.0.0.0 255.255.255.0 eth1

I made the update in /etc/sysconfig/network-scripts/ifcfg-eth1
and issued service network restart
but now netstat command shows both entries. How can I remove the incorrect entry without a reboot? Is it possible?

Thanks.

mandyapenguin 02-27-2012 10:24 AM

Code:

netstat -rn
Kernel IP routing table
Destination    Gateway        Genmask        Flags  MSS Window  irtt Iface
0.0.0.0        192.168.1.1    0.0.0.0        UG        0 0          0 eth1
169.254.0.0    0.0.0.0        255.255.0.0    U        0 0          0 eth0
192.168.0.0    0.0.0.0        255.255.255.0  U        0 0          0 eth0
192.168.1.0    0.0.0.0        255.255.255.0  U        0 0          0 eth1

I tried this and could remove 169.254.0.0/16,
Code:

route del -net 169.254.0.0 netmask 255.255.0.0 dev eth0
Code:

netstat -rn
Kernel IP routing table
Destination    Gateway        Genmask        Flags  MSS Window  irtt Iface
0.0.0.0        192.168.1.1    0.0.0.0        UG        0 0          0 eth1
192.168.0.0    0.0.0.0        255.255.255.0  U        0 0          0 eth0
192.168.1.0    0.0.0.0        255.255.255.0  U        0 0          0 eth1


ratotopi 02-27-2012 10:49 AM

Leave it as it is, it won't trouble you , its a default route for windows machines but if you want to get rid of it try by setting NOZEROCONF=yes in /etc/sysconfig/network.

gianthawk 02-27-2012 11:00 AM

mandyapenguin, thanks! That worked for me.

mandyapenguin 02-28-2012 02:40 AM

Quote:

Originally Posted by gianthawk (Post 4613285)
mandyapenguin, thanks! That worked for me.

Welcome.:cool:

Satyaveer Arya 02-28-2012 07:29 AM

Now if your problem has been solved, please mark the thread as SOLVED. :)


All times are GMT -5. The time now is 10:02 AM.